Topaz has two different WASM products. A program web target is generated from an application by topaz build; the playground artifact is the compiler/interpreter compiled to WASM so a browser can check and run Topaz source. They have different ABIs, rebuild paths, and trust boundaries.
Contract and components
--target web emits a raw-WASM program package with JavaScript and TypeScript ABI glue. web-worker adds worker/client transport. The site playground loads topaz_wasm_bg.wasm, its generated JavaScript bindings, and a worker; it exposes bounded check/run behavior without installing the native CLI.
Workflow
For an application, choose web or web-worker, inspect the generated package, and integrate its documented API. For interactive experiments, use the playground. The two outputs serve different purposes and are not interchangeable.
Current support
The public playground runs the v5.6.0 compiler and provides source editing, checking, interpreter execution, output, and diagnostics. Web and web-worker builds include WASM with the JavaScript or TypeScript integration code needed by the selected target.
Boundaries and limitations
The playground is not the native CLI: no ambient filesystem, process, cargo, or unrestricted network capability is implied. Host-facing behavior is limited by browser APIs and the worker protocol. A green playground smoke does not prove every generated web application, and a web-target test does not prove the compiler playground; both gates are required.
Command reference
topaz build main.tpz --target web --out-dir web-out
topaz build main.tpz --target web-worker --out-dir worker-out
node compiler/scripts/playground-smoke.mjs