Four schools of programming
Open any React codebase and you’re touching three programming paradigms at once: JSX is declarative, components are functional, useEffect is imperative. The fourth (actors, isolated entities passing messages) is what React doesn’t have. Multi-agent LLM frameworks are all scrambling to bolt it on. There are four schools of programming, and most of the interesting work happens at their seams.
| School | Unit | Exemplar | Irreducible because | Breaks at | Patched by |
|---|---|---|---|---|---|
| Imperative | Statement | C | The world is mutable; you can't perceive your way out of pressing a button | Concurrency safety | Functional types (Rust borrow checker) |
| Functional | Expression | Haskell | A function has no inside; replace it with a lookup table and nothing changes | Side effects | Monads, then algebraic effects |
| Declarative | Relation, constraint | Prolog, SQL | Goals describe what, not how | Performance and dynamism | Imperative escape hatches (PL/pgSQL, useEffect) |
| Actors | Process, message | Erlang | Identity, parallel cognition, no shared state | Large-grain orchestration | Declarative workflows (Temporal, BPMN) |
Each paradigm’s complement patches exactly the seam it can’t reach alone.
Same program, four worldviews
The same toy program (Alice transfers 100 to Bob) becomes four different things, one per school. Each picture is a claim about what a program is.
Imperative: state mutates in time
“Do this, then this.” Named locations hold values; instructions overwrite them.
Functional: state is a value, function transforms it
No mutation. The old value still exists; a new value is computed from it.
Declarative: relations must hold
No order, no time. The solver finds bindings that satisfy every constraint.
Actors: isolated state, messages cross
No shared memory. Each actor has a mailbox; the program is a conversation.
Imperative says a program is a sequence of state changes. Functional says it is a transformation between values. Declarative says it is a constraint network. Actors say it is a conversation between isolated entities.
The category-theoretic spine
Each paradigm has an algebraic structure underneath. Programming-language theory and category theory converge on the same definitions from different directions (natural breadcrumbs maps the translation in detail).
| Paradigm / Pair | Categorical structure | Category Theory paper |
|---|---|---|
| Imperative | Kleisli over an effect monad | Moggi 1989 |
| Functional | Morphisms in a Cartesian closed category | Lambek & Scott 1986 |
| Declarative | Predicates in a fibration over the base | Kowalski 1974 |
| Actors | Coalgebras for a behavior functor | Rutten 2000 |
| Imp + Func | Kleisli composition (monads, graded monads) | Wadler 1992 |
| Imp + Dec | Hoare logic = predicate fibration over Kleisli | Atkey 2009 |
| Imp + Actors | Coalgebras in Kleisli (effectful processes) | Plotkin & Power 2001 |
| Func + Dec | Dependent types, fibrations over CCCs | Martin-Löf 1984 |
| Func + Actors | Final coalgebras, FRP signals | Elliott & Hudak 1997 |
| Dec + Actors | Bisimulation logic, behavior specs over coalgebras | Milner 1989 |
Six pairs
Four paradigms, choose two: six pairs. Each synthesis has its own history, canonical languages, and open frontier.
| Pair | Languages | Frontier |
|---|---|---|
| Imperative + Functional | 1973 ML · 1990 Haskell (IO monad) · 1996 OCaml · 2004 Scala · 2005 F# · 2010 Rust (linear types) · 2011 Kotlin · 2012 Koka · 2014 Swift · 2022 OCaml 5 (effects) | Algebraic effects replacing monad transformers; effect inference. |
| Imperative + Declarative | 1969 Hoare logic · 1986 Eiffel (DbC) · 2008 Liquid Haskell · 2009 Dafny · 2011 F* · 2021 Lean 4 · 2024 LLM-aided proof (Goedel-Prover, …) | Cost of writing a spec collapsing; verified projects newly economical. |
| Imperative + Actors | 1986 Erlang · 2009 Akka · 2009 Go (CSP-lite) · 2010 Orleans (virtual actors) · 2015 Pony (no data races) · 2019 Temporal · 2023 Restate, Dapr | Durable execution. Actors absorbing the database. |
| Functional + Declarative | 1989 Coq · 1995 Mercury · 2007 Agda · 2007 Idris · 2021 Lean 4 (as a language) · 2021 egg / eqlog · Soufflé Datalog · differentiable Datalog (research) | E-graphs for compilers; neuro-symbolic systems. |
| Functional + Actors | 1986 Erlang · 2011 Elixir · 2017 Akka Typed · 2016 Unison | Unison-style: content-addressed pure functions distributed across actors. Pure-vs-stateful becomes a deployment concern. |
| Declarative + Actors | 1993 Honda session types · 2004 BPMN · ~2007 behavior trees (game AI) · 2019 Temporal workflows · 2023+ LangGraph / CrewAI / AutoGen / Inngest agents · multiparty choreographies | Least settled. Where multi-agent LLM systems are about to live. |
The least-explored pair is where multi-agent systems are about to live.
Lineage of paradigms and their syntheses
Programming-language pointers, oldest at top.
A language for cognitive architecture
Four schools, six bridges, one missing quad. Each pair has a decade of work behind it; the quad has a generation ahead of it.
The quad is the cognitive-architecture problem cosplaying as a programming language. The closest artifacts (React + Hooks, Erlang OTP, Algebraic effects, Behavior trees) each touch three of the four, but none unifies all. Soar and ACT-R hand-wired all four in the eighties; modern LLM stacks arrive the same way, gluing pure inference (functional) to tool calls (imperative) over a memory store (declarative) under a multi-agent runtime (actors). Each generation invents its own DSL (production rules, chunks, graph specs, role contracts), and the same primitives recur under different names. A canonical four-way language will crystallize the way Smalltalk did out of message-passing simulators, or Erlang out of Ericsson’s telecom: extracted from a generation of frameworks all reaching for the same abstractions.
If the pattern holds, we’re about 10 years out from a quad-paradigm language.