A C++ implementation of jlox from Part I of Crafting Interpreters, written in C++20 with a focus on modern C++ practices.
- A C++20 compatible compiler (e.g., GCC 10+, Clang 10+, MSVC 2019+)
- CMake
-
Clone the repository:
$ git clone https://github.com/segunkayode1/lox.git $ cd lox -
Create and navigate to the build directory:
$ mkdir build $ cd build -
Run CMake and build the project:
$ cmake .. $ cmake --build .
You can either give a file to be interpreted:
$ lox /path/to/your/file.loxOr start an interactive session:
$ lox- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12 (in progress)
- Bob Nystrom, for his excellent book Crafting Interpreters.
Crafting Interpreters contains everything you need to implement a full-featured, efficient scripting language. You’ll learn both high-level concepts around parsing and semantics and gritty details like bytecode representation and garbage collection. Your brain will light up with new ideas, and your hands will get dirty and calloused. It’s a blast.