Live data from Hacker News

Crafting Interpreters: A Review

chidiwilliams.com

11–20 of 155 posts

Re: Crafting Interpreters: A Review

#11
highly, highly recommend this book

when i was given a compilers class to teach i wanted to teach hand-written recursive descent because it is simple, elegant and makes the recursive nature of grammars so readily apparent without hiding concepts behind obscure tools

i was despairing that there were no good books around on recursive descent, but stumbled on crafting interpreters before it was even released as a book and immediately structured my class around it

absolute life saver and my students all love it

cannot say enough good things about it!

Re: Crafting Interpreters: A Review

#12
post #3

I've been wanting to read this book, but I'm not sure how I should go about it. Are you supposed to read and type out the code examples? I'm just wondering if I will learn anything that way?

I read it through but didn't type out the code, mainly as I know that I would get focused on the code rather than the concepts the book is teaching.

Re: Crafting Interpreters: A Review

#13
Truly one of the best books in our field; very well done.

Doing the tree-walk interpreter (the first “half” of the book) took two weekends, working much of the day on Saturdays and Sundays.

When I went through it, I built my interpreter in another language, and added other features as I went along. Both helped solidify the concepts. I often had to pull out my additional features as I learned better in subsequent chapters; getting to see the difference between my amateur approach versus the author’s experienced methods was quite helpful!

Re: Crafting Interpreters: A Review

#15
post #3

I've been wanting to read this book, but I'm not sure how I should go about it. Are you supposed to read and type out the code examples? I'm just wondering if I will learn anything that way?

I read the chapters and looked at the samples. If there was a place where several followed a similar pattern then I’d only follow the first one from the book and then figure the others out myself (eg different types of statement or expression). There are also some exercises that don’t provide immediate answers which encourage you to think ahead.

Re: Crafting Interpreters: A Review

#16
post #3

I've been wanting to read this book, but I'm not sure how I should go about it. Are you supposed to read and type out the code examples? I'm just wondering if I will learn anything that way?

The way that worked better for me was doing the book in a different language (I did it in Crystal and Rust). I had to fully understand the intent being every code example so I could translate it correctly.

This adds another layer of difficulty, depending on how comfortable you are with Java and the language of your choice, but it was the way that worked better for me. I truly felt that I created a language, not just copied some code.

Re: Crafting Interpreters: A Review

#18
Following a slightly different path, "Modern compiler implementation" goes over several topics mentioned in the review (lexing, parsing, type checking, code optimization and generation, runtime environments aspects e.g. garbage collection).

There exists various flavors of the book (in ML, Java, and C).

Re: Crafting Interpreters: A Review

#20
post #18

Following a slightly different path, "Modern compiler implementation" goes over several topics mentioned in the review (lexing, parsing, type checking, code optimization and generation, runtime environments aspects e.g. garbage collection). There exists various flavors of the book (in ML, Java, and C).

There's also Thorsten Ball's Writing an Interpreter in Go[1] and Writing a Compiler in Go[2].

[1] https://interpreterbook.com/

[2] https://compilerbook.com/

Post reply on HN