Swarm
Code

Draw together. Even when the internet is terrible.

Each box below is a different person's drawing board. The boards stay the same by sending each other little notes, with no big computer in the middle. Draw on one and watch it show up on the others. Then make the internet bad on purpose: slow it down, lose notes, cut the wires. The boards will get mixed up for a bit, but they always end up matching again.

no friends here yet

How it works, in simple words

01

Everyone has their own copy

Each box is like a kid with their own drawing. There is no "real" drawing kept somewhere else. Every kid just tries to keep their copy the same as everyone else's.

Grown-up name: replicas, no server
02

They pass little notes

When you move a box, your board doesn't send the whole picture. It sends a tiny note like "I moved the blue box". Each note has a number on it, so everyone knows which note came first.

Grown-up name: operations with Lamport clocks
03

A fair rule for ties

If two kids move the same box at the same time, who wins? Everyone uses the same simple rule (the higher number wins), so every board picks the same winner. The yellow glow means a tie just got settled.

Grown-up name: last-writer-wins registers
04

Words don't get jumbled

Each letter remembers which letter it was typed after. So if two kids type in the same sticky note at once, their words sit side by side instead of getting mixed into gibberish.

Grown-up name: RGA sequence CRDT
05

"What did I miss?"

Notes can get lost. So every now and then, boards ask each other "what did I miss?" and fill in the gaps. If the line between two kids is cut, a third kid can pass the notes along.

Grown-up name: gossip with version vectors
06

We checked it 10,000 times

A computer made up 10,000 messy games: notes lost, notes late, notes twice, lines cut. Every single time, all the boards ended up exactly the same.

Grown-up name: property-based testing