Every line of Amaze is open to read. Read it ›

Built Like a Cell

Why Amaze is small, made of one kind of thing, and changeable while it runs

Flindev, October 2026. An essay about how Amaze is put together; the figures are live. Where something isn’t built yet, it says so.

Most software is built like a pyramid. Each layer is piled on the one below, by brute force, until the whole thing is enormous and there’s no room inside. It stands up because it’s heavy, not because it’s designed.

Alan Kay has used this comparison for decades. You can build a doghouse out of anything: nail some boards together and it stands. Scale the same approach up a hundred times and it collapses, so people pile on more material and plaster over it. An arch does the same job with a tiny fraction of the stone, because the arrangement does the work.

And then there’s biology. Gears jam somewhere around a thousand parts. A body runs on a hundred trillion cells. Each cell is sealed, does its own job, and talks to the others by sending messages, and the whole thing keeps working while every part of it is replaced.

The principle. Build the computer the way biology builds things: one small kind of part, sealed, talking by messages, and able to change while it’s alive.

The rest of this essay is what that looks like when you actually do it.

Pyramid Arch Cell big by piling on big by arrangement big by many small, sealed parts
Three ways to make something big. Only the last keeps working while you change it.

One kind of thing

Everything you see in Amaze is the same kind of thing: a box. A ball is a box, a button is a box, the menu bar is a box, and so is the world they sit in. A box has a handful of values, and each value is a formula over other values, like a cell in a spreadsheet.

That’s the whole programming model. There are no event handlers to write and nothing to keep in sync by hand: when one value changes, everything that depends on it follows. Here is the basketball as that graph, with values read from the running world.

Because every box is built the same way, anything you learn about one applies to all of them, including the parts of Amaze itself.

basketbindings from Ball, values from the live world

One engine reads everything

Cells all read the same genetic code. Amaze has something like it: every language, file format and network protocol it understands is described the same way, as a short grammar, and one small engine reads them all.

The program you write, the drawing on a ball, the rules of physics and a TCP packet all go through it. Learn to read one grammar and you can read every one, because there’s nothing else.

The grammars Amaze runs today, each a few rules long, all read by the same engine.

So a new language is cheap

Once a grammar is a few lines, making a new language stops being a project. Most computers make you learn their languages. Amaze lets you make your own: write a few rules for what a sentence looks like, give a box the grammar, and talk to it in words that fit the job.

The rail yard here speaks one made up this way, with tracks, signals, stations and timetables, in five rules.

GrammarRailfive rules
word    = ws alpha (alpha | digit)*,
num     = ws '-'? digit+,
item    = num | word,
stmt    = ws word item*,
program = line* ws
Raila program in it
track west M -100 130 L -100 -130
station mine west 130 load
station mill east 130 unload
train express west at 100
  speed 100 cars 3 stops mine mill
mine mill
Want to try? Make one and teach it words, right in the page.

A language can be a whole tool

A language can carry a lot. Say what a structure is, where the joints sit, which are pinned, which rods join them, what weight it carries, and the truss language turns those sentences into constraints and solves them every frame.

Rods turn red when they’re stretched and blue when they’re squeezed, and snap past their limit. The screenshot is Amaze running this exact program, and the language itself is under 200 lines, loaded into a running world rather than built in.

Trussthe whole bridgea Warren truss, a weight of 120 on joint c
joint a -160 40
joint b -80 40
joint c 0 40
joint d 80 40
joint e 160 40
joint f -120 -40
joint g -40 -40
joint h 40 -40
joint i 120 -40
pin a
pin e
rod a b
rod b c
rod c d
rod d e
rod f g
rod g h
rod h i
rod a f
rod f b
rod b g
rod g c
rod c h
rod h d
rod d i
rod i e
load c 120
gravity 2
stiffness 60
passes 6
break 112
The bridge in Amaze: nine joints, two of them pinned in gold, a weight of 120 under the middle. The top chord is blue, in compression; the two end diagonals are red, in tension. The readout says sag 43, broken 0.
A screenshot of Amaze running this program. The top chord is squeezed and the end diagonals stretched, which is how a real Warren truss carries a load in the middle.
Lispthe truss language193 lines with its comments, loaded into a running world
joint a -150 40a point, in pixels
pin aa joint that doesn’t move
rod a bits length is a constraint
load c 120a weight pulling a joint down
gravity 2on every free joint
damping 98how much speed a joint keeps each frame
stiffness 60how much of each rod’s error is fixed per pass
passes 6solver passes per frame
break 112a rod stretched past 112% snaps

Each frame, every free joint keeps its momentum and feels gravity and its load. Then each rod pulls its two ends back toward its rest length, six times over, and the pins hold still. What’s left over is the strain each rod shows.

; each unbroken rod pulls its ends toward its rest length; pins stay
(define (truss-relax! rods stiffness passes)
  (if (<= passes 0) nil
    (begin (truss-relax-pass! rods stiffness)
           (truss-relax! rods stiffness (- passes 1)))))
Read the whole language or the bridge’s KScript in the source browser. Neither is built into Amaze: both arrive in a running world, the way the Studio adds them.

The picture can be the program

The internet’s own specifications describe every packet with a little box diagram. Amaze already reads every packet with a grammar. Next, the diagram itself becomes that grammar, so the documentation and the code are the same picture.

Click any field in the diagram to see it picked out of a real packet.

Grammar inputthe IPv4 header, as drawn in its specification

      
Next: one rule, ip = diagram, reads this picture and defines ip.version, ip.protocol and every other field. Today the same fields are a grammar written as a list.
A packet20 bytes off the wire

Nothing is fixed

A cell doesn’t stop to be upgraded. Neither does Amaze. Very little is decided when it’s built: fonts, network security, file formats and new languages all arrive as ordinary definitions, loaded into the running world.

So none of it is baked in, and any of it can be replaced without a restart. Bind late, and you can still change your mind once you understand what you actually needed.

Built inArrives later, as definitions
Bitmap fontOutline fonts, from a TrueType grammar
Raw TCP/IPTLS and the cryptography under it
Seven grammar filesHTTP, email, Markdown, PDF: each one more grammar
Physics and railAny new language a box can speak
Left: in the kernel image today. Right: loaded into the running world, not built into it.

Try anything

A world that can change while it runs needs a safe way to try things. The plan is to let you sprout a copy of your world, change whatever you like inside it, then keep the result or throw it away. Undo comes free, and so does “what if”: run three versions side by side and pick one.

This one isn’t built yet. It’s small, a few dozen lines over the way boxes read and write values, and it’s what makes everything above safe to play with, so it’s high on the list.

This worldthree what-ifs, sprouted from one world
Now
Nowyour world
gravity 200
gravity 200sprouted
Keep
friction 999
friction 999sprouted
Throw away
new menu bar
new menu barsprouted
Compare
Each copy is a whole world. Keep one, throw the rest away.
A sketch of what it will look like. Not built yet.

It can rewrite itself

The last thing small buys you is the strangest. The whole of Amaze, every line, fits in front of a language model at once, about 170,000 tokens. So the model doesn’t guess how your computer works. It reads all of it, and can change any part of it in a single request.

You talk to it in the Studio, a chat that sits in your world next to whatever it’s building. Here it’s asked for a cipher. Taken further, this is how a room can write its own program while you cook: see Grown in Place.

One book

Put together, these choices keep the whole computer small: under 20,000 lines from the screen to the metal, about the length of one book. Not because small is a goal in itself, but because it’s what lets a person read it, change it, and hand it to a model whole.

Read every line of it, or follow one basketball all the way down.