Next: Installation, Previous: Supported platforms, Up: Introduction [Contents][Index]
Hoot is still in active development and its API should be considered unstable and subject to change in future releases. Hoot currently supports nearly all of the R7RS-small Scheme specification, a bit of R6RS, along with a subset of Guile-specific functionality such as prompts.
The largest missing pieces from Hoot’s R7RS-small support are
environments and evaluation (environment, eval, etc.)
which would allow for runtime interpretation of Scheme. Future
releases will add support for all of R7RS-small and eventually full
Guile-flavored Scheme.
To compile Scheme to Wasm, Hoot takes advantage of the features in the
Wasm 3.0 specification. The most important of these features are tail
calls and GC reference types. The return_call family of
instructions has made the implementation of Scheme’s tail recursive
procedure call semantics relatively straightforward. GC reference
type instructions allow for heap allocated objects (and immediates via
the i31 type) that are managed by the Wasm runtime. This
allows Hoot to take advantage of production garbage collectors already
present in web browsers, obviating the need to implement and ship a GC
which would be both inferior to the host’s and a major source of
binary bloat.
There’s an additional Wasm proposal that Hoot has been built on that has, unfortunately, not found its way into the core Wasm specification: stringref. We still emit stringref instructions as it is useful in the compilation pipeline but it is reduced to being an intermediate form. A lowering pass replaces stringref instructions with something resembling the JS String Builtins proposal.