
- Writing an Interpreter in Go [1]
- Writing a Compiler in Go [2]
Absolutely best books I've ever read on the subject. And if you like to follow a step-by-step (each commit is a part of the boks) feel free to clone my own monkey-lang that followed the books pretty closely: https://git.mills.io/prologic/monkey
Another really good book is "Crafting Interpreters".
A lot of the complexity and front-work of these kinda things is the parsing step though, so you can follow MAL (or any other make a lisp tutorial) though that won't necessarily help with other languages it frees you to jump to the interesting parts.
FORTH, mentioned in another comment, has that same appeal. I wrote a quick tutorial here, back in the day:
https://www.craftinginterpreters.com/
R. G. Loeliger Threaded Interpretive Languages Their Design And Implementation https://news.ycombinator.com/item?id=43973544
https://github.com/IUCompilerCourse/Essentials-of-Compilatio...
And check out Andy Keep's Nanopass Compiler work, https://nanopass.org/
BTW, I'm not the author of either of those books, but I have read both of them.
1) Getting better at my tools or learning new ones 2) Make up for the theory I didn't learn in uni.
Usually, those two things are somewhat distinct. I'm either there using a textbook, grokking theory, or I'm getting the reps in at a new programming language or K8s or whatever.
I was wondering if there is a way to do both at the same time.
Of course there are trade offs, but I found porting software, interspersed with theory to be a great way to achieve that.
Naturally, you cover less theory than when you only do reading, and with the hand-holding you may learn less than when you use a tool you're good at to learn by trial and error.
But for me, following "Writing an Interpreter in Go" in Rust was a great way to learn more about Rust and about programming languages and Interpreters at the same time.
Did you try this or something else that helped you to maximise skill gain per unit time?
(I know this sounds like an engagement throwaway question at the end, but I'm genuinely curious!)