3 ms·
I don't think you really need to "learn a lisp" but I recommend that curious developers read SICP at some point. John McCarthy famously wrote a lisp interprete
by bhntr3 6y ago
I don't think you really need to "learn a lisp" but I recommend that curious developers read SICP at some point.
John McCarthy famously wrote a lisp interpreter in a half page of lisp in the lisp 1.5 manual. The simplicity of the interpreter makes it possible for SICP to really focus in on the essence of what programming languages are and how features can be incrementally added. Imagine trying to learn programming by building a java compiler. Lisp is a much simpler language for learning how languages work.
The lisp interpreter is so simple because the code of lisp is written in the data structures of the languages: a bunch of nested lists. So the parsed syntax tree is very similar to the code. This means that meta-programming on it is much easier to reason about. You can write macros in other languages to change the functioning of the language itself but it's much more complicated for complex syntax. This makes lisps languages for creating your own language. Some people probably love lisp because they're inspired by it but people who consider its power indispensable (pg) probably customize it a lot with macros.
Someday you may find yourself implementing a lisp unintentionally (https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule)
. IMO this is because it's natural to start with some text based data structure format (JSON?) for some config file or something and then add features incrementally. Suddenly you're making a lisp. Understanding lisp can help you realize you're building a bad one. This has happened to me before.
Lisp is also very interesting if you want to write code that writes itself. For instance, if you were toying with genetic algorithms the fact that every piece of lisp code within matched parens is itself a valid lisp program is a nice feature to have.
In the end though, I don't think actually using lisp is as important as understanding lisp. I can see the insane power of meta-programming for creating higher abstractions for myself or a small team of like minded individuals. But whether it's lisp macros, scala implicits, annotation based byte code rewriting in java or method_missing in ruby, I think that meta-programming becomes a form of obfuscation for really large teams. If you take away meta-programming from lisp you still have some really cool languages. But I think many of those cool things about lisp can be achieved in more mainstream languages if you understand what you're trying to achieve.
After all, Brendan Eich was inspired by scheme when he created Javascript in ten days. But he was told to make the syntax "like Java". That's a bit ironic given that Guy Steele (one of the creators of Scheme) helped write the original Java specification. Neither language is very scheme-like in the end. But both authors contend that the languages would have been a lot worse if they hadn't been around to put a bit of lispiness into them.
So the last reason to learn lisp is that if you ever get asked to make a programming language for a large company with lots of stupid restrictions in a very short time frame you might be able to inject enough lisp into it that people will still use it under duress 25-30 years later.
- jecel 6y ago> That's a bit ironic given that Guy Steele (one of the creators of Scheme) helped write the original Java specification. Note that "write the specification" in this context meant creating a text to describe a design that had been done by other people before he joined. Guy made it quite clear at OOPSLA 2003 (which had become essentially a Java conference) that the language would have been different if he had been able to have any input.