← Back to Blogs
HN Story

Bringing Scheme to the Web: An Overview of Hoot 0.9.0

May 14, 2026

Bringing Scheme to the Web: An Overview of Hoot 0.9.0

The intersection of functional programming and web technologies continues to evolve with the release of Hoot 0.9.0. Hoot serves as a specialized WebAssembly (Wasm) compiler backend for Guile Scheme, effectively enabling developers to run Scheme directly in the browser. By bridging the gap between a high-level Lisp dialect and the efficiency of Wasm, Hoot opens new possibilities for web development, from interactive applications to browser-based gaming.

This latest release focuses on maturing the toolchain, improving the developer experience through better debugging support, and expanding the runtime's flexibility to support environments beyond the standard JavaScript-driven browser.

Enhancing the Toolchain and Debugging

One of the most significant shifts in Hoot 0.9.0 is the modernization of its debugging and metadata handling. The compiler has moved away from legacy function name and source metadata in favor of the DWARF custom section.

Key changes include:

  • Default Debugging: The default debug level is now set to 1, which automatically emits DWARF data. For production environments, developers can use -g0 or the new hoot strip command to remove this data and reduce binary size.
  • Standardized Exceptions: Hoot has transitioned from legacy exceptions to standard Wasm exceptions (officially adopted in July 2025). This ensures better alignment with the evolving Wasm specification and improves stability across modern browsers.
  • CLI Refinement: The command-line interface has been streamlined. The guild compile-wasm command is now deprecated in favor of hoot compile. Additionally, feature flags (using -f) have been decoupled from debug options (using -g), providing a clearer distinction between program behavior and diagnostic output.

Runtime Evolution and Non-JS Support

While Hoot is primarily associated with the browser, version 0.9.0 makes a concerted effort to support non-JavaScript runtimes, specifically mentioning Wastrel.

To achieve this, several architectural changes were implemented:

  • Host-Provided Types: The introduction of host-provided types facilitates better integration with Wastrel.
  • Scheme-Based Conversions: Floating point number to string conversion is now implemented directly in Scheme rather than relying on external imports. While this slightly increases binary size, it removes a critical dependency on JavaScript runtimes.
  • Monomorphized Bignums: Bignum imports have been monomorphized to ease the burden on non-JS runtimes.
  • Standardized Entry Point: Scheme binaries now export a main function that invokes the internal $load function, allowing Wastrel to boot Hoot programs without requiring the Scheme reflection interface.

Language and Compiler Improvements

Beyond the infrastructure, Hoot 0.9.0 introduces several refinements to the Scheme implementation and the compiler backend:

  • Guile Compatibility: The backend has been updated to support new primitive bytevector predicates introduced in Guile 3.0.11, and hash-set! (and related functions) now return the passed value to match standard Guile behavior.
  • Typed Arrays: A new uint8array->bytevector procedure has been added to the (hoot typed-arrays) module, simplifying data handling between Wasm and JavaScript.
  • Record Types: The Scheme interpreter now supports define-record-type for records with up to 8 fields, with plans for further expansion in future releases.
  • Optimization: The fsqrt import has been replaced by the native f64.sqrt instruction, improving performance.

Practical Application: Lisp Game Jam

To demonstrate the practical utility of Hoot, the Spritely Institute has released a Hoot game jam template. This template is designed for the Lisp Game Jam and provides a comprehensive starting point for HTML5 game development, including:

  • Bindings for essential web APIs and HTML5 canvas.
  • A Makefile for compilation and deployment to platforms like itch.io.
  • Gamepad input support (contributed by Gonzalo Delgado).

Existing projects like Cirkoban, Strigoform, and Shields TYVM serve as proof-of-concept examples of what can be achieved when combining the flexibility of Scheme with the portability of WebAssembly.

Compatibility and Installation

Hoot 0.9.0 maintains broad browser compatibility, supporting Safari 26+, Firefox 121+, and Chrome 119+.

Users can install Hoot via GNU Guix using guix install guile guile-hoot. It is also making its way into Debian repositories, though the release timeline may vary. For those preferring a manual setup, the project is available via release tarballs on the Hoot homepage.

References

HN Stories