75 comments

[ 1.7 ms ] story [ 138 ms ] thread
Huge thanks to Mr. Nystrom for writing this. It's been very useful and I've learned a ton reading/working through it.
> I used to do graphic design, and I have this weird tic where any time I see something that looks handwritten, I look for multiple instances of the same letter to see if they are different or if the design just used a handwriting font. It’s almost always a handwriting font and I die a little inside to see the illusion evaporate.

Not a graphic designer, but I do the exact same thing and feel the exact same way... Happy to see I'm not crazy alone

And his look like really neat hand-drawn diagrams! I certainly appreciate the degree of craftsmanship and care displayed throughout both books

As a someone put it on YouTube, the time-lapse video of the entire process is like ASMR for geeks https://www.youtube.com/watch?v=iN1MsCXkPSA

I once published a magazine on typography and someone asked me how I got the cool sketched-with-pencil look for the headline on one article. I sketched it with a pencil. (It was especially ironic in that the article was about an aggressively digital type foundry).
It's a fascinating video but what struck me the _most_ was the manual kerning of the handwriting after it was scanned. I know I'd have just copy/pasted all those identical echo() cells. Amazing to watch.
Yeah... it's one of those things where once I noticed the kerning was off I basically had to fix it. In many of the illustrations, I did a better job of writing with good spacing and then I didn't need to do as much fixup in Photoshop. But with the illustration I recorded for the video, I was so worried about making a mistake that I spread the letters out way too much.
I do this all the time. I'm satisfied that xkcd still appears to be hand-lettered.
I love both books by Mr. Nystrom!

Thank you so much. They are very interesting and well presented. I hope munificent is able to pick yet another interesting topic after this one has concluded!

Just wanted to say congratulations on finishing the last chapter of the book. It’s a huge step and hope to see it printed later down the road. Stay safe.
Can't wait for this on Kindle.
Also, wow, I love the work you put into the illustrations.
Thank you so much for this book! I used the early chapters to inform some decisions of mine when building my own programming language.

Congratulations on completing your work.

Awesome, thanks muchly, Bob! Reading and learning from "Crafting Interpreters" inspired four of my own fun projects (the first three on github.com/benhoyt): littlelang, my first little language interpreter, in Go; loxlox, a Lox interpreter written in Bob's Lox language; goawk, a full AWK interpreter written in Go; and my current unreleased project, a Turbo Pascal to Go converter with the goal of transpiling the reconstructed ZZT source to Go.
I don't like to play favorites since there are a number of Lox implementations... but loxlox is definitely my favorite. :)
Wow, self-hosted Lox; that's fantastic! Nicely done.
I love this book and I've been suggesting it to my friends :)
Wow. I was already impressed with the book, but after reading about what was happening behind the scenes, I'm truly in awe. I especially appreciate the work you put into making sure that the code snippets are accurate to the actual source code. Far too many books omit crucial steps or contain faulty code.

I also found it really heartening how you kept working through the tough times. We're all going through some challenging times right now and I have found that working on my projects (including a compiler!) has given me a small bit of satisfaction.

This is amazing! I remember when you started this, and have been somewhat following along since then. This is a masterpiece.

Is there any way to pay you for this book? :-)

Not yet, no. But thank you, very much.

Once the print and eBook editions are ready, buying one of those will be the best way to say thanks. But, honestly, right now my family and I are in so much better shape than a lot of people. I'm able to work from home in a well-paid field. We're all safe and healthy.

So if you feel like doing something kind for someone, instead of throwing some cash my way, consider donating to a food bank or other local charity that can help people financially impacted by COVID-19.

Thank you so much Bob, both for the awesome book and for thinking of others in this trying time. May God bless you and your family!
that's a fantastic read! thanks for sharing the process with us. really surprised that the code was complete the very first year and the real work was to put all that in writing, snippets, and illustrations.
No pressure, but I can’t wait to purchase the print version of this book!
> Writing this all out makes me sound like a crazy person. What the hell am I doing with my life? Or, more importantly, what could I have been doing instead of doing all that?

That's why your book is so good! Singular focus on one subject like this either causes insanity or genius.

Examples: redis, Linux, sqlite, dwarf fortress, etc. I (believe, not sure) all were started by a single person who was insane by any measure to start those projects, but they became something that people love.

If this is insanity, please keep going insane!

CMIIW, but I believe most of those projects were started with a relatively small (and reasonable) scope.
Okay, well, there are plenty of others to choose from! I'm just trying to say that the result of this insanity was great.
Scope creep is one important way progress happens :).
but this book started with a relatively small scope too
I feel like this might be a required but insufficient condition for what Bob has achieved here. With both of his books, he has taken a somewhat dry topic (object oriented patterns, and now compilers / interpreters), and turned them into books anyone can understand. More importantly, he has somehow made them interesting, in a way that I have rarely seen before.

I suspect you're right, the focus probably helps with the process of distilling the core concepts (which are necessary to convey meaning), as well as the writing style. Picking the right analogies, the right illustrations, then executing them to perfection. I guess the passion for the topic shines through in his writing. Massive congrats to Bob!

Because the topics were interesting to him, and his goal was to convey what made them interesting. All great teachers have this in common regarding the subjects they teach.
Holy smokes. I thought I couldn’t love your output anymore than I already did, but this is something else. This little behind the scenes is... enlightening? inspiring? overwhelming?

Thank you for everything you’ve been through to provide this wonderful gift to our community.

This book has been a big help to me - thanks!

> I liked the hand-drawn look. It furthered my meta-goal of making the material more approachable, more human. But I wanted to up the quality. I wanted them to be more intricate and contain more information. I wanted the drawings to be more detailed. Less margin doodles and more, well, illustrations. Maybe even some lowercase letters.

This is one of the most unusual aspects of the book, and something that immediately drew me to it. I'm curious how Nystrom hit on that idea, whether he experimented with vector graphics alternatives, and if so, what did he take away from those experiments.

The method described in the video looks extremely laborious. That said, the quality of the result speaks for itself.

I poured a lot of effort into creating something similar for my book, but could never get it quite right. So, I backed away to diagrams in Inkscape using squares and curves. The result has been well received, but I've always slightly regretted not being able to create something as elegant as what Crafting Interpreters has been able to achieve.

At some stage in the future, I'll try again I'm sure!

I am definitely amazed and grateful like others by the work involved in writing this book. The attention to detail is visible from the first parts of the README. Clear explanations for everything.

I am also a sucker for clean written Makefiles. I have "Managing Projects with GNU Make" book that I keep in my to-read list (shamefully putting reading it off). Checking out the Makefile in the repository was a delight.

Loved this book, it's amazing work. It's already been helpful to me when implementing a toy language, even without working through the book (which I still intend to do).
The author's previous book Game Programming Patterns is 1000x better than the Gang of Four book.

Really looking forward to going through this.

Does it cover the same material?
Nah, theres some overlap but they're better used to complement each other than as competitors.
Very excited to check this out. Congratulations on finishing the race!
How does this work? Spending 4 years, full time from what it seems, on a book with a (let's face it) niche audience. While having (again, it seems from the post) a family with children, living in a first world country, flying regularly (I'm using this as a shortcut for 'getting out of the house for things more expensive than a hike in the woods'). So that's an opportunity cost of 200k for a book that would a runaway success if it made... 50k over its lifetime? Is there a backstory I'm missing here - is the author an already well-known internet celebrity living off Patreon or something like that (I couldn't find anything on the blog that indicates that)
I don't think it was full-time. Bob's day job is working on the Dart compiler, last I heard.
The author has a full-time job at Google and apparently wrote the book as a passion project, not for the money. The knowledge within is an incredible contribution to the public good.
> Spending 4 years, full time from what it seems, on a book with a (let's face it) niche audience.&

Four years, yes, but much less than full time. Usually around an hour a day, often less.

I work full time at Google and the book was a (very involved) hobby.

> that's an opportunity cost of 200k*

Yes, there's definitely a financial opportunity cost. But when I see someone working a job they hate eight hours a day, I often wonder what the satisfaction opportunity cost of that is. What could they be doing instead that would be more meaningful to them?

I'm unlikely to make enough money from the book to justify the time (though my first book made me much more than I expected), but I do think it will bring enough other rewards to be worth the time.

Oh I understood you worked on it full time, yeah I understand writing one as a hobby project. Thanks for replying.
This is amazing, thank you.
This book is great, the only thing missing is how to write fully featured type checker. Hard to find a resource on type checking that has the same practical style as this book.
Great writing. This should replace the syllabus for very many Comp Sci / Soft Eng "Intro to Compilers/Interpreters" courses as many do not come close to this level of detail.
I'm considering it for the course I teach! Although one thing that draws me is it doesn't have too much extraneous detail off the main narrative thread.

I currently use parts of the textbook Programming Language Pragmatics [1], one of the semi-standard texts used by a lot of universities (plus some of my own course notes). That book isn't really readable straight through though. It's 992 pages long, and some of the chapters get bogged down in a ton of coverage of the landscape of design and implementation choices. As a reference book that has some pros: you can look up something like looping constructs, and get a very detailed tour of how languages from Algol-68 through Modula-2 and C# have taken different design and implementation strategies. But that's not the same as reading something as your first introduction to a subject.

[1] https://www.cs.rochester.edu/~scott/pragmatics/

> I currently use parts of the textbook Programming Language Pragmatics

That was the first PL book I read. I really liked it, but you're right that it's like a survey of the entire landscape. For a first book, I personally like getting a single guided tour so that I feel like I'm going somewhere and not just looking at everything from a distance.

Wow this is a lengthy post is there anyone who could explain it to me?

In other words I need some

'Crafting "Crafting Interpreters"' Interpreters

Or a Crafting “Crafting ‘Crafting Interpreters’” post?
This comment is a request to the author author asking to respond to this comment and to speak on the subject of "Crafting 'Crafting Interpreters'"