Reviews

Crafting Interpreters by Robert Nystrom

forestbiiird's review

Go to review page

I loved the book, but I got distracted several times, and it was hard getting back to my unfinished interpreter. I will probably come back to it in a year or two, but I'll make sure to write the interpreter in another language so that I cannot copy the code - I found out that copying allows you to skip understanding :)

Phisical book is very well done and pleasant to look at, but to be honest, not very convenient, as it's quite bulky and you have to keep it open while writing code.

jpv0's review against another edition

Go to review page

5.0

Programming languages are something of a hobby of mine. Going as far back as undergrad, I’ve written a fair few interpreters and compilers over the years. I’ve never really gotten beyond a strong basic level, but I’ve always wanted to. Crafting Interpreters is a great book for exactly that.

The book essentially walks you through two styles of interpreter of the same language: just an AST walking style written in Java (the sort I’ve done a few times) and then a much more optimized one based on bytecode. There was something to learn on both sections though, since the the introduced language (lox) includes higher order functions and closures—certainly more interesting bits of languages to implement.

The latter really was the more interesting to me and really makes me want to go out and try building something more like that.

I think they biggest weakness of the book was in some ways also a strength: the author wrote all the code for the book before writing the prose—and then made sure that the book contained every line of the final interpreters. That does lead to some rather repetitive sections of adding very similar code to each new function, but so it goes.

Overall, well worth the read if you’re into programming languages, or really programming in general.
More...