Miniature, embeddable Scheme
The no-std and no-alloc Scheme implementation in Rust.
Stak Scheme
The miniature, embeddable R7RS Scheme implementation in Rust
Stak Scheme aims to be:
- An embeddable Scheme interpreter for Rust with very small memory footprint and reasonable performance
- The minimal implementation of the R7RS-small standard
- A subset of Chibi Scheme, Gauche, and Guile
- A portable scripting environment that supports even no-
std
and no-alloc
platforms
For more information and usage, visit the full documentation.
Install
Libraries
To install Stak Scheme as a library in your Rust project, run:
For full examples, see the examples
directory.
Command line tools
To install the Scheme interpreter as a command, run:
Examples
Embedding Scheme scripts in Rust
First, prepare a Scheme script at src/hello.scm
.
Then, add a build script at build.rs
to build the Scheme source file into bytecodes.
Now, you can include the Scheme script into a program in Rust using the stak::include_module
macro.
Communication between Scheme and Rust
Currently, in-memory standard input (stdin
) and output (stdout
) to Scheme scripts are the only way to communicate information between Rust programs and Scheme scripts.
References
- This project is based on Ribbit Scheme, the small and portable R4RS implementation.
- Scheme programming language
- The R7RS-small standard