Hi, I’ve been working in Elixir for some time now and I’d like to expand my horizons by getting familiar with Lisp.
There seem to be waaay too many dialects to the point where it’s hard to pick where to start, especially given limited time resources. In the end, I guess I’m more interested in ideas than particular implementation. On the other hand, I’d prefer a nicer development experience (tooling, stuff works out-of-the-box, etc.).
True, it is more of a scheme (which is a very lightweight lisp, with default hygenic macro’s instead of unhygenic like with lisp), but it still has every concept you’d ever want, and it’s easily one of the largest out too with libraries for about anything.
If you want Pure Lisp, you’d go with CommonLisp, but it can be quite a pain to get working on some systems (especially windows systems), and the best IDE for it is Emacs, if that tells you anything. ^.^
I think you should consider learning Emacs and Emacs Lisp. Its a complete lisp, you can use it to write external programs if you want but its incredibly powerful when your entire editor is hosted in a single language that you can evaluate in any buffer, and you can easily read, debug, understand all the plugins you rely on. Many of the libraries/tools in it that I use I’ve never found suitable replacements for anywhere else, and certainly not in such an integrated, coherent way. Also because its a lisp it tend to has the best tooling for developing any lisp language with. Certainly Common Lisp but also Clojure and Racket have great layers in Emacs, but you kind of have to experience it to understand. I use its lisp-state features like slurp/barf (nesting/un-nesting parenthesis) all the time even in Elixir. Programming a lisp without those features would be really frustrating I think.
LFE is sort of based on Common Lisp so it does have a CL feel. However, it is tuned to Erlang/OTP/BEAM in what features it has and how interacts with other BEAM languages. In this respect it is definitely an Erlang Ecosystem language.
Thank you for all the recommendations! Would you be so kind to try to explain what’s the difference between Lisp, Common Lisp, Scheme, Racket and Emacs Lisp? Thanks to @rvirding I kind of understand how LFE and Clojure were tweaked to fit into BEAM and JVM respectively. Is it about some arcane features or something really fundamental? (When I try to Google those differences, people tend to use terms that are unfamiliar, not even mentioning the consequences of the design choices).
My personal opinion is that, when learning your first Lisp, there is no need to worry too much about different Lisp families. You will anyway get to learn a great deal from any of them. I would pick the one that offers the best learning resources, or stimulates your curiosity and motivates you the most. You will then be able to easily pick other dialects and understand the differences better once you are confident enough with one of them.
Broadly speaking, most topics that are specifically interesting in Lisp programming are basically similar in all variants. Most are related to the homoiconic nature of Lisp: code is written using the very same data structures provided by the language. This has powerful implications on metaprogramming, because generating code is equivalent to generating data structures.
As a bonus, when coming back to Elixir, you will find a lot of similarities In some aspects, Elixir feels like a Lisp in disguise (and I mean it 100% as a good thing).
Racket is fun to learn and play around with, but I’d recommend Clojure(script) as a more suitable for real-life tasks (I see clojurescript as a very good substitution to JS on a frontend). It’s much easier to learn something when you can apply knowledge to some real problems.
We’re not talking about learning C# after having done some Python here.
I’d flip it around and speculate that starting with Racket would increase the chances of success simply because you don’t have to fight the vagaries and idiosyncratic behaviour of the host environment and interfacing with non-idiomatic APIs at the same time while you are trying to get accustomed to the “strange syntax”.
Racket is probably a better place to get more comfortable with this strange new world. Learn the syntax, spend some time on exercism.io, play with some of the libraries like Graph Plotting or Web Server.
I personally had no problem with Clojure but I was already very familiar with the Java eco-system - taking on both at the same time is likely going to make things that much harder.
With Racket you can focus on changing your thinking about programming while not getting dragged down by those nagging, disruptive unrelated technical details.
Seeing Elixir doesn’t have lisp’s homoiconicity and extremely simple and consistent syntax I would it doesn’t feel like lisp at all. Having macros isn’t really enough. Whether you feel this is a good thing or not depends on your background. Being an old lisper, the reason why I did LFE, I thing one thing we did wrong with Erlang was not having a lisp syntax, though the Erlang syntax is simple and consistent.
Sure, Elixir is not a Lisp. What I mean is that, if you are familiar with Lisp, you can recognize many of the underlying concepts in Elixir too, in one form or another.
My personal view is that there are more similarities than differences, with the macro system being particularly close, even without homoiconicity. But mine is a totally subjective judgement, based on the languages I am familiar with, and the trajectory I followed learning them. Someone more experienced than me with several Lisp implementations might legitimately notice the differences more than the similarities.
Admittedly, I have not deep dived into LFE yet, but the possibility to get both a Lisp syntax and the Erlang VM sounds terrific. So let me take this opportunity to thank you for your programming language creations. Also it is interesting to read your perspective on the Erlang syntax. I would be curious to know what made you originally lean toward a non-Lisp syntax for Erlang.