Crafting “Crafting Interpreters” (2020)
Here is my journey with this book so far:I decided to follow the book but write in Clojure (at least the interpreter) instead of Java.This went well, but then I decided I also wanted to write the lexer as a state machine in a data DSL (nested maps).This went kind of well, but it seemed incredibly verbose, because a ton of states would have the same input messages, so I decided to write a macro that maps regular expressions to tokens one to one and produces a (data DSL) state machine that later drives the lexer.Then I realized that I get a non-deterministic state machine that I needed to convert to a deterministic one.Then I decided that the string representation of regular expressions suck, and that I want to write a DSL for those too...Then left at the above, switched to a few other books in between and am trying to decide whether I should ditch the lexer entirely and just use s-expressions. I probably won't, because it's fun so far, but boy did I get sidetracked...