Browser WASM Guide
This page runs Lumen directly in your browser with rust/lumen-wasm.
Interactive Playground
The runner below executes real check, compile, and run calls through WebAssembly.
How This Works
At deploy time, GitHub Pages builds rust/lumen-wasm and ships these assets with the docs:
wasm/lumen_wasm.jswasm/lumen_wasm_bg.wasm
The playground dynamically imports that module and calls:
check(source)compile(source)run(source, "main")version()
Run Locally
1) Build WASM package
bash
cd rust/lumen-wasm
wasm-pack build --target web --release2) Start docs dev server
bash
cd docs
npm ci
npm run docs:devIf you want a standalone HTML version, see examples/wasm_browser.html.
Troubleshooting
- If the runner says WASM module failed to load, verify the module exists at
.../wasm/lumen_wasm.js. - If
compilesucceeds butrunfails, check the returned runtime error in the output panel. - For product direction and constraints, see
docs/WASM_STRATEGY.md.