[HN Gopher] Ask HN: Writing an Interpreter in Go or Crafting Int...
___________________________________________________________________
Ask HN: Writing an Interpreter in Go or Crafting Interpreters?
I'm thinking of learning about compilers and am pleased to find
that there seems to be at least two very accessible choices,
"Writing An Interpreter In Go" and Crafting Interpreters. Curious
if folks here have experience with either and could provide
recommendations? https://interpreterbook.com/
https://craftinginterpreters.com/
Author : lordleft
Score : 12 points
Date : 2025-04-18 11:39 UTC (3 days ago)
| stefanos82 wrote:
| Read both if you like.
|
| I read and liked them both, but my heart belongs to Bob's
| writing, especially the C implementation in Crafting Interpreters
| and how he explains things.
| markus_zhang wrote:
| I only read Crafting Interpreters and I can recommend this one.
| It's also free as a website so you can evaluate it before making
| a purchase. I did think it is interesting enough to go straight
| to make the purchase.
| greybox wrote:
| I recommend skimming over the first few chapters of crafting
| interpreters, the main value there is the recursive descent
| algorithm and abstract syntax trees, the rest is implementation.
| I've been developing my own language [1] and that's how I got
| started
|
| The ideas in crafting interpreters are not language specific, the
| examples are in java, but I used C++ for instance. Im sure you
| could transfer the same ideas to Go. Then again I've never read
| the go book you are referring to
|
| [1] https://youtu.be/azR1mUfFjHI?si=PsP-7o-w1yIN4xyq
| SwiftyBug wrote:
| I'm doing Crafting Interpreters... in Go! The book uses Java, but
| I prefer Go so I just went with it. It was an interesting
| exercise to "translate" the understanding of the implementation
| shown in the book (which relies heavily in OOP) to something more
| idiomatic in Go.
___________________________________________________________________
(page generated 2025-04-21 23:01 UTC)