WASI (WebAssembly System Interface) — standard API for WebAssembly outside the browser. Gives WASM access to filesystem, network, env vars in a sandboxed way. Enables server-side WASM: Fastly Compute@Edge, Fermyon Spin, Docker WASM containers, Envoy WASM filters. Competes with containers for lightweight serverless. Runtimes: Wasmtime (Mozilla), WasmEdge, WasmCloud.
Below: details, example, related terms, FAQ.
// Rust → WASI
// Cargo.toml
[dependencies]
wasi = "0.13"
// main.rs
use std::fs;
fn main() {
let content = fs::read_to_string("/data/input.txt").unwrap();
println!("{}", content);
}
// Build: cargo build --target wasm32-wasi
// Run: wasmtime --dir=/host/data main.wasmWASI: much faster start, smaller (KB vs MB), language-neutral. Containers: more compatibility with existing software. For serverless/edge — WASI wins.
Preview 2 released stable in 2024. Fastly, Cloudflare Workers use it internally. For mainstream — 2026+.
Not a replacement, a complement. Containers stay for legacy apps. New edge functions, plugins, serverless — WASI.