I’m a big proponent of the #pragprog adage that you should learn a new programming language every year, but I have sadly lacking at putting it into practice, despite having an early advantage (BASIC, Fortran, Algol 60, APL, Pascal, Forth, COBOL, , IBM assembler, 6502 assembler, etc). Then in the early 90s I had started to move forwards again, with C and Objective C, and I came across the great lisp wars. Now it is 20 years on, and I’ve taken to (slowly) learn lisp.
Why? Well, not because of functional programming; I get the idea, but it’s oversold, and although lisp can be used for FP, that’s not its raison d’être. Instead, lisp has two big and compelling advantages, over and above its historical importance:
- lisp is the best way to learn how and when to use recursion;
- and lisp (at least in some forms) is a very pure and simple programming language, and as such, I would argue, is highly suitable for teaching beginners good habits.
First of all: there is Scheme, and there is Common Lisp; both have many variants. Scheme is the simpler of the two, and as such tends to be preferred for computer science instruction; Common Lisp has a more complex syntax (and many more functions), and has more practical instruction available. They are close enough that an experienced programmer could probably handle learning both in parallel. Maybe. There is a third version, which is really just a take on Common Lisp, which is the lisp inside emacs; if you use emacs, then try this as well.
Get Racket (aka DrScheme); this is a Scheme implementation with an IDE. On MacOS X, “brew install plt-racket” will suffice. Also install Common Lisp: “brew install clisp”.
There are two highly regarded source books for lisp, both aimed at Scheme: Structure and Interpretation of Computer Programs(SICP) (online), mobi online videos, and The Little Schemer; search for the pdf version, which is widely available online. Neither of these are really ideal for the lisp beginner. Three other books are recommended as ground up introductions to lisp, suitable for the complete novice:
- Simply Scheme; this is best found on the web (online), as it is (very) out of print and hard to find;
- The Scheme Programming Language online, also easy to find as a pdf.
- How to Design Programs (online)
I don’t have the same depth of resource for the Common Lisp side, but Land of Lisp works well for me, and people in general suggest both Practical Common Lisp, and various titles by Paul Graham.