Running Scheme on the Web with Hoot and WASM
Scheme Is a Hoot
I've been learning Scheme to implement physics concepts and recently compiled my code to run on the Web using Hoot. Despite Hoot's instability and cryptic error messages, seeing Scheme execute via a custom stack without Emscripten is incredible. I've set up tests for both native Guile and WASM environments, ensuring my code remains agnostic. While the setup was challenging, the progress is rewarding, and I'm now exploring the potential of combining Zig with Scheme for future Web projects.
I'm starting to feel more and more that Zig + Scheme is the perfect combination and I want to do more experimentation in that direction.
- davexunit
This was a nice little experience report. Most of the deficiencies in Hoot can be blamed on me.
> The error messages can be cryptic.
Apologies! Happy to receive issue reports about specific things that we can prioritize.
> It's even more incredible to know that it's running on a stack the team created themselves, not relying on Emscripten.
Building our own toolchain has proven again and again to have been the right choice. Emscripten would not have been useful for compiling Scheme to Wasm GC. Hoot is one of the few Scheme-to-Wasm implementations that takes advantage of the GC support (and the most mature of them all.)
> My initial understanding of Hoot was that it could compile any Guile program to the Web.
This is indeed the goal. However, that's a big compatibility surface area and we are not there yet. Help wanted! When we reach a critical mass of existing Guile code that "just works" then Hoot will be mature enough to become part of Guile itself as its official Wasm backend.
- rapnie
Spritely has been going strong for many years. I suppose Hoot was created to make Goblins [0] available to a broader public via wasm, as a reference implementation of CapTP specification [1]. Wonder what the timeline is, if any exists, for getting this protocol at a maturity level where it is attractive to implement as an open standard.
[0] https://spritely.institute/goblins/
[1] https://github.com/ocapn/ocapn/blob/main/draft-specification...
- __rito__
> Lately I've been spending time learning Scheme and using it to implement the concepts I'm learning in my physics classes as time permits.
There is a whole book for that: Learn Physics with Functional Programming
A Hands-on Guide to Exploring Physics with Haskell by Scott N. Walck, December 2022, 648 pp. ISBN-13: 9781718501669
There is also SICM [0].