Live data from Hacker News

Crafting Interpreters: A Review

chidiwilliams.com

91–100 of 155 posts

Re: Crafting Interpreters: A Review

#91
post #52

I hesitated a little bit before deciding to purchase and go through the book. Had already read many glowing reviews then, but was not sure if the choice of language (Java) for the first half of the book would be a hindrance (it's not the stack I am most familiar with). Decided to buy it anyway, primarily because the two implementations of the toy language piqued my interest (most other books only go through one imple…

> was not sure if the choice of language (Java)

Two books I enjoyed despite, rather than because of the language:

"Program Generators with XML and Java" (aka "program generators for fun and profit") https://www.amazon.com/Program-Generators-Java-Craig-Cleavel...

And:

"Designing Active Server Pages" https://www.amazon.com/Designing-Active-Server-Pages-Mitchel...

The latter mostly for techniques to keep programs structured even when writing mostly in template soup (like php, asp, coldfusion etc).

Re: Crafting Interpreters: A Review

#92
post #52

I hesitated a little bit before deciding to purchase and go through the book. Had already read many glowing reviews then, but was not sure if the choice of language (Java) for the first half of the book would be a hindrance (it's not the stack I am most familiar with). Decided to buy it anyway, primarily because the two implementations of the toy language piqued my interest (most other books only go through one imple…

> was not sure if the choice of language (Java) for the first half of the book would be a hindrance

I think it is refreshing he uses a "boring" language.

Re: Crafting Interpreters: A Review

#93

Without a doubt one of the best technical books I have ever read. To me, it was a missing piece of the big puzzle of "how do computers work". I read many a book to answer this question, and came away with three books: - CODE by Charles Petzold explains the CPU - Operating Systems: Three Easy Pieces by Arpaci-Dusseau explain OSes - Crafting Interpreters by Robert Nystrom explains programming languages Masterfully done…

These look great, and judging by other people's comments, are instances of a class of book I will poorly describe as "lovingly-crafted works of art on highly technical CS topics", a genre that I am always on the lookout for more examples of.

From my own experience, some examples might be:

- SICP, by Abelson and Sussman

- Paradigms of Artificial Intelligence Programming, by Norvig

By general acclaim, some examples might be:

- How to Design Programs, by Felleisen et al

- Beautiful Racket, by Butterick

- LISP In Small Pieces, by Queinnec

- The Art of Computer Programming, by Knuth

- The Elements of Computing Systems, by Nisan and Schocken

What else comes to mind? (My list is very LISPy, but that's just bc I have high awareness there.)

Re: Crafting Interpreters: A Review

#94
post #67

Without a doubt one of the best technical books I have ever read. To me, it was a missing piece of the big puzzle of "how do computers work". I read many a book to answer this question, and came away with three books: - CODE by Charles Petzold explains the CPU - Operating Systems: Three Easy Pieces by Arpaci-Dusseau explain OSes - Crafting Interpreters by Robert Nystrom explains programming languages Masterfully done…

FYI there is a second edition of CODE coming out at the end of August. I will check out Three Easy Pieces! Thanks for the rec.

“Code” 2nd Edition

https://news.ycombinator.com/item?id=31696901

Re: Crafting Interpreters: A Review

#95
post #74
post #52

I hesitated a little bit before deciding to purchase and go through the book. Had already read many glowing reviews then, but was not sure if the choice of language (Java) for the first half of the book would be a hindrance (it's not the stack I am most familiar with). Decided to buy it anyway, primarily because the two implementations of the toy language piqued my interest (most other books only go through one imple…

Does the book go into more „modern“ parser architectures ala Roslyn Red Green Trees?

Crafting is less about modern or production-grade anything and more about understanding fundamentals. It would be equally at home in a 1980s compilers and language design course or in a 2000s version of that course. It has a single motivating principle, which is that a learner who understands the bare basics of algorithms and data structures knows, in the truest sense of the word, what a compiler and an interpreter does. It achieves that principle beautifully.

Re: Crafting Interpreters: A Review

#96
post #52

I hesitated a little bit before deciding to purchase and go through the book. Had already read many glowing reviews then, but was not sure if the choice of language (Java) for the first half of the book would be a hindrance (it's not the stack I am most familiar with). Decided to buy it anyway, primarily because the two implementations of the toy language piqued my interest (most other books only go through one imple…

> was not sure if the choice of language (Java) for the first half of the book would be a hindrance I think it is refreshing he uses a "boring" language.

I didn't worry because of Java's perceived lack of 'excitement'.

Just that I am more familiar with other languages and I worried I'd get lost trying to understand Java and not digest the material properly. I tend to fall down rabbit holes sometimes ...

If anything, this has been another way for me to be more acquainted with Java, which I am happy for :).

Re: Crafting Interpreters: A Review

#97
post #22

And it's so much fun to go through. Most CS books are usually very dry, this one is such a fun read. I would encourage everyone to go and read at least the web version of the book, I'm sure that you will end up buying it at the end.

Nand2Tetris is another fun one IMO, you can do a chapter a week (an hour of reading and a couple of implementation sessions) and be done in a few months

this is awesome! I wasn't aware of it, now that I'm reaching my time for a midlife crisis, I'll give it a try as a way to feel young again and remember my college days. Thank you!

Re: Crafting Interpreters: A Review

#99

I'm in the middle of this book at the moment and I have mixed feelings on it. It's definitely well-written and you can feel the love and care that went into producing it. But I think it would have been stronger had Nystrom skipped the Java version and spent those pages on theory instead before jumping into the C implementation. While going through the Java stuff (implementing in C# instead because I have an emetic re…

I sympathize with your criticisms about java because the language is... not my favorite. It would be helpful here to look at its choice as a result of Nystrom solving the intersection of multiple optimization problems:

- Manual Memory Management Is Hard. Interpreters are complex pieces of software, you don't need another rabbit hole to dive into while you're learning your first parser. You don't need to agonize over where to put the contents of the file buffer you're parsing before writing your first lexing switch. People spend years with C and C++ and still get MMM wrong. The book is supposed to be fun.

- Data Structures Are Hard. This doesn't apply to C++ or really any modern language, but since you wanted it done in C the first time, that would entail the obligatory "Implement your own universe from scratch" exercise C is infamous for. I don't mind, I always like implementing my own universes (although I despise C even more than Java, it can't be over-emphasized how badly engineered that language is). But again, Pedagogy says that you should introduce the minimum possible surface area while approaching a new topic, ideally a single topic at a time.

- Interpreters Should Be Fast, so overly dynamic languages like python and javascript are out.

- A teaching language should be popular and familiar. The obvious benefit is accessibility to as many learners as possible, but a less obvious one is the availability of tools and cross platform support.

Out of the vast array of available programming languages and their toolchains, the combination of GC, powerful standard library and reasonable performance excludes a whole lot. The popularity requirement basically only leaves Java, C# and Golang standing.

Re: Crafting Interpreters: A Review

#100
post #52

I hesitated a little bit before deciding to purchase and go through the book. Had already read many glowing reviews then, but was not sure if the choice of language (Java) for the first half of the book would be a hindrance (it's not the stack I am most familiar with). Decided to buy it anyway, primarily because the two implementations of the toy language piqued my interest (most other books only go through one imple…

See to me Java was an advantage because it ensured I would do part 1 in Not Java (in my case c#). Mind you c# is great because it is similar enough you can follow along while also being different enough that you still are forced to engage and think. At some point I want to redo part 1 in F# to REALLY push myself (and also force me to better engage with F#).
Post reply on HN