RC RANDOM CHAOS

Bend proves the laws you write, and only those

Bend proves your stated laws hold for all inputs, which makes picking the right laws and defining them correctly the real work.

· 3 min read
Bend proves the laws you write, and only those

bend-lang.com makes a precise claim: put your rules in a file called LAWS.bend and “no AI can ship one line that breaks them, ever.” Merging a bug, the site says, becomes “mathematically impossible: it is a theorem.” The demonstration is a game. An agent is told “make the board wrap around.” Without a law in place the bug ships; with one, the agent “had to retry until it built a wall and proved the law holds.”

The law it shows:

law you_cant_win:
  for moves: List<Move>
  board = replay(start(), moves)
  is_won(board) == False{}

For any sequence of moves replayed from the start, the board is never won. It is a precise, machine-checkable property. Bend’s type checker, per the site, is a proof checker in the lineage of Lean and Rocq, and it verifies the matching PROOF.bend in under a second where those tools can take minutes on a mid-sized codebase.

Take the claims at face value. A dependent type checker that accepts a proof of you_cant_win does guarantee you_cant_win. It guarantees nothing you did not write down. The wrap-around bug got caught because someone had already decided that winnability was the property worth protecting and had stated it, correctly, before the feature landed. A bug that left winnability intact would be invisible to you_cant_win; the law guarantees the property it states and reaches no further.

That reframes “Make no mistakes is now type-checked.” A proof checker proves the theorems you state. “A mistake” is not a theorem; it is not a formal object at all. The work that decides whether Bend helps you is choosing which invariants matter and encoding them so they say what you mean. That is specification engineering, and it is where formal-methods effort has always gone and where its own bugs live. The law leans on is_won, replay and start. If is_won is wrong, the proof is airtight and points at the wrong target.

The proof itself, the file notes, is “written by the AI.” On its own that is not the hole it looks like. A sound checker will not accept a false proof, so a wrong one buys the agent nothing. The weak point that remains is the checker’s own soundness. The site says Bend is “young,” tells you to “expect bugs,” and asks you to report them. A soundness bug in a proof checker is the one failure this model cannot absorb, because it lets a false theorem through and turns “mathematically impossible to merge a bug” into “trust that this particular young checker is sound.” Lean and Rocq earned trust in their kernels over years of adversarial use. A one-second checker that an agent reruns after every edit is making a larger claim with far less mileage behind it.

None of this makes LAWS.bend worthless. An invariant that provably holds for all inputs is stronger than any number of example tests, and having somewhere to write such invariants next to the code an agent edits is a real improvement over a prose AGENTS.md. Use it for the properties you can state formally and are willing to keep correct as the code moves: a balance never goes negative, a state machine never occupies two states at once, a replayed game is never won. Expect the proofs to cover those properties and nothing adjacent to them.

The performance pitch is a separate product from the proof pitch and should be judged separately. C-level speed on one core, the same binary spreading across sixteen cores or thousands of GPU cores, up to a hundred times faster than one core, no locks or kernels to write: the site gives figures, not a reproducible benchmark. Bend works best on the back end, on Linux and macOS, and the site is clear that it is still evolving.

Share

Keep Reading

Latest on the Wire

Full wire →

New signal daily · RSS

Stay in the loop

New writing delivered when it's ready. No schedule, no spam.