🐚 The Little Schemer

Daniel P. Friedman & Matthias Felleisen
4th Edition, 1996 · MIT Press
★★★★★
🥜 Is it true that this is a book about peanut butter and jelly?
📚 Buy on Bookshop

🐚 The Scheme REPL

Type S-expressions and press Enter. The book teaches by doing — so do!

little-schemer v1.0 car · cdr · cons · quote · null? · atom? · eq? · + · - · * · cond · lambda · define
; Welcome to The Little Schemer REPL!
; Try: (car '(a b c)) or click an example below
; 🥜 What is (car '(peanut butter and jelly))?
λ>

📜 The Ten Commandments

Click each commandment to explore. These are the heuristics that make recursion tractable — like Pólya's problem-solving strategies, but for code.

🔄 Trace the Recursion

The book's signature move: follow a function call by call. Watch member? peel the list like an onion. 🧅

(define member?
  (lambda (a lat)
    (cond
      ((null? lat) #f)
      ((eq? (car lat) a) #t)
      (else (member? a (cdr lat))))))

🧬 The Y Combinator Derivation

Chapter 9's masterpiece: deriving recursion from nothing. Click each step to see the code evolve. 🍝 (Like building spaghetti from flour.)

🪞 The Metacircular Mirror

Chapter 10: Scheme interpreting Scheme. The strange loop that would make Hofstadter proud. Click a node to see how it works.

value
meaning
actions

↙ dispatches to ↘
*const
*quote
*identifier
*lambda
*cond
*application

↓ *application calls ↓
apply
meaning
∞ the loop!

🛑 The Halting Problem

Can we write a function that decides if any function halts? The book proves: no. Walk through the paradox.

📖 Review — ★★★★★

The Trajectory

From the simplest atom to self-interpreting code, in 200 pages:

atoms lists recursion ★ & lat higher-order fn collectors halting problem Y combinator metacircular evaluator

The Assessment

This is the most elegant programming book ever written. Through nothing but questions and answers — a Socratic dialogue about lists — Friedman and Felleisen smuggle in the deepest ideas in computer science. You arrive thinking about (car '(a b c)) and leave understanding why some problems are undecidable and how a language can interpret itself.

The food metaphors aren't decoration. They're pedagogical: by using peanut butter, jelly, and spaghetti as data, the book keeps abstraction grounded. You never forget that these are just things in lists.

The Ten Commandments are genius. Like Pólya's heuristics for math, they give you handles for thinking about recursion. After this book, you don't fear recursion — you see it.

Connections

Gödel, Escher, Bach — The metacircular evaluator in Chapter 10 is a Strange Loop. Code that reads code that reads code. The Intermission even recommends GEB. We've been here.
How to Solve It (Pólya) — The Ten Commandments are heuristics for recursion, just as Pólya's method is heuristics for proofs. Also recommended in the Intermission. We've been here too.
Mindstorms (Papert) — This book is a microworld. The REPL is the Turtle. Kids (and adults) learn by building, testing, failing, adjusting. Papert would weep with joy.
Vehicles (Braitenberg) — Complex behavior from simple rules. car, cdr, cons, null?, eq? — five primitives, and you get a self-interpreting language.
The Art of Unix Programming — Composition. Small functions combined into larger ones. The Unix philosophy, expressed in S-expressions.

The Verdict

Five stars. No hesitation. This book respects your intelligence by never telling you the answer — it asks you questions until you discover it yourself. That's not just good pedagogy. That's love.

🥜 Now go make yourself a peanut butter and jelly sandwich. You've earned it.