Home

Awesome

Spiceweight

Spiceweight is an interpreter for the Whitespace programming language written in Crystal. It provides a handful of very useful features, to include:

Installation

Simply have Crystal installed and run make to build the executable (spwt). You can then copy it to a $PATH directory of your choosing or run the provided ./install script to automate the process.

Usage

$ spwt --help
Usage: spwt [OPTIONS] FILE
    -r, --report                     Display stack, heap, and instruction count after executing
    -b, --bench                      Benchmark calls to labels whose names begin with 'bench'
Labels in Whitespace code are purely numerical, of course, so this relies on
some other tool having previously generated a symbol table mapping label names
to their corresponding numbers. The Spitewaste assembler is one such tool.
    -h, --help                       Show this help

In most cases, you'll simply want to run spwt foo.ws to execute a Whitespace program. The --report switch is nice for ensuring that your program exits with a clean stack. The symbol file needed by --bench is automatically generated and stored somewhere Spiceweight knows to find it by the Spitewaste assembler when passing --symbol-file=% to spw exec|convert.