Skip to content

Pyrolistical/zig-wasm-canvas

Repository files navigation

zig-wasm-canvas

Demo showing how to call HTML canvas from zig via WebAssembly.

Live demo

Features

  • Shim that makes it appear canvas ctx is in zig
  • Shows how to pass strings from zig to JavaScript and vice versa
  • @panic in zig throws an error in JavaScript

Setup

  1. Download zig 0.12.0
  2. Add zig to path.
  3. npm run build:zig
  4. npm run start
  5. Re-run npm run build:zig whenever zig files are changed.