An R7RS Scheme implemented in WebAssembly
An R7RS Scheme implemented in WebAssembly
A partial implementation of r7rs scheme, written
entirely in WebAssembly using the WebAssembly Text format. The only external
imports are for IO (read
, write
, and readFile
), unicode (I have an
import that reads information about 256 code-point blocks to enable case
operations etc.), and process control (exit
).
You can try it out at pollrobots.com/scheme/
The aim is to write a spec complete version of r7rs
, although I may skip
some of the optional features.
eval
uses a continuation passing
style, so TCO comes for free.call/cc
and exceptionsdefine-syntax
, syntax-rules
, syntax-error
let
, let*
, letrec
, letrec*
, and lambda
let-syntax
, letrec-syntax
dynamic-wind
Where practical everything has been implemented from scratch, but there are places where it either wasn't practical, or where I tried and failed to implement them myself, so credit is due to:
Additionally inspiration came from a couple of places