9 ms·
> Sure, when Lisp came out it was "advanced". Garbage collection, AST parsing and manipulation, macros, packages, a standard library, modules, homoiconic data s
by wtbob 10y ago
> Sure, when Lisp came out it was "advanced". Garbage collection, AST parsing and manipulation, macros, packages, a standard library, modules, homoiconic data structures, etc.
The big advantage of Lisp is that is has homoiconic code, and that it's easy to work with that code, and that's it's easy to extend that code.
Lisp doesn't actually have a very good module system: but ASDF extends it so that it does. Lisp didn't actually have any OO features, but CLOS extended it so that it does.
That's the advantage of Lisp (and Lisp-like languages) which I've never encountered elsewhere: you can grow and expand the language. You don't have to wait for some committee or gatekeeper: you can do it, right now. Your way may not be the best, but you can do it.
I really miss that in other languages.
- wtetzner 10y ago> I really miss that in other languages. Elixir has a pretty good lisp-inspired macro system. And it's hygienic by default, too. And Elixir's pattern matching actually makes manipulating the forms even easier.
- wcummings 10y agoYou can implement pattern matching in lisp
- xuejie 10y agoThis is actually one example I'd like to refer to when people are talking that alternative languages with macros can achieve Lisp's flexibility: https://www.pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ https://www.pvk.ca/Blog/2014/08/16/how-to-define-new-intrins... Till this point I haven't seen anything similar in languages other than Lisp. Maybe Elixir can do this but I lack enough knowledge to judge. BTW: that does not mean I'm a Lisp zealot, been there but has been away for quite some time.
- youjiuzhifeng 10y agoClojure has a pattern matching library https://github.com/clojure/core.match https://github.com/clojure/core.match. And I think clojure is the most widely used Lisp dialect now.
- kiiski 10y agoThere is one for Common Lisp too https://github.com/m2ym/optima https://github.com/m2ym/optima
- armitron 10y agoNot by a long shot, Emacs Lisp is the most widely used Lisp dialect, by far. Clojure isn't even close.
- sitkack 10y agoMaybe if used means, "to create web applications".
- wtetzner 10y agoYes, I've used it, and it's quite nice. But it's not quite the same. In Elixir (and of course Erlang), pattern matching is pervasive. You use it when defining functions by defining multiple heads, each with a different patter. You can also use it when binding variables. For example: {:ok, result} = compute_data(some_value, another_value) If compute_data doesn't return a pair where the first value is :ok, it will throw an error.
- eggy 10y agoLFE, Lisp Flavored Erlang, is much closer to Lisp, and not just in name. And, LFE is compatible with both Elixir and Erlang. [1] To quote, Robert Virding, one of Erlang's creators and the creator of LFE: I would say that one restriction with the type of macros that elixir has, irrespective of whether we call it homoiconic or not, is that they can only manipulate existing forms in the AST, they can't define new syntactic forms. In elixir this means that you basically work with function calls. There is syntactic support for making the function calls look less like function calls but the macros you define are basically function calls. In Lisp you are free to create completely new syntactic forms. Whether this is a feature of the homoiconicity of Lisp or of Lisp itself is another question as the Lisp syntax is very simple and everything basically has the same structure anyway. Some people say Lisp has no syntax. [2] [1] http://stackoverflow.com/questions/35060080/erlang-vs-elixir-macros http://stackoverflow.com/questions/35060080/erlang-vs-elixir... [2] https://news.ycombinator.com/item?id=7623991 https://news.ycombinator.com/item?id=7623991
- wtetzner 10y agoYes, that's true, but they were saying they wanted macros in non-lisp languages. I gave an example of a non-lisp language that has lisp-like macros.
- eggy 10y agoGranted. I guess it boils down to degree of 'Lisp-like' when talking macros. Another article on HN today about Racket, Template Haskell and macros. I think the whole idea is that Haskell doesn't really need them, since it has other ways of achieving similar ends thereby making TH macros a bad fit for Haskell. I like Elixir a lot, but I have the luxury of not depending on coding for a living, so I am learning LFE because I like how it is as much a Lisp as it can be when constrained by the BEAM. Truthfully, I could stay away from all of the distributed languages like Erlang, Elixir, LFE, Pony and others, since I don't really have a use for them (yet - looking at ABM Agent-Based Modeling). But I keep at LFE by trying to duplicate the book 'The Handbook of Neuroevolution Through Erlang'. There are at least a couple of other people who have started it in LFE and the other in Elixir. A good fit for ANNs.
- 10y ago