Skip to content

friendlymatthew/gabagool

Repository files navigation

gabagool

A WebAssembly interpreter written from scratch.

This project aims to build a fully spec-compliant, performant interpreter whose entire execution state can be serialized, suspended, and restored.

See demo
Game of Life demo
Each fork snapshots the entire WebAssembly execution state, spawns a brand new process, and resumes exactly where it left off.

Status

gabagool is not optimized and no serious profiling/benchmarking has been done. That said, the goal is to make gabagool as performant as a pure interpreter can be. The most interesting direction is a translation phase that lowers WASM instructions into a compact intermediate representation, designed for efficient dispatch and serialization.

gabagool is tested against the WebAssembly spec test suite.

1,703 tests pass out of 2,049 (83%). gabagool passes on arithmetic, control flow, memory, tables, globals, function references, and imports/exports. It currently fails on exceptions.

Our testing harness uses modules from the test suite that cover execution, traps, resource exhaustion, and rejection (modules that should fail to parse or instantiate). We omit validation, cross-module invocation, garbage collection, and SIMD modules.

# run the test suite
uv run download-spec-tests.py
cargo t --features spec-tests

# run an example wasm program
cargo r -- stair_climb.wasm stair_climb 20

Reading

https://webassembly.github.io/spec/core/
bytecodealliance/wasmtime#3017
bytecodealliance/wasmtime#4002

https://www.infoq.com/podcasts/web-assembly-component-model/ https://blog.sunfishcode.online/what-is-a-wasm-component/ https://www.fermyon.com/blog/webassembly-component-model

About

Snapshotable WebAssembly interpreter from scratch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages