Side-by-side comparison of maze generation in WASM (C compiled to wasm32) and JavaScript. Renders to canvas.
Requires Bun and clang with wasm32 target support.
bun install
bun run build:wasm
bun run dev
bun run build
Outputs to dist/.
Both implementations use randomized DFS (recursive backtracker) to generate perfect mazes. The C version (maze.c) is compiled to a standalone .wasm module with no libc dependency. The JS version (maze.ts) is a direct TypeScript port.
Mazes are drawn on a <canvas> using CanvasRenderingContext2D.
WASM setup based on Surma's Compiling C to WebAssembly without Emscripten.