Live data from Hacker News

Crafting Interpreters: A Review

chidiwilliams.com

81–90 of 155 posts

Re: Crafting Interpreters: A Review

#81
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…

Using Java was a poor choice (especially without the latest improvements such as records and switch expressions): * new books should use more modern popular languages to age well and to attract younger audience * on the JVM there are languages better suited for the topic (e.g. Scala by a large margin) * There's already the "Language Implementation Patterns" book ( https://www.amazon.com/Language-Implementation-Patter…

  > Language Implementation Patterns
I hear the code examples are in Java. I think that's unfortunate. (And a bit ironic about your post).

Re: Crafting Interpreters: A Review

#82
post #81

Earlier quoted context omitted.

Using Java was a poor choice (especially without the latest improvements such as records and switch expressions): * new books should use more modern popular languages to age well and to attract younger audience * on the JVM there are languages better suited for the topic (e.g. Scala by a large margin) * There's already the "Language Implementation Patterns" book ( https://www.amazon.com/Language-Implementation-Patter…

> Language Implementation Patterns I hear the code examples are in Java. I think that's unfortunate. (And a bit ironic about your post).

If you actually take the time to read the book Bob explains the choice.

And fwiw modern Java is decently expressive without adding the unneeded complexity of Scala or something similar.

edit: replied to the wrong post. /shrug

Re: Crafting Interpreters: A Review

#83
post #27

Earlier quoted context omitted.

As the footer on the online version of the book says "Handcrafted by Robert Nystorm" - it really is lovingly hand crafted . It shows that the author went over the content many, many times polishing it with every go. The content builds up really well as it goes along. On a minor note, whenever I read a technical book I always come across some mistake in the copy-editing, a missed article, a misplaced article, a typo.…

> Though I do feel the author ran out of steam with respect to the lovely, quirky artwork in the book. Definitely true. I was hoping to write the book in two years and it took me six. By the end (which was also during the pandemic) I was pretty fried and it was hard to summon much energy for whismy. I tried to pack as many illustrations in as I could, but by later chapters I was really just trying to get it done. Als…

Bob, your continued love of synths gives me hope we will see you take a real leap of faith and give us a ‘Crafting Real-time Audio via custom digital Synthesizers’. I would genuinely love a beginner friendly guide to audio programming in the style you developed for Crafting Interpreters. Help me get my friends into digital instrument programming Bob, it’s not like it would take that long!

Re: Crafting Interpreters: A Review

#84

Earlier quoted context omitted.

> Though I do feel the author ran out of steam with respect to the lovely, quirky artwork in the book. Definitely true. I was hoping to write the book in two years and it took me six. By the end (which was also during the pandemic) I was pretty fried and it was hard to summon much energy for whismy. I tried to pack as many illustrations in as I could, but by later chapters I was really just trying to get it done. Als…

Bob, your continued love of synths gives me hope we will see you take a real leap of faith and give us a ‘Crafting Real-time Audio via custom digital Synthesizers’. I would genuinely love a beginner friendly guide to audio programming in the style you developed for Crafting Interpreters. Help me get my friends into digital instrument programming Bob, it’s not like it would take that long!

I would love to write about audio programming. I've done some and am slowly learning more, but it's a real uphill battle. I get a lot of it, but the math behind filters is really hard for me.

Re: Crafting Interpreters: A Review

#85
post #71

Earlier quoted context omitted.

> Though I do feel the author ran out of steam with respect to the lovely, quirky artwork in the book. Definitely true. I was hoping to write the book in two years and it took me six. By the end (which was also during the pandemic) I was pretty fried and it was hard to summon much energy for whismy. I tried to pack as many illustrations in as I could, but by later chapters I was really just trying to get it done. Als…

> I've already spent the money on whiskey and synthesizers You know, after reading Game Programming Patterns years ago I knew I'd get CI eventually, and have only delayed because I know I don't have the time to give it what it deserves just yet (two kids under three, fulltime Senior Eng, yada yada you know the drill), but this line hits so close to home that it's getting purchased right now. Everything I've taken the…

I'm basically a walking nerd stereotype.

The M8 looks so cool, but I just got a Syntakt so I definitely can't justify another groovebox.

Re: Crafting Interpreters: A Review

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

The parser’s data structure is a more traditional Abstract Syntax Node design. Roslyn’s tree design is, IMO, a good internal structure for use in a production-grade compiler meant to be coupled with a developer environment (IDE and other tools) because the complexity pays off in terms of developer experience. However, Bob set out (as far as I can tell from the book and his talks/comments on the subject) to provide a fairly beginner friendly, introduction to the topic of language implementation. Within his chosen scope the parser implementation in Crafting Interpreters is more than sufficient and clearly presents the concepts intended.

Re: Crafting Interpreters: A Review

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

IIRC, Roslyn's red-green tree approach is at least partly due to needing to support interactive editing without re-parsing everything. If that's what you're referring to, no, the book doesn't cover that; both interpreters run either in batch mode on a single file or in a simple REPL.

Re: Crafting Interpreters: A Review

#89
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…

Using Java was a poor choice (especially without the latest improvements such as records and switch expressions): * new books should use more modern popular languages to age well and to attract younger audience * on the JVM there are languages better suited for the topic (e.g. Scala by a large margin) * There's already the "Language Implementation Patterns" book ( https://www.amazon.com/Language-Implementation-Patter…

> new books should use more modern popular languages to age well and to attract younger audience

That doesn't make sense. Java is one of the most popular programming language, more popular than a lot of other "modern popular languages". The only languages more popular are either as old as Java (JavaScript, Python) or older (C, C++). C# might be one option, but it's close to Java, and I don't know if the support for Linux/MacOS was here at the time this book was started. Same thing for JavaScript and Python's popularity, which are relatively recent trends. On the other hand, Java has stayed and endured. It's still here and will still probably be here in 20 years.

> on the JVM there are languages better suited for the topic (e.g. Scala by a large margin)

Scala is less popular than Java, and harder to master. Once you consider Scala, you get into endless arguments about whether to use Scala, SML, OCaml, Haskell, etc.

> There's already the "Language Implementation Patterns" book

There is also "Writing an interpreter in Go" and "Writing a compiler in Go" that seem to cover the same ground. But I'm certain than more people know about interpreters and compilers thanks to these three books than thanks to any one of them.

> but also gives you real life skills (e.g. ANTLR is used in most big data query engines)

The majority of programming languages don't use a generated parser but a handmade recursive descent parser, because it's the best at error reporting. There's a good post about different parsing approaches by Laurence Tratt: https://tratt.net/laurie/essays/entries/which_parsing_approa.... Generated parsers are great for DSLs but that won't teach you how the programming languages that you use work.

Re: Crafting Interpreters: A Review

#90
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…

I fully agree. Superb, "meticulously and beautifully done". I read it online and followed along writing code then bought the book just to support the author. Thanks Bob.
Post reply on HN