This repository contains two implementations of the Lox language from Robert Nystrom’s Crafting Interpreters:
- jlox — a tree-walking interpreter implemented in Java.
- clox — a bytecode compiler and virtual machine implemented in C.
- Java 11+ for jlox
- C compiler (GCC, Clang, or MSVC) and CMake for clox
| Part | Focus | Key Topics |
|---|---|---|
| jlox | Simplicity & clarity | Lexing, Parsing, ASTs, Interpreter, Resolver |
| clox | Performance & internals | Bytecode, VM loop, Stack frames, Compiler, GC |
jlox
- Scanner
- Parser
- Interpreter
- Classes & inheritance
clox
- Chunk & disassembler
- VM dispatch loop
- Compiler
- Closures
- Garbage Collextion
- Classes & inheritance
- Optimization