Key points
- The whole book is free to read on its website, and the table of contents has 30 numbered chapters in three parts: 3 in Part I, 10 in Part II (the Java tree-walk interpreter) and 17 in Part III (the C bytecode virtual machine). (Source: https://craftinginterpreters.com/contents.html)
- Counting every second-level heading on the 30 chapter pages gives 196: 30 "Challenges" sections, 16 "Design Note" sections and 150 others. Part II has 67 of those headings and Part III has 106. (Source: the chapter pages linked from the contents page)
- The introduction says the first interpreter, jlox, is written in Java and the second, clox, in C. (Source: https://craftinginterpreters.com/introduction.html)
The question is not which book, but how much of it
Most of our comparisons here ask which edition of a book to read. This one has only one edition to choose from on the website, so the useful question is different: the book builds the same language twice, and a reader can reasonably wonder whether the first build is enough. We looked at the contents page and the chapter pages on 2026-11-22 to see how the two builds are laid out, and we count only what those pages show.
The home page puts the free option plainly: "Read the whole book for free. Really." (page retrieved 2026-11-22). The page also lists print, eBook and PDF formats; we did not open any store links and say nothing about them here.
What we counted
We fetched the contents page and counted numbered entries, parts, design notes and appendices. We then fetched each of the 30 chapter pages and counted its second-level headings.
| What we counted | Part I: Welcome | Part II: A Tree-Walk Interpreter | Part III: A Bytecode Virtual Machine | Whole book |
|---|---|---|---|---|
| Chapters | 3 | 10 | 17 | 30 |
| Design Note sections | 2 | 6 | 8 | 16 |
| "Challenges" sections | 3 | 10 | 17 | 30 |
| Other second-level headings | 18 | 51 | 81 | 150 |
| All second-level headings | 23 | 67 | 106 | 196 |
The contents page also lists a frontmatter (a dedication and acknowledgements) and a backmatter with two appendices: "Appendix I: Lox Grammar" and "Appendix II: Generated Syntax Tree Classes". On the page's markup every one of the 30 chapters has a Challenges section, while only 16 chapters carry a Design Note.
The numbers describe layout, not effort. A heading is not a page and a chapter is not a fixed number of hours, so we do not turn these counts into a time estimate.
Repeat it yourself
This Python script needs no packages. It reads the contents page, counts the entries, and then reads each chapter page. It makes 31 requests, so run it once rather than in a loop.
import re, urllib.request
H = {'User-Agent': 'Mozilla/5.0 (Macintosh) Safari/605.1'}
def get(u): return urllib.request.urlopen(urllib.request.Request(u, headers=H)).read().decode('utf8')
toc = get('https://craftinginterpreters.com/contents.html')
body = toc[toc.find('Frontmatter'):]
chap = re.findall(r'<li><span class="num">(\d+)\.</span><a href="([^"]+)"', body)
parts = re.findall(r'<h2><span class="num">([IV]+)\.', body)
dn = len(re.findall(r'<li class="design-note"', body))
print('parts', parts, 'chapters', len(chap), 'design-notes', dn)
total = 0
for n, u in chap:
total += len(re.findall(r'<h2[ >]', get('https://craftinginterpreters.com/' + u)))
print('h2 total', total)
When we ran it, it printed parts ['I', 'II', 'III'] chapters 30 design-notes 16 and h2 total 196. If the site changes its markup, the patterns will need adjusting, and the numbers will be different.
What the two interpreters are, according to the book
The introduction describes the plan in the author's words. The first interpreter, jlox, is written in Java, with a focus on concepts: the simplest, cleanest code that correctly implements the language. The second, clox, is written in C, and the introduction says that in it "we are forced to implement for ourselves" what Java gave for free, with its own dynamic array and hash table and its own decisions about how objects are represented in memory (retrieved 2026-11-22). It describes the C interpreter as containing a compiler that translates the language to a bytecode representation and then executes it, the technique it says is used by implementations of Lua, Python, Ruby and PHP.
Read together with the contents page, that gives a concrete picture. Part II's chapter titles run from Scanning through Parsing Expressions, Statements and State, Control Flow, Functions, Resolving and Binding, Classes and Inheritance. Part III's run from Chunks of Bytecode and A Virtual Machine through Hash Tables, Local Variables, Closures, Garbage Collection and Optimization. The titles show that Part III covers topics Part II does not, such as garbage collection and hash tables, because the C code has to supply them itself. They do not show how much of Part III repeats the language features that Part II already built.
Which readers each part suits
If you want to see how a language is parsed and evaluated, Part II is the part the contents page describes in those terms, and it is the shorter one by our count (10 chapters, 67 headings against 17 chapters and 106 headings). The introduction says readers have ported the code to other languages, so if Java is not a language you want to write, the author points you to those ports.
If you want to see what a bytecode virtual machine has to implement, the introduction places that in Part III, in C. Part III also has the larger share of the Design Notes (8 of 16).
If you are choosing between this book and another interpreter book, the contents page is the only thing we compared. We did not open the other books' pages for this article, and we make no statement about them.
The book is not a general programming course. If you are still choosing a first book for a language, our comparisons of two other free-to-read books, Eloquent JavaScript or You Don't Know JS Yet and SICP: Scheme edition or JavaScript edition?, count their contents the same way.
What these pages do not tell you
We have not read the book end to end or typed in any of its code, so we cannot say how long either part takes, whether the Java and C versions behave the same on every example, or how hard the Challenges are. A count of headings says nothing about how long a chapter runs, and we did not measure chapter length. We did not test any ported versions in other languages, and we did not check whether Part II is enough for someone who stops after it. The contents page tells us what the book contains, not how well it teaches it.

Comments