Scm2wasm: a Scheme to Wasm Compiler in 600 Lines of C, Making Use of Wasm Gc
Posted3 months agoActive3 months ago
git.lain.faithTechstory
excitedpositive
Debate
40/100
WebassemblySchemeCompilers
Key topics
Webassembly
Scheme
Compilers
A new Scheme to WASM compiler, scm2wasm, has been released, sparking discussion about its potential uses, comparisons to other similar projects, and the broader implications of running Scheme in the browser or natively.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
4h
Peak period
4
8-10h
Avg / period
2.2
Comment distribution29 data points
Loading chart...
Based on 29 loaded comments
Key moments
- 01Story posted
Sep 28, 2025 at 11:43 AM EDT
3 months ago
Step 01 - 02First comment
Sep 28, 2025 at 3:23 PM EDT
4h after posting
Step 02 - 03Peak activity
4 comments in 8-10h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 29, 2025 at 3:16 PM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45405175Type: storyLast synced: 11/20/2025, 3:53:09 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
It’s written in C, so you could compile that to wasm and then compile & run all inside the browser (I guess, assuming wasm is cool with that sort of thing, not a wasm guy here).
On the other hand, Hoot supports WASM-GC on release [0], and has had wasm support for a few years now. (Though Safari support has been a pain point - they've found a few bugs in WebKit's wasm support.)
[0] https://spritely.institute/news/hoot-0-6-1-released.html
Hoot (uses Guile Scheme), mentioned above, has a working interpreter, to quote...
https://spritely.institute/hoot/
Hoot looks fantastic. There's a side project, Goblins https://spritely.institute/goblins/ that does distributed development too.
Great to see that people are still supporting Scheme tools. There's a lot of utility here, even if people (and job adds) go for the "latest" tools.
I also wrote a forth in wasm by hand here: https://github.com/marianoguerra/ricardo-forth
And a wasm compiler that fits in a tweet: https://wasmgroundup.com/blog/wasm-compiler-in-a-tweet/
I'm also the co-author of a book that shows you how to write a compiler that targets wasm for a small languaje using js: https://wasmgroundup.com/
Here's a direct link to the wasm text format for the OOP and forth implementations:
- https://github.com/marianoguerra/mclulang/blob/main/wat/fatt...
- https://github.com/marianoguerra/ricardo-forth/blob/master/s...
Edit: https://apryse.com/blog/how-to-enable-webassembly-threads
What does this mean?
Found a link: https://tinlizzie.org/VPRIPapers/tr2006003a_objmod.pdf
There are plenty of problems with it:
https://okmij.org/ftp/continuations/against-callcc.html
People do not generally want to capture the entire continuation, they want delimiters. Delimited continuations are a superset of call/cc and vastly more useful, more performant and easier to understand.
The call/cc interface is completely backwards as well. It's like throw/catch but the exception handler is specified by throw instead of catch. Totally mind bending and unintuitive.
This continuation business is just resumable exceptions. Would have been a lot easier for people to understand and use had they just called it that.
Seems kind of backwards to call them resumable exceptions because delimited continuations are the primitive upon which an exception system can be built but yeah maybe it would make sense to programmers that already understand exceptions. I like the prompt metaphor, myself. https://www.gnu.org/software/guile/manual/html_node/Prompts....
Seems reasonable.
> I like the prompt metaphor, myself
Me too. I really like Guile's prompts. They are delimited and structurally similar to my example above, only they're even more powerful since they have tags which lets programmers unwind to specific delimiters!
I'm implementing this stuff in my lisp right now. The prompt primitive pushes a special continuation marker stack frame which also contains a value. The tagged prompts use symbols as the tag, untagged prompts use nil.
> Seems kind of backwards to call them resumable exceptions
This is is the analogy that enabled me to finally understand this continuation stuff. Alexis King's keynote shows that they are equivalent:
https://youtu.be/TE48LsgVlIU
Everybody understands exceptions. Delimited continuations are exceptions that not only unwind the stack but also back it up into a callable value.
I'm hoping that AT protocol-based self-hosted forges let us have the independence of self-hosted but the networking and gamification of GitHub. Maybe something like Tangled will bring that, though I haven't looked too deeply.