Live data from Hacker News

Crafting “Crafting Interpreters”

journal.stuffwithstuff.com

71–76 of 76 posts

Re: Crafting “Crafting Interpreters”

#71
post #65

I have to ask about http://craftinginterpreters.com/introduction.html#snippets > In the center, you have the new code being added in this snippet. It may have a few faded out lines above or below to show you where to insert it in the existing code. There is also a little blurb telling you which file and where in the file it goes. If it says “replace _ lines”, there was some previous code between the faded lines that…

The build system figures out all of this location information automatically based on the snippet markers in the code. The code is pretty hairy since it's a pile of Python that sort of accreted organically as I was writing the book. I have been sorely tempted to rewrite the whole thing but abstained because I wanted to focus on writing. The basic idea is that the build system walks every line of code. As it steps thro…

Wow. Overall, I wonder if it wouldn't've been easier to write the code samples as diffs, and then compile them appropriately to a regular code sample + summary?

Re: Crafting “Crafting Interpreters”

#72
post #11

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 recon…

Wow, self-hosted Lox; that's fantastic! Nicely done.

Re: Crafting “Crafting Interpreters”

#74
What a fantastic blog post - both technically as well as deeply human and touching. Really looking forward to seeing the physical book coming to life.

This part makes it clear the passion and attention to details that the author pours into his books:

"I hand letter everything. It takes a long time. 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.

Well, this is my damned book and no reader will ever feel that disappointment. Every single fucking letter in every one of the illustrations was hand lettered and is unique."

Re: Crafting “Crafting Interpreters”

#76

I've read the entire post and I still don't know how he did it. And his books are incredibly well written. The day after I announced publicly I'm writing a book, my wife announced she was pregnant. I still continued writing but the motivation of the first day was halfed. Two weeks later, she told me it was twins, I quickly decided to get a stable job. I still wrote in the evening and weekends. The kids came earlier t…

If you're doing a plug you might just as well tell us what you're writing about ;)

no :p
Post reply on HN