Negative space programming
Source: Negative Space Programming. Define a program by what it must never do, fail the instant it does. Roots in Power of 10 (two assertions per function) and Tiger Style (Joran Greef: think like a hacker). Where negative space lives, weakest to strongest:
- Runtime assertions in bodies (what the post describes).
- Contracts (
requires/ensures) on signatures, visible at spec altitude. - Types: make illegal states unrepresentable. Compile-time negative space; best feedback loop for agents.
- Absent capabilities: no
Networkparameter means no network call. Negative space by construction, free to write. - Explicit
neverclauses (proposed addition): module/process-level statements of what must never be true.never ledger.balance < 0,never this process sends email. Runtime-checked, attacked by the simulator, proven when possible; the verification line says which. AI-first reframe: humans are bad at specifying complete behavior and good at saying what must not happen. So theneverset is the natural human-facing surface. Initial proposal had humans writing it; Robert corrected: humans write nothing. Revised: humans speak it, agents write it, humans read and approve it. Design consequences:
neverclauses must render as plain sentences (“a refund never exceeds its charge”) since their purpose is to be read by someone not reading code.intentandensuresare agent-authored too, read for context, not judged. Theneverset is the judged part.- “Think like a hacker” becomes mechanical: deterministic simulator + property-based generation spend a million runs trying to violate every reachable
never. - Per the laws, every precondition needs a rejection test, so negative-space testing is required.
Costs:
neverclauses can contradict each other or the positive spec (compiler must detect); over-constraining blocks valid solutions (human decision to relax); runtime cost in hot paths (prove-and-remove path earns its keep).