Skip to main content

Module wasm

Module wasm 

Source
Expand description

WebAssembly sandbox — the uniform execution path that every language can eventually share.

Today only the crate::runtimes::rust runtime uses it (because Rust has no in-process interpreter — we compile to wasm32-wasip1 and run via wasmtime). Tomorrow the in-process interpreters (Steel, Boa, RustPython, mlua) will be swapped for WASM-built equivalents and route through the same code path.

Gated behind the wasm Cargo feature.

§Pieces

  • engine — builds a wasmtime::Engine configured with the uniform sandbox: WASI with no preopens / no env / no sockets, wall-clock timeout via epoch interruption, optional instruction limit via fuel.
  • moduleWasmModule, the adapter that takes a WASI module binary plus a source string, runs it through wasmtime, and produces an crate::ExecOutput. Implements crate::Runtime.
  • cache~/.cache/outl/runtimes/ on Linux, ~/Library/Caches/outl/runtimes/ on macOS, etc. Lazy-generated .wasm blobs (today: Rust source → WASM) land here keyed by SHA-256 of the source.

Re-exports§

pub use cache::cache_dir;
pub use cache::cache_path_for_source;
pub use engine::make_engine;
pub use engine::SandboxLimits;
pub use module::WasmModule;

Modules§

cache
Lazy generation cache for .wasm modules.
engine
wasmtime::Engine factory + sandbox knobs.
module
WasmModule — the adapter that turns a WASI .wasm binary into a crate::Runtime.