A detailed account of adding a WebAssembly compiler to Bob, a 15-year-old Scheme implementation suite. The project explores lowering a high-level language with runtime features (closures, GC, built-in data structures) to WebAssembly using the WASM GC extension. Key technical challenges include representing Scheme objects as WASM GC structs (pairs, symbols, booleans), implementing string interning via linear memory offsets, and writing the `write` builtin directly in WASM text to handle recursive printing of arbitrary Scheme values.

6m read timeFrom eli.thegreenplace.net
Post cover image
Table of contents
HighlightsConclusion

Sort: