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
Section titled “Command line tools”Interpreters
Section titled “Interpreters”To install the Stak Scheme interpreter, run the following command in your terminal.
cargo install stakNow, you can run programs written in R7RS Scheme with the stak command as follows.
stak hello.scmThe content of the hello.scm would look like:
(import (scheme base))
(write-string "Hello, world!\n")Development tools
Section titled “Development tools”To install development tools of Stak Scheme, run the following command in your terminal:
cargo install stak-compile stak-interpretThe 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
Section titled “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-compileThe crates have different roles:
- The
stakcrate provides scripting engines, virtual machines, and utilities to run Scheme programs embedded in Rust. - The
stak-buildcrate compiles Scheme programs inbuild.rsbuild scripts in Rust crates. - The
stak-compilecrate is a Stak Scheme compiler to compile Scheme programs into bytecode.