BTC
ETH
SOL
BNB
GOLD
XRP
DOGE
ADA
Back to home
Tech

Wastrel milestone: full hoot support, with generational gc as a treat

Wastrel just hit a key milestone: it compiles Hoot Scheme code—including a full REPL—into standalone native x86-64 binaries.

Wastrel just hit a key milestone: it compiles Hoot Scheme code—including a full REPL—into standalone native x86-64 binaries. No browser required. You get a console-based read-eval-print loop with Hoot’s complete standard library, macro expander, and evaluator.

This matters because it bridges WebAssembly’s portability with native performance. Hoot compiles Scheme to Wasm; Wastrel translates that Wasm to ahead-of-time machine code. Result: Scheme programs run at near-native speeds on desktops, without runtime overhead like JIT compilers or browser sandboxes.

Building the REPL

Start with Hoot 0.8.0 from source. Create repl.scm:

(import (hoot repl))
(spawn-repl)

Compile to Wasm:

$ ./pre-inst-env hoot compile -fruntime-modules -o repl.wasm repl.scm

The -fruntime-modules flag skips tree-shaking, bundling all modules for dynamic lookup. Output: 6.6 MB Wasm file (1.2 MB with shaking). Takes ~1 minute.

Build Wastrel from source, then:

$ wastrel compile -o repl repl.wasm

Wastrel emits 6.6 million lines of C code across hundreds of files (~30KLOC each). GCC compiles and links with LTO: ~5 minutes total on a 32-core machine (3 min codegen, 2 min compile).

Run it:

$ ./repl
Hoot 0.8.0
Enter `,help' for help.
(hoot user)> "hello, world!"
=> "hello, world!"
(hoot user)> (+ 1 2 3)
=> 6

It works. Full REPL, including statics inspection.

Binary Size and Dependencies

With debug symbols (-g): 180 MB. Stripped: 33 MB. Code (.text) dominates at 92%. Each Wasm byte expands to ~5x in x86-64 instructions—inefficient, but expected for general Wasm-to-native.

Dynamic links: libc, libm, libgcc_s. No extras from Whippet GC, which Wastrel embeds. Whippet provides generational collection, a “treat” for low-pause performance in long-running REPLs.

Sizes are chunky. 33 MB for a REPL isn’t pocket-sized, but beats browser tabs for dedicated tools. Compile times (6+ min end-to-end) suit developers, not CI/CD yet.

Implications and Trade-offs

Wastrel unlocks Hoot for servers, desktops, embedded systems. Scheme’s hygiene and macros shine in native binaries—think scripting, tools, or even games without Wasm runtimes.

Skeptical take: Binary bloat limits mobile/edge use. No static linking yet; libc ties it to Linux/glibc. Codegen scale (6.6MLOC) stresses compilers, though parallel LTO helps.

Future potential: Strip more aggressively, AOT optimizations, multi-arch support. Pairs with Guile/Hoot ecosystems for secure, auditable code—relevant in crypto/security where trust-minimized runtimes matter.

Why care? WebAssembly promised universal binaries; Wastrel delivers native without JS/V8 cruft. For Scheme fans, it’s a console REPL unbound by browsers. Test it: costs time, yields a 33 MB powerhouse.

April 9, 2026 · 2 min · 15 views · Source: Lobsters

Related