Rust / Wasm host runtimes for a multi-app Host
Research for Host + App + Dataset + Scheduled work (see root CONTEXT.md).
Question: which Rust-embeddable WebAssembly runtimes are viable bases for a Host that loads many untrusted Apps, mediates Dataset access, supports Scheduled work, and exposes a clear guest interface?
Claims below cite primary sources (official docs, first-party repos). This ticket shortlists options for later grilling — it does not pick the final stack.
Summary matrix
| Runtime | Embedding | Capability / sandbox | Component / WASI | Background work fit | License (core) | Fit for “Apps not in Host” |
|---|---|---|---|---|---|---|
| Wasmtime | First-class Rust crate (Engine / Store / Linker; wasmtime::component) |
Wasm sandbox + import-only ambient authority; WASI capability model for FS etc. | Strong: Component Model + WASIp2 via wasmtime-wasi |
Embedder owns scheduling (async Store, multiple instances) | Apache-2.0 (project LICENSE) | Best low-level fit — Host defines WIT worlds for Datasets/Grants |
| Spin | Embeddable execution context; custom triggers (incl. timer); experimental APIs | Per-component Wasm sandbox; Spin “factors” = which host APIs guests get | Built on Wasmtime + component model | Strong — HTTP/Redis triggers + documented timer trigger for intervals | Apache-2.0 (spinframework/spin) | Good if we adopt Spin’s app/trigger model; heavier product shape than raw Wasmtime |
| wash-runtime (wasmCloud) | Explicit embeddable runtime wrapping Wasmtime; plugin host APIs | Deny-by-default style capabilities via WASI builtins + host plugins | WASI Preview 2 + component model | Host/cluster oriented; plugins for kv/blobstore/messaging; not household UX | Apache-2.0 (crates/wash-runtime Cargo.toml) |
Strong capability wiring inspiration; name/product collision with our TBD; publish = false today |
| Wasmer | Native SDKs / embedding; multiple compiler backends | Sandbox + metering (“gas”); WASIX OS-like layer | Runtime features docs emphasize modules/WASIX more than Component Model as the center | Embedder schedules; metering helps multi-tenant limits | MIT (Wasmer project common SPDX; confirm per-crate when choosing) | Viable engine; weaker “WIT world as App contract” story than Wasmtime/Spin for our Dataset interface |
| Extism | Plug-in SDKs + host functions (bi-directional imports) | Plug-in isolation; host injects capabilities as imports | Oriented to core Wasm plugins + PDKs, not Component Model worlds | Call-style plugins; long-lived Scheduled work is host-owned, not first-class | BSD-like / see Extism repo license when locking | Good for “call this export” plugins; thin for rich Dataset WIT + multi-trigger Apps |
Wasmtime (Bytecode Alliance)
What it is
Standalone runtime for WebAssembly, WASI, and the Component Model; usable as CLI or embedded library (Wasmtime book).
Embedding
Rust API: compile modules/components, create instances, define host functions. Component Model embedding lives in wasmtime::component (Component, component Linker, bindgen! for WIT worlds) (API docs). WASI is supplied by wasmtime-wasi, not the core crate (crate root docs). WASIp2 embedding example: WASIp2.
Sandbox / capabilities
WebAssembly is import-gated: no ambient syscalls; only linked imports (Security). WASI filesystem follows a capability model (only granted paths) (same page). Defense-in-depth: memory isolation, guard regions, safe Rust embedder API.
Background / Scheduled work
No opinionated cron product. The Host can keep an async runtime, instantiate components on timers or queue wakes, and pass only the imports that App’s Grants allow. Fits “long-lived Host, not PHP request lifecycle” as long as we build the scheduler.
License
Apache License 2.0 header in bytecodealliance/wasmtime LICENSE (verify WITH LLVM-exception on published crates when locking).
Lesson for us
Wasmtime is the default substrate: define Host WIT for Dataset/View/Grant and Scheduled work; load App components dynamically; never compile Apps into the Host binary.
Spin (Spin Framework / Fermyon lineage)
What it is
Framework for building and running Wasm microservices/components on Wasmtime + component model (spinframework/spin; spinframework.dev).
Embedding
Official docs: extend with custom triggers; embed execution context without necessarily using spin.toml (Extending and Embedding Spin). Timer trigger sample: loop + sleep, then trigger_app.prepare → instantiate → WIT handle-timer-request — directly analogous to Scheduled work.
Sandbox / capabilities
Each component runs in Wasm sandbox; “factors” configure which host APIs guests receive (capability wiring at the framework layer).
Background fit
Best documented story among surveyed options for interval/deferred wakes (timer trigger). HTTP/Redis triggers cover request and message-driven Apps.
License
Apache-2.0 (GitHub license metadata).
Lesson for us
Shortlist Spin if we want trigger/app packaging and timer patterns out of the box — accepting experimental trigger APIs and Spin-shaped manifests/factors. Alternatively, copy the trigger pattern while embedding Wasmtime directly.
wash-runtime (wasmCloud)
What it is
Opinionated Wasmtime wrapper: “runtime and workload API for executing Wasm components”; powers wash dev, cluster host, custom embedded hosts (wasmCloud/wasmCloud README; crates/wash-runtime).
Embedding / capabilities
Built-in WASI via wasmtime-wasi; ingress for wasi:http; host plugins (with_plugin) for keyvalue, blobstore, config, logging, messaging (README). Cargo package: license = "Apache-2.0", publish = false (internal for now) — from crates/wash-runtime/Cargo.toml on main.
Background fit
Workload/host oriented; distributed/NATS story is central to the product. Useful reference for plugin-shaped capabilities; not a household Shell/Dataset product.
Lesson for us
Treat as architecture inspiration (deny-by-default host plugins) and possible library later — not as the product name, and beware depending on an unpublished crate without a stability story.
Wasmer
What it is
Wasm runtime with multiple compiler/engine backends, caching, metering, WASIX OS-like layer (Runtime features).
Embedding / sandbox
Native embedding SDKs; metering for resource limits across untrusted guests. Browser backend exists for WASIX-in-page — interesting for client guests later, orthogonal to server Host choice.
Component model
Public feature matrix emphasizes Wasm + WASIX features; Component Model / WIT-first Host contracts are less central in Wasmer’s primary “features” docs than in Wasmtime/Spin. Re-check component support depth before preferring Wasmer for Dataset WIT.
Lesson for us
Keep as alternate engine if Wasmtime embedding proves painful; not the first shortlist pick for WIT-defined Dataset Grants.
Extism
What it is
Plug-in framework: host loads plug-ins, optional host functions as Wasm imports for bi-directional calls (Host Functions).
Embedding / sandbox
Strong for “invoke export / provide imports” plugin APIs across languages. Signatures are Wasm value types (i32/i64/…), not WIT records — richer Dataset APIs mean more manual ABI or higher-level conventions on top.
Background fit
Host still owns timers; Extism doesn’t define a Spin-like trigger model in the cited docs.
Lesson for us
Useful pattern for simple extensions; weaker fit than Wasmtime components for first-class Dataset/View WIT.
Shortlist for later grilling (no final pick)
- Wasmtime (direct embed) + custom WIT worlds — maximum control for Dataset/View/Grant and Scheduled work; standards-aligned; we own the scheduler (Spin’s timer pattern as a design reference).
- Spin (embed / custom triggers) — if we want framework packaging and built-in timer/HTTP trigger ergonomics; accept Spin API churn and product shape.
- wash-runtime — only if we want an existing capability-plugin Host API and accept wasmCloud ecosystem coupling / unpublished crate risk; otherwise keep as prior art.
Not on the shortlist for the Host core: Extism (plugin ABI too low-level for Dataset WIT), Wasmer (secondary engine candidate, not primary WIT Host).