Home

Awesome

whitespace-rs

whitespace language interpreter, in Rust.

It's an esoteric stack-based language with 24 instructions that only use tab, space and line feed. Think assembly, but with a smaller instruction set, and with unreadable characters.

Unfortunately the original language page is dead, but it still lives on archive.org. A copy of the original Haskell implementation is copied inside the docs/WSpace directory

Goal

Ideally, it would deal with arbitrary sized integer (that's what the original Haskell implementation feature), but right now only regular i32 are used.

Usage

It can run a whitespace program :

  $ cargo run --bin interpreter -- examples/fact.ws

It can turn a whitespace source file into a rust source file that can the be compiled and run (actually it's more of a transpiler):

  $ cargo run --bin compiler -- examples/count2.ws src/bin/count.rs && cargo run --bin count

Todo

side stuff that would be nice to cleanup

License

The examples in the examples directory, the tutorial.html and some elements of documentation come straight from the original haskell implementation that can be downloaded on the wayback machine.

This rust implementation, in the src directory, is MIT licensed.