Mere Wasm Playground
Note: these demos are Mere programs pre-compiled to
Wasm via
mere -w <file.mere>. The browser
instantiates the Wasm module and runs main. A live
compile-in-browser REPL (via js_of_ocaml) is a
separate Phase.
Demos
For an interactive demo that wires DOM events back into Mere, see the counter page (Phase 48 C2 FFI).
Source (preview)
// Click a demo button above to view its source here.
Output
// Output appears here after the Wasm module runs.
How it works
Each demo goes through the same pipeline:
mere -w demo.mereemits the WAT text format.wat2wasmassembles it into a binary.wasm.- This page
fetches the binary and runsWebAssembly.instantiate. - The Wasm
putsimport is wired on the JS side to read a C-string from linear memory and append it to the output pane.
This brings the 4-backend feature parity (interp + C + LLVM + Wasm) straight into the browser: source → Wasm → live run.