You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Jamie Quigley 1f6a3540c1 Clean up language extensions and removed `Result` 6 days ago
clox-pp Closures (sort of) 12 months ago
cpplox Chapter 4 half done 1 year ago
hslox Clean up language extensions and removed `Result` 6 days ago
rclox More tests 2 months ago
.gitignore Haskell! a lexer 2 months ago
LICENCE Initial commit 1 year ago
readme.md Update readme.md 2 months ago

readme.md

Crafting Interpreters

This repo contains multiple (incomplete) implementations of a Lox interpreter. Lox is a language designed by Bob Nystrom for his book Crafting Interpreters.

cpplox

cpplox is a tree-walk interpreter for Lox, written in C++. This is the only of the four that is complete.

It has very bad performance, due not only to the design, but also to the fact that it uses far too many std::shared_ptr and other inefficient patterns.

clox-pp

clox-pp is a C++ implementation of a bytecode interpreter, like clox.

rclox

rclox is an implementation of a code-generating interpreter (somewhat similar to clox), in Rust

It uses a Rust enum for the instructions, rather than bytecode. This has the effect that jumps can have distance usize (usually 64 bits), rather than 16 bits.

hslox

This one is in Haskell. The parser is implemented using Megaparsec, a parser-combinators library.

This is also WIP.


My code here is available under the terms of the GNU GPL, version 3.0.

Much of the code in cpplox and clox-pp (and to a lesser extent rclox) is very similar to the code from the book, which is available here under the MIT licence.