HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
munificent
craftinginterpreters
HTML2017–2026
munificent / craftinginterpreters

craftinginterpreters

Repository for the book "Crafting Interpreters"

19Distinct people
42Mentions
1Explicit recommenders
11.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Repository for the book "Crafting Interpreters"

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I love the crafting interpreters book, https://github.com/munificent/craftinginterpreters

acedTrex used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 9:28:18 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year42 dated mentions

Observed mentions: 2017-01-16 00:40:59 UTC to 2026-07-23 14:52:48 UTC.

02462017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC707
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC606
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC404
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC606
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC505
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC514
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC404
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC110

What Hacker News says

6 sources
The fact that Thorsten manually synchronizes the snippets in the text and external source files seems like crazy talk to me. But the fact that he's cranked out two really good books on languages while I'm still slowly lumbering through my one [1] is proof that his system works for him. Personally, I'm too error-prone to pull that off. I change the code snippets frequently after chapters are done (often in response to bug reports from readers) and having to manually update the snippets in the text would drive me bonkers. Also, I want to rigorously, automatically validate that the code in the book is correct and contains everything you need. To do that, I wrote a Python script [2] that weaves the code and the Markdown together. In the Markdown files, you use a marker like (here in the chapter "Strings"): ^code memory-include-object (2 b
Read the rest
efore, 2 after) This means "insert the code snippet labeled "memory-include-object" here. Include 2 lines of contextual code (which is shown grayed out) before, and 2 after. In the code, the marker looks like: //> Strings memory-include-object #include "object.h" //< Strings memory-include-object The "//>" begins the snippet and the "//<" ends it. The build script reads the "^code" markers and finds the snippet of code in the sources that correspond to it, as well as any desired surrounding lines. But it can also do a lot of other useful things with the snippet markers: * If some lines of code are marked as being part of a chapter, but that chapter doesn't have a "^code" marker to include them, it reports an error. This way I can't accidentally drop code on the floor. * It can generate a separate copy of the entire codebase that only includes the snippets that are in a given chapter (and the preceding ones). In other words it can output "what does all the code look like by the time the reader reaches the end of chapter ___" for every chapter. I output the code for each chapter and then compile that and run all of the tests. This way, I can ensure that by the end of each chapter, the program supports what it's supposed to support by then. I've found countless bugs doing this -- places where I inadvertently put code in a later chapter that is actually needed earlier. However, this build script is not a generic "build a book" system. It's a bespoke program that only supports this one specific book. That helps keep the complexity down and makes it much easier to put little hacks in when I run into weird edge cases my specific book has. I think that's a reasonable trade-off to keep me producing a high-quality book without too much yak shaving. One of the days, I'll write a full blog post going through this in more detail. Of course, none of this is a criticism of Thorsten's system. The simple most important skill in writing a book is figuring how to get those pages done. It doesn't matter if that means waking up at three in the morning and writing on parchment with a red pencil. Whatever works for you, works. [1]: http://www.craftinginterpreters.com/ [2]: https://github.com/munificent/craftinginterpreters/tree/mast...
In The Tools I Use to Write Books
For my blog [0], I use Jekyll. I'm not super enthusiastic about it, but it gets the job done. Ideally, I'd use a system that doesn't require as much futzing around with Bundler and pip (I use pygments for source highlighting, so Python is in the mix too) every time I touch it. It's kind of slow too. For my first book [1], which is online too, I hand-rolled a tiny Python script [2] that converts the Markdown pages to HTML. It uses Python Markdown and that's about it. SASS for authoring CSS. (Weird observation: that 499-line Python script is probably the most profitable code I've ever written.) For my second book [3], I took that script and gave it some more juice since book #2 has more complex needs around including code snippets [4]. It's still hand-rolled. In addition to Python Markdown, the other interesting library it uses is jinja2 fo
Read the rest
r templates. I like it. I understand the arguments against rolling your own, but a blog generator is simple enough that the benefits of code reuse are relatively small. Meanwhile, the convenience of being able to jam little hacks specific to your need is very real [5]. When I get time to hack on my blog again, there's a good chance I'll ditch Jekyll and roll my own. [0]: http://journal.stuffwithstuff.com/ [1]: http://gameprogrammingpatterns.com/ [2]: https://github.com/munificent/game-programming-patterns/blob... [3]: http://www.craftinginterpreters.com/ [4]: https://github.com/munificent/craftinginterpreters/tree/mast... [5]: https://github.com/munificent/craftinginterpreters/blob/mast...
In Ask HN: What is your blogging platform of choice in 2018?
Yeah, I totally agree with that suggestion. Even handing typing in the code samples yourself instead of just reading them can help you get out of the "skimming" mindset and into really internalizing each step. If you're curious people have ported the code in the book to a lot of languages. Some of them are here: https://github.com/munificent/craftinginterpreters/wiki/Lox-... Though, if you want to do this yourself, consulting those might be considered cheating. :)
In A Virtual Machine

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.