A simple Lisp interpreter/library in Rust. The interpreter/library was initially developed as a teaching aid to explain how Lisp interpreters work and how can they be implemented using the Rust programming language. However the interpreter seems to be taking life of it's own and has been ported to the web using WASM. The interpreter is available as a crate and can be used to embed a Lisp interpreter in your Rust projects. The WASM implementation uses the lisp-rs as a library to implement the online interpreter.
The interpreter is based on a modified subset of Scheme. Following are the features supported by the interpreter
- Variables and Constants
- Functions (lambdas)
- Functional constructs such as map, filter and reduce
- Closures
- Tail Call Optimization
More information about the dialect can be found at
The interpreter has been implemented in three phases
- Phase I: Complete interpreter and REPL implementation with support for basic data types (integers and boolean), variables, lambdas, and lambda calls (branch 0.0.1)
- Phase II: Support for advanced data types (string, float, and lists) and functional constructs (branch 0.0.2)
- Phase III: Support for tail call optimization (branch 0.0.3) and closures (branch 0.0.4)
For a detailed code-walkthrough about Phase-I implementation refer to the docs. For code-walkthrough of all the phases, get the e-book.
cargo run --features="build-binary"
cargo test
The interpreter has also been compiled to WASM so that it can run in a browser and is hosted here.