WAST — compile to WASM in your browser

WAST is a high-level IR for WebAssembly. The playground below runs the whole toolchain in this page: your source is parsed, compiled to a core wasm module, and instantiated right here — no server, and nothing between the compiled module and the browser.

That last part is the interesting bit. The compiler can emit a WebAssembly Component, which no browser can instantiate directly. It can also emit the core module inside it, and a program with no imports needs no import object at all: it carries its own memory and defines cabi_realloc rather than importing it. So the output of a compile you just ran is callable from JavaScript immediately, with no glue and no jco.

Playground

One IR, several surface syntaxes (click to expand)

The source above is one projection of the IR, not the IR itself. Identifiers in a wast program are opaque uids and display names live separately, so the same component renders into several syntaxes. Every plugin renders; only some parse back.

Pre-built Components (click to expand)

These were compiled to full WASM Components at build time and transpiled with jco — the path the playground deliberately avoids. They cover the richer types the Canonical ABI needs a host for.