Live data from Hacker News

Crafting Interpreters: A Review

chidiwilliams.com

1–10 of 155 posts

Re: Crafting Interpreters: A Review

#5
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?

Yes, I read and typed out all the code snippets by hand and it worked really well.

Re: Crafting Interpreters: A Review

#6

The author says it took about 6 months to thoroughly go through the book and examples. This is really useful in setting expectations.

I got through all chapters in around 1.5 months, spending 50-60 hours[1]. I'd do solid 4-5 hour blocks on Saturdays and Sundays when I was most into it.

I'm following teachyourselfcs.com[2], so I'm hoping to solidify the concepts the book intro'd by reimplementing the bytecode interpeter in Rust (rlox) and following Alex Aiken's lectures online. OP appears to have reimplemented Lox in Golang (glox) for reinforcement.

So far the time has been well spent. Compilers are now much more 'just another program', and I have new conceptual tools for tackling software engineering problems.

1. https://github.com/thundergolfer/uni/tree/main/books/craftin...

2. https://teachyourselfcs.com/#languages

Re: Crafting Interpreters: A Review

#7
post #5
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?

Yes, I read and typed out all the code snippets by hand and it worked really well.

And don't be too careful in your typing either. The times when I mistyped and had to crack out `gdb` were where my learning was actively tested.

Re: Crafting Interpreters: A Review

#8
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?

He does a great job of breaking down the code samples into chunks that are small enough to be meaningful. The longest chunk I remember seeing was around 10 lines. Each of those small blocks of code is surrounded by lots of very helpful and approachable explanatory text. The results was, at least for me, that I never felt like I was copying something I didn't understand.

Re: Crafting Interpreters: A Review

#9

The author says it took about 6 months to thoroughly go through the book and examples. This is really useful in setting expectations.

I got through all chapters in around 1.5 months, spending 50-60 hours[1]. I'd do solid 4-5 hour blocks on Saturdays and Sundays when I was most into it. I'm following teachyourselfcs.com[2], so I'm hoping to solidify the concepts the book intro'd by reimplementing the bytecode interpeter in Rust (rlox) and following Alex Aiken's lectures online. OP appears to have reimplemented Lox in Golang (glox) for reinforcement.…

Yes, you can go through the book in much less time than six months if you're more consistent with it than I was. I took a few breaks (for days and sometimes weeks) to study and write other things.

Re: Crafting Interpreters: A Review

#10
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?

Well yes, the code is pretty much there 1:1. However the juice is in the straight forward explanations and excellent writing.

I used the book by translating the code into my favorite programming languages and heavily played around with different approaches, which is way more time consuming but I don't think it is necessary at all.

I think if you are already a seasoned programmer you might find it even useful to just read the book and the code without doing much of coding at all. Given that you are good at understanding code without executing it.

Post reply on HN