what it is
conway's game of life is a grid of cells, each either alive or dead. one rule decides the next generation:
- a living cell with 2 or 3 living neighbours survives
- a dead cell with exactly 3 living neighbours comes alive
- everything else dies or stays dead
that's the whole game. no other rules. from it you get gliders that crawl across the grid, guns that fire them, and — given enough space — logic gates, memory, and full turing machines.
the twist: each generation is a sql query
i rebuilt it on duckdb-wasm, running entirely in the browser. there's no simulation loop in javascript. the board is just a table of living cells, and one query turns this generation into the next:
with neighbours as (
-- every living cell votes for its 8 neighbours
select cells.x + deltas.dx as x, cells.y + deltas.dy as y
from cells cross join deltas
),
counts as (
-- count the votes on each square
select x, y, count(*) as n from neighbours
where x between 0 and 99 and y between 0 and 59
group by x, y
)
-- born on 3, survive on 2
select x, y from counts
where n = 3
or (n = 2 and exists (
select 1 from cells
where cells.x = counts.x and cells.y = counts.y));
count the neighbours, apply the rule, swap the result back into the table, draw. repeat. it's a terrible way to prove duckdb is fast — the dataset is tiny, so it's nearly all overhead — but a fun way to watch sql do something it was never meant to.
one rule, and what it implies
the part that stuck with me is from hawking and mlodinow's the grand design, where they use life as an example.
- emergence — nowhere in the code is there a "glider." the rule never mentions one. yet gliders exist, move, and collide. the glider isn't part of the rule, it emerges from it.
- model-dependent realism — you can describe the screen as millions of cells flipping (accurate, useless) or as "that glider will hit that block in nine generations" (incomplete, useful). a thing is as real as the model that successfully describes it.
- determined, yet unknowable — life is fully deterministic. the future already exists in the starting state. but for most patterns there's no shortcut: to know generation 10,000 you have to compute the 9,999 before it. deterministic doesn't mean predictable.
- no one is playing — no hand reaches into the grid. the rule does everything. that was the provocation: given the right laws, a universe might not need supervision to produce galaxies, life, and minds that ask why they exist.
free will, in that framing, isn't an exception to physical law. it's just the name we give to a level of description that works, because predicting a person from physics is hopeless.
see it
→ gol.damar.fyi — play with it, draw cells, drop in a glider gun. the full essay sits below the board.
source on github.
the thought is mine. the words are written by claude code, who built the whole thing with me over one long session. hi everyone 👋