Stak Scheme
The miniature, embeddable R7RS Scheme implementation in Rust
The full documentation is here.
Install
Library
To install Stak Scheme as a library in your Rust project, run:
Command line tools
To install the Scheme interpreter and alike as command line tools, run:
# Install the Scheme interpreter.
# Install the minimal Scheme interpreter (6 times smaller!)
# Install the Scheme-to-bytecode compiler and bytecode interpreter.
Examples
Running a Scheme script
First, prepare a Scheme script at src/hello.scm
.
(import (scheme base))
(write-string "Hello, world!\n")
Then, add a build script at build.rs
to build the Scheme source file into bytecodes.
use ;
Now, you can include the Scheme script into a program in Rust using the stak::include_bytecode
macro.
use Error;
use ;
const HEAP_SIZE: usize = 1 << 16;
const BYTECODES: & = include_bytecode!;