Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Support

Wax works across all three formats (Wax, WAT, Wasm) and targets recent WebAssembly proposals, several of them on by default, that most toolchains still gate. This page summarises what the toolchain accepts and produces.

On by default

Wax fully supports the WebAssembly 3.0 standard: garbage collection (WasmGC), exception handling (try_table), tail calls, multiple memories, 64-bit memory (memory64), reference types, bulk memory, and SIMD (including relaxed SIMD).

On top of that, it enables these further proposals by default:

ProposalIn Wax
Stack switching (typed continuations)cont, suspend, resume, …
Threads / atomicsshared memory, atomic loads/stores/RMW, atomic::fence()
Wide arithmetic128-bit integer ops (e.g. i64::add128)
Branch hinting#[likely] / #[unlikely]
Compilation hints#[freq = n] / #[never_opt] / #[always_opt], #[targets(f: 0.73)], #[priority = n] / #[optimization = n] / #[run_once]
Custom page sizespagesize
Extended name section$-identifiers for types, tables, memories, globals, data/element segments, fields, and labels survive the binary round-trip
WAT numeric valuestyped numeric runs in data segments (data d = [i16: -1, 2] ++ [f32: 0.5, nan] ++ [v128: i32x4(1,2,3,4)];); runs survive the wax↔wat round-trip

Enabled with -X

Off by default; turn one on with -X NAME (see the CLI reference):

FeatureWhat it adds
custom-descriptorsexact reference types, descriptor structs, and the descriptor instructions (descriptor / describes)
compact-import-sectionwrites same-module imports under one module name in the binary import section. From a text input it lowers a import "m" { … } block / (import "m" (item …) …) group to a compact entry (a shared-type group when the items’ types match, else one type per item; a one-item block flattens; separate imports are never merged). From a binary input it coalesces runs of consecutive same-module plain imports. Groups written explicitly (in WAT, or already present in a binary) round-trip regardless of the flag

Not supported

FeatureNotes
Legacy delegate / rethrowrejected on input. The rest of legacy exception handling (try/catch/catch_all) is supported: it has dedicated Wax syntax (try { … } catch { … }) and round-trips through the legacy binary opcodes
Component Model

A deliberate relaxation

A tag may carry a result type: tag yield(i32) -> i32. The MVP requires tags to have empty results; the stack-switching proposal lifts that (a suspended tag resumes with a value), so Wax permits it on purpose. See Stack Switching.