Skip to content
Backend (Host)

Backend (Host)

The Backend is the Host runtime that installs and runs server Apps, delivers their events, and mediates their access to Datasets and capabilities. It is built in Rust and embeds Wasmtime directly.

App runtime

Server Apps run as WebAssembly Components with Wasmtime. The Host defines their interfaces with WIT worlds for operations such as Dataset and Grant access, capabilities, and event handlers. Where portable system interfaces are useful, the Host targets WASI Preview 2–class imports.

The Host links only the imports an App is allowed to use. Apps have no ambient filesystem or network access; access to data and external services is mediated by Host-enforced Grants and capabilities. Scheduled work and event delivery are also Host-owned. Spin’s timer and trigger patterns are useful prior art, but the Backend does not depend on Spin.

Wasmtime provides resource controls including memory limits, fuel, and epoch interruption. The exact policy is described in Wasm resource limits.

Client App Wasm runs in browser workers and is mediated by the Shell. It does not run under Wasmtime in the Backend. See Webclient for the browser-side runtime and transport.

Runtime decision

Wasmtime is licensed under Apache-2.0 WITH LLVM-exception and stewarded by the Bytecode Alliance. The Host embeds its Engine, Store, and component Linker APIs rather than adopting a higher-level application framework.

The following options to run Wasm in Rust have been checked:

Option Assessment
Wasmtime, embedded directly Chosen for control of the Host, first-class Components and WIT, and resource controls
Spin Useful timer and trigger patterns, but its framework model does not fit the custom Shell and Dataset Host; custom triggers remain prior art
wash-runtime / wasmCloud Capability plugin APIs, but its lattice and cluster model does not fit this Host; embedding and naming concerns also weighed against it
Wasmer Metering and WASIX, but a weaker WIT-first fit and licensing concerns for some builds
WasmEdge Edge and cloud focus, but C++-centric and a less complete Component Model fit for this Rust Host
Wasmi, WAMR, Extism, and others Interpreters or specialized plugin runtimes that do not fit the Dataset WIT and multi-App Host as well

Decision: Embed Wasmtime directly and define custom WIT contracts. Spin timers and wasmCloud plugin APIs remain design references, not dependencies. Browser client Wasm uses browser engines through Shell mediation.

WASI is a capability-oriented system interface for Wasm. The Host links only selected imports, preserving the same deny-by-default boundary as the App capability model.

Research: Wasm Host runtimes and runtime landscape.