Guile Hoot v0.3.0 released!
Dave Thompson —![]()
We are excited to announce the release of Guile Hoot v0.3.0! Hoot is a Scheme to WebAssembly compiler backend for Guile, as well as a general purpose WebAssembly toolchain. In other words, Scheme in the browser!
Highlights
-
Partial implementation of the Scheme module system! In past releases, programs were compiled by combining user code with a large Scheme prelude that contained the entire standard library. In this release, we've extracted all of the R7RS interface to their appropriate
(scheme ...)modules and some Hoot-specific interfaces to(hoot ...)modules. Users can now use theimportsyntax to import these modules at the beginning of their programs. If noimportform appears, a default set of modules is imported. User-defined modules are not yet supported. We plan to address this in the next release.Supporting the Scheme module system in a whole-program compiler like Hoot is no easy task due to procedural macros (
syntax-case). If you're interested in the details, check out Hoot lead engineer Andy Wingo's blog post on the subject. -
More of R7RS-small has been implemented and Hoot can now run over half of the Scheme benchmarks.
-
The toolchain can now emit and parse binaries with a
namecustom section. This optional feature makes binaries larger and is intended for debugging. By default, name sections are not emitted. -
New hash table and weak key hashtable interfaces. Hoot's hashtable interface is inspired by, but does not conform to, R6RS. Hash keys are currently limited to identity (
eq) based hashing.eqvandequalhashing will come in a future release. -
The
(hoot reflect)module now automatically loadsreflect.wasm. In past releases, users would have to locate and load this binary on their own. It quickly became the most common source of confusion for new users. We hope it is easier than ever to get started with Hoot!
Read on for the full change log.
R7RS-small
-
Added
importsyntax. -
Added
truncateandexact-integer-sqrtprocedures. -
Added
guardexception handling syntax. -
Added
call-with-portprocedure. -
Added complex number procedures
make-polar,make-rectangular,magnitude, andangle. -
Added
string-mapandsubstringprocedures. -
Added support for two list arguments in
mapandfor-each(3+ lists still not implemented.) -
Enhanced
string->numberto parse all types of numbers. -
Fixed names of string comparison procedures.
string-=?is nowstring=?, etc. -
Fixed eta expansion of
-and/.
Non-standard interfaces
-
Added hash tables and weak key hash tables.
-
Added
external-non-null?procedure. -
Added support for
(ref extern)params/results todefine-foreign. -
Added support for
(ref eq)results todefine-foreign. -
Fixed port seeking.
Compiler
-
Added
library-groupform which encapsulates the entire compilation unit based on Enabling cross-library optimization and compile-time error checking in the presence of procedural macros. -
Added
#:emit-names?and#:importscompiler flags. -
Removed
#:envcompiler flag. -
read-and-compilenow looks for animportform and includes only those modules in the compilation unit when specified. -
Added support for
f64named temporaries to%inline-wasm. -
Fixed fast path check for
quoprimcall. -
Fixed fast path code for
rsh/immediateprimcall.
Runtime
-
Uncaught exception details are now printed. True Scheme backtraces are not yet possible, however.
-
Fixed
$argvtable initialization to fit the maximum number of procedure arguments that can be known at compile time. -
Fixed
$applyto dynamically grow the$argvtable when the number of arguments exceeds the current size. -
Fixed
$add-fracnum-fracnumwhen GCD is a bignum. -
Fixed
$quowhen most negative fixnum is divided by -1. -
Fixed stack pointer arithmetic in
$fluid-ref*.
Toolchain
-
Added support for generating
namecustom section toresolve-wasmin(wasm-resolve). -
Added support for
namecustom section toassemble-wasmin(wasm assemble). -
Added support for
namecustom section toparse-wasmin(wasm parse). -
Added
idfield to<wasm>type along withwasm-idaccessor. -
Added
<names>type for name custom section. -
Changed
hoot-instantiatein(hoot reflect)to automatically loadreflect.wasmfrom Hoot's installation directory or$HOOT_DATADIR. -
reflect.jsis now partially documented, though we hope to automatically generate all necessary JavaScript in the future so users need not concern themselves with this.
Browser compatibility
-
At last, Firefox 121, released in December, enables Wasm tail calls by default! This is the minimum Firefox version needed to run Hoot binaries without messing around in
about:config. -
Compatible with Google Chrome 119 or later.
-
Safari/WebKit is still unsupported.
Get Hoot 0.3.0!
Hoot is already available in GNU Guix:
$ guix pull
$ guix install guile-next guile-hoot
(Hoot currently requires a bleeding-edge version of Guile, hence
guile-next above.)
Otherwise, Hoot can be built from source via our release tarball. See the Hoot homepage for a download link and GPG signature.
Documentation for Hoot 0.3.0, including build instructions, can be found here.
FOSDEM 2024
Several of us at Spritely will be attending both FOSDEM and the Guix days which precede them. Robin Templeton will be presenting Scheme in the Browser with Guile Hoot and WebAssembly in the Declarative and Minimalistic Computing devroom on Sunday, February 4th.
If you're planning to attend, please come say hi!
Get in touch!
For bug reports, pull requests, or just to follow along with development, check out the Hoot project on Codeberg.
If you build something cool with Hoot, let us know on our community forum!
The code in this release was brought to you by Andy Wingo, Robin Templeton, David Thompson. The lovely Hoot art is by tessa. Special thanks to the MetaMask folks for funding this work!
Until next time, happy hooting! 🦉