A small WebAssembly interpreter written in Rust for embedding into other applications.
This runtime is intentionally interpreter-first: simple control flow, explicit runtime state, and host-driven execution. The primary goal is budget-controlled execution inside larger runtimes, where the host can run WASM in bounded slices and resume later. It is not trying to be a high-performance JIT or a WASI runtime.
Work in progress. Not production-ready.
- Core numeric execution:
i32,i64,f32,f64arithmetic and comparisons. - Control flow:
block,loop,if/else,br,br_if,br_table,return, traps. - Variables and functions: locals/globals, direct calls,
call_indirectwith signature checks. - Memory: linear memory load/store, memory size/grow, and multi-memory indexing for 32-bit memories.
- Tables and references:
funcref/externref,table.get,table.set,ref.null,ref.func,ref.is_null,ref.eq,ref.as_non_null. - Bulk memory/table ops:
memory.init,data.drop,memory.copy,memory.fill,table.init,elem.drop,table.copy,table.grow,table.size,table.fill. - Module linking model: imports/exports, start function execution, multi-module execution state.
- Incremental execution API:
ExecutionState::run_for_ticks(ticks)returnsCompleteorPausedand can be resumed. - Shared imported runtime state: imported memories and tables share backing storage across modules.
Current branch status:
cargo test --libpasses (21unit tests).- WAST integration coverage is substantial but partial and still evolving.
Important scope note:
- The WAST harness currently runs a curated subset of the official suite.
- Repository has
257.wastfiles undertests/testsuite. - Harness currently wires
130of those files as executable tests.
- No WASI support.
- Many proposals are not implemented: SIMD, threads, GC, exceptions, typed function references (
call_reffamily), and others. - Memory64 is not supported.
- Runtime state is not designed for cross-thread
Sendusage in its current form. - No stable serialization/deserialization API for execution state yet.
The current WAST expansion work is targeting:
- Core MVP behavior and parser robustness.
- Bulk memory/table semantics and edge cases.
- Reference-types behavior that does not require typed function references (
call_ref) or GC.
WAST files tied to unsupported proposals (SIMD, GC, exceptions, typed-function-references/tail-call, memory64) are intentionally left out for now.
This repo includes two benchmark entry points:
- Cross-runtime runner (
wasboxvswasmtime):cargo run --release --bin bench_runner -- --engine both --warmup 250 --iters 2000- Optional:
--case <name>(repeatable),--list, and--csv <path>.
- Criterion benches (internal
wasboxtuning):cargo bench --bench runtime
The cross-runtime runner uses a small built-in suite of deterministic WAT programs and reports:
- module instantiate time
- total execute time over N iterations
- mean execute time per iteration
GPL-3.0.
If you distribute modifications, you must share source under the same license terms.