Skip to content

a lightweight tree-walk lisp interpreter, and bytecode-compiler/vm, written in rust

Notifications You must be signed in to change notification settings

oli-clive-griffin/rusp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

a lightweight tree-walk lisp interpreter, and bytecode-compiler/vm, written in rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages