A sandbox for compiling Zig to WebAssembly and running it in the browser.
- Two Zig modules compiled to WebAssembly (
wasm32-freestanding) — a minimal JS bridge demo and a checkerboard pixel renderer - Shared
WebAssembly.Memorybetween JavaScript and Wasm modules viaimport_memory - Animated checkerboard pattern rendered on an HTML5 Canvas using
putImageData - Native HTTP server written in Zig (using
zap) to serve static files and Wasm binaries
- Zig
>= 0.14.0-dev.3460(seebuild.zig.zon) - A modern web browser with WebAssembly support
zig build # builds checkerboard.wasm, root.wasm, and the server binary
zig build run # launches the HTTP server on port 3000Open http://localhost:3000. The page loads both Wasm modules and renders an animated checkerboard that cycles colors every 250ms.
- zap v0.9.0 — HTTP server library
MIT