Install
This page explains how to install Stak Scheme as command line tools or libraries. By reading this page, you will learn:
- How to install Stak Scheme as command line tools.
- How to install Stak Scheme as libraries in Rust crates.
Command line tools
Interpreters
To install the Stak Scheme interpreter, run the following command in your terminal.
cargo install stak
Now, you can run programs written in R7RS Scheme with the stak
command as follows.
stak hello.scm
The content of the hello.scm
would look like:
(import (scheme base))
(write-string "Hello, world!\n")
Development tools
To install development tools of Stak Scheme, run the following command in your terminal:
cargo install stak-compile stak-interpret
The stak-compile
command is a Scheme-to-bytecode compiler. The stak-interpret
command is a bytecode interpreter that ingests and runs bytecode files built by the stak-compile
command.
Libraries
To install Stak Scheme as a library in your Rust crate, run the following commands in your terminal.
cargo add stakcargo add --build stak-buildcargo install stak-compile
The crates have different roles:
- The
stak
crate provides scripting engines, virtual machines, and utilities to run Scheme programs embedded in Rust. - The
stak-build
crate compiles Scheme programs inbuild.rs
build scripts in Rust crates. - The
stak-compile
crate is a Stak Scheme compiler to compile Scheme programs into bytecodes.