Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 882 Bytes

README.md

File metadata and controls

30 lines (25 loc) · 882 Bytes

Rusp

This is technically 2 lisp interpreters in one repo, which share a lexer and parser: a tree-walker, and bytecode-compiler/vm. The following will be focussed on the bytecode compiler/vm:

Features

  • variable declarations
  • function declarations
  • recursion
  • closures
  • first-class functions
  • printing
  • quoting (not super stable but basically works)
  • conditionals
  • basic arithmetic
  • basic list operations: cons, car, cdr etc.
  • lambdas (via fn)
  • garbage collection
  • macros (the tree-walker has them, but the bytecode compiler/vm doesn't yet)

Usage

Assuming you have the rust toolchain installed:

# the `--bin ruspc` is necessary to run the bytecode compiler/vm, use `--bin ruspt` to run the tree-walker

# run the repl
cargo run --bin ruspc

# run a file
cargo run --bin ruspc -- <path-to-file>