Blog

2026-04-12 · engineering / dpw

Why we replaced React with algebra

Why we replaced React with algebra

Code Daimyo — April 2026

React was the right answer to a real question: how do you build interactive UI without writing imperative DOM code? Its model — UI is a function of state — is genuinely good. We are not here to argue with it.

We are here to argue that the runtime that grew around that model — hooks, dependency arrays, effects, the rules-of-hooks linter, suspense boundaries, server components, the second renderer for concurrent mode — has accumulated more accidental complexity than the original idea was worth. Most production React code is now spent managing the runtime, not describing the UI.

So when we built DPW, we replaced React with an algebra. Every component is State × Event → State. That's it. No hooks. No effects. No lifecycle. No dependency arrays. No re-renders to reason about. The compiler reads the algebra and produces the smallest update plan that obeys the step relation.

What we got back is significant:

  1. Time-travel for free. Every event is a value; every state is a value; the whole timeline is a list. Undo is drop(-1). Redo is take(+1). No special infrastructure.
  2. Determinism. Same events, same state. Always. Across runs, across machines, across years.
  3. AI suggestions that compile. The AI co-pilot cannot suggest a useEffect that fires twice, because there is no useEffect. It cannot leak state across renders, because there are no renders.
  4. Refactors as rewrites. Moving a component, splitting a state, combining two events — all of these are algebraic rewrites the IDE applies for you, with the proof that meaning is preserved.

What we gave up is real too. The React ecosystem is enormous and we cannot reuse most of it directly. The learning curve is non-trivial. Some patterns that are trivial in hooks (cross-component imperative effects, ad-hoc subscriptions to external mutable state) require more thought.

We think the trade is good. We would not have shipped a 70,000-line IDE inside the React runtime as it exists today.

Code Daimyo