Open Manual

Browser and WebAssembly

The browser target has its own host API. It does not inherit native filesystem, process, thread, audio, or Vulkan support merely because similarly named APIs exist on native targets. Check the capability used by the program on the exact browser route.

Prerequisites: a compiler checkout with browser tooling and a WebAssembly-capable browser.

Build and test

./make web etc/labs/pong.ny --out build/web/pong
./make web-check etc/labs/pong.ny
./make web-test
./make wasm path/to/program.ny --out build/program.wasm
./make web-demos

web builds a deployable browser app; wasm emits a Wasm artifact. Use the project command's help for options and prerequisites:

./make help web
./make help wasm
./make help web-test

Host boundary

Browser code runs through explicit imports and browser capabilities. APIs that need a user gesture, permission, secure context, WebSocket server, or live browser lifecycle can fail or be unavailable even when the program compiles. Handle those results rather than assuming desktop behavior.

The maintained browser path includes a WebGL2 runner and a minimal Wasm runtime. The separate Emscripten adapter has its own build and import contract; use it only when the project requires that toolchain. See UI for application code and Networking for browser networking.

Diagnose a failure

Record the full command, target, browser, host capability, and first failing observable result. Separate a compile/link failure from a denied browser API or and a missing service. See Execution routes for route differences and Testing for repository checks.

Next: