Inspired seeing others quickly built near-production level things that would normally take months or years, I decided to do something that only I would care about: build a Scheme compiler to WASM. I call it Puppy Scheme.
And it happened way faster than I expected. This is a side project so I’m not exactly sure the total number of hours I spent; it was most of last weekend plus an hour or two a couple of weekday nights, but that’s really it.
One night before I went to bed I told Claude to “grind on performance” and when I woke up it had taken compilation time from 3½ minutes down to 11 seconds. Just incredible stuff.
The compiler is definitely still alpha quality but the number of features is impressive for how little time I spent on it. It has:
Support for 73% of R5RS and R7RS
Support for WASI 2 and the Component Model
Uses WASM GC
Pretty good dead-code elimination, creating small binaries
Self-hosting - Puppy compiles its own source code to puppyc.wasm
A wasmtime wrapper to create native binaries
... continue reading