context
A full Lox implementation in Go
Recursive descent parser and tree-walk interpreter, with mutable variables and scoped blocks.
error handling
One shape instead of two
The book threads exceptions through parsing and evaluation. In Go I used errors as values throughout, which collapses static and runtime error handling into the same shape — a parse error and a runtime error are both just a value you propagate.
It is more typing at every call site and considerably less thinking at the boundaries, which turned out to be the trade I wanted.
also
The same book, in OCaml
I worked through it a second time in OCaml. Different experience entirely — pattern matching over an AST is the thing the language was built for, and the interpreter loop nearly writes itself.