Component Model — a 2024+ standard that lets WASM modules exchange rich types (records, variants, strings, lists) without manual serialization. Interfaces are described in WIT (WebAssembly Interface Type). Runtimes: Wasmtime, WasmEdge. Upshot: JavaScript can import a Rust component as a regular npm package (ComponentizeJS, JCO).
Below: details, example, related terms, FAQ.
// hello.wit
package example:hello;
world app {
export greet: func(name: string) -> string;
}
// Rust implementation
#[export_name = "greet"]
pub extern "C" fn greet(name: &str) -> String {
format!("Hello, {}!", name)
}Older WASM modules exchanged only i32/i64/f32/f64 and pointers in shared memory. Component Model adds rich types.
Fastly Compute@Edge, Cloudflare Workers (experimental), Fermyon Spin.
Language-agnostic microservices: write a component in Rust, import it from JS/Python/Go natively — no REST/gRPC/serialization.