Log in

No account? Create an account
entries friends calendar profile Elf Sternberg's Pendorwright Projects Previous Previous Next Next
Lisp In Small Pieces vs Essentials of Programming Languages: Which should you own? - Elf M. Sternberg
Lisp In Small Pieces vs Essentials of Programming Languages: Which should you own?

TL;DR: Lisp In Small Pieces will get you up to speed much faster than Essentials of Programming Languages, but you’ll benefit from owning both.

As I’ve blogged before (and have much to discuss), I’ve been working my way through Christian Queinnec’s Lisp In Small Pieces, doing the exercise mostly in Javascript Coffeescript just to prove that it can be done in something other than Scheme, and to demonstrate that, for the most part, Javascript is a decent Scheme underneath its hideous Java-“inspired” syntax. I’m just now finishing up the text of chapter four. I must say that I never read a textbook this closely when I was a (presumably, therefor, terrible) university student. I’ve read and re-read each chapter to make sure I got what was being said before moving on.

Out of curiosity last night I also picked up my copy of Daniel Friedman’s Essentials of Programming Languages, which has been languishing on my shelf for about a year after I scored it at a used bookstore for cheap. It’s the second edition. I read through chapter two.

LiSP gets you into the nuts and bolts of interpretation and scope exceptionally quickly, whereas Essentials really wants you to understand the math and theory first. The result is that Essentials teaches you two different languages: the first is the language you’re going to create, and the second is the mathematical language you’re going to use to describe what you’ve created. LiSP doesn’t care much about the latter.

Quinnec will give you the vocabulary, but you won’t need it so much as you will need the code and your understanding of it. Eventually, you’ll come to appreciate the way you keep and maintain an environment, how you manage the stack and how you reference count within it, how side-effects are incorporated into the language and why they matter.

Oddly, by the time you’re 120 pages into both (about 1/4 of the way in), you’ve mostly got everything you need, but Quinnec makes you feel as if you’re ready to write useful DSLs and interpreters. Friedman is still hiding his map in his coat pocket and it’s not clear where you’re going from the text.

As I’ve pointed out, I’m hacking Quinnec’s code in Coffeescript, and Quinnec’s writing and examples make that feel like a viable option. Friedman seems excessively married to Scheme; not only are his examples in Scheme, but he emphasizes how perfect Scheme is to the research project his book represents and feels dismissive of any other approach.

Essentials is still a good book to have. Read Chapter 6 after reading LiSP Chapter 3: it’s all about continuation passing, and by chapter 3 of LiSP you’ve already written three CPS-based interpreters. Chapter 7 of Essentials covers type systems, which LiSP never really delves into with any depth. You might want to read Essentials Chapter 7 after you’ve finished LiSP sufficient to have a working Lisp, one that you can verify and validate by working you’re way through Friedman’s other excellent series, The Little Schemer, The Seasoned Schemer, and The Reasoned Schemer. Whether or not you want to go all-out and get the last book, The Little Prover, is a matter of taste.

Leave a comment