Glossary

What is jlox?

jlox is the first of the two Lox interpreters in Crafting Interpreters: a tree-walk interpreter written in Java across chapters 4 to 13. It scans source into tokens, parses them into a syntax tree and evaluates the tree directly.

Taught in Crafting Interpreters 4: Scanning, Crafting Interpreters 7: Evaluating Expressions, Crafting Interpreters 13: Inheritance

What you build

Chapter by chapter: a scanner (4), an AST generator (5), a recursive descent parser (6), an evaluator (7), statements and environments (8), control flow (9), functions and closures (10), a resolver pass for variable binding (11), classes (12) and inheritance (13).

Java's garbage collector and objects do a lot of the heavy lifting, which keeps jlox readable. The cost is speed: walking a tree of Java objects is slow, which is why the book builds clox next.

How long it takes

On the cracked.guide path jlox is weeks 1 to 11, at about 8 to 10 hours a week, and each chapter's guide budgets its own hours. See the Crafting Interpreters study plan for the full schedule.

Questions

Can I write jlox in another language?

Yes, many people do, but you have to translate the book's Java as you go. The test suite still works: point it at your executable.

Does jlox need a specific Java version?

No recent feature is required. Any current JDK works; the book's code is plain Java.