Game of Life

An interactive WebAssembly experiment. Compute cells in Rust compiled to WASM and render them via dynamic Canvas loops. Switch engines in real-time to benchmark WebAssembly vs JavaScript computation times.

FPS: 0Tick Time: 0μs
Engine: wasmGrid: 84x52

Engine Benchmark

Tick Compute:0.0 μs
Approx. Ratio:Fast / Low Overhead

Simulation

Paint Mode:
Tick Delay:50ms

Presets

Appearance

Color Palette:
Grid Resolution:

Simulation Statistics

Generation0
Population0
Peak Population0

The Rules of Conway's Life

  • Underpopulation: Any live cell with fewer than two live neighbors dies.
  • Survival: Any live cell with two or three live neighbors survives to the next generation.
  • Overpopulation: Any live cell with more than three live neighbors dies.
  • Reproduction: Any dead cell with exactly three live neighbors becomes alive.

WebAssembly vs JavaScript

This experiment highlights performance differences when running logic in WebAssembly compared to pure JavaScript. Conway's Game of Life requires updating every grid cell by inspecting its neighbor values.

By using a flat buffer structure in Rust, calculations run natively in a compiled, low-overhead environment. In JavaScript, we can copy these cells out of WASM linear memory into arrays without high overhead, keeping the canvas rendering fluid at 60 FPS even on large resolutions.

ZEYAD
DEEB