Taking a page out of LiSP
Teaching Lisp by implementing Lisp is a long-standing tradition. If you set out to learn to program with Lisp, you will find read book after book, lecture after lecture, and blog post after blog post, all explaining how to implement Lisp in Lisp. Christian Queinnec’s Lisp in Small Pieces is particularly notable, not just implementing a Lisp in Lisp, but covering a wide range of different semantics within Lisp.
Lisp in Small Pieces’s approach is to introduce a feature of Lisp, then develop an implementation. The book covers Lisp-1 vs. Lisp-22, then discusses how to implement namespaces, building a simple Lisp-1 and a simple Lisp-2. Another chapter discusses scoping, and again you build interpreters for dynamic and block scoped Lisps.
Implementing a language feature teaches you a tremendous amount about how the feature works in a relatively short amount of time. And that goes double for implementing variations on the same feature–like dynamic vs block scoping or single vs multiple namespaces.
Unlike other books and tutorials, we won’t focus on how to write object-oriented programs. We won’t worry about patterns like “Facade,” or walk through an “extract method” refactoring. We’ll trust that there are more than enough existing resources covering these topics, and focus instead on the areas generally given short shrift by existing texts.
“I think it’s one of the best tech books I’ve read since Sedgewick’s Algorithms in C.”–Andrey Sidorov