← the matrixruntime

Capability — runtime

Concurrency in the language

Doing several things at once is a language feature, not a library.

Threads, processes and channels were always reachable from a library, but the language decides whether concurrency is safe by default. Erlang made processes and mailboxes primitives and values immutable, so races are impossible by construction. Go made channels and goroutines ordinary, and CSP the model behind them. Swift’s structured concurrency made a task group the unit of parallel work, with cancellation that actually cancels.

The recurring lesson: shared mutable memory is the problem, not threads. Every language that has survived the shift has found a way to make sharing either explicit, rare, or checked — and the ones that kept it implicit kept their bug reports too.

The trade-off

  • Message passing costs throughput and adds ceremony; shared memory is faster and a minefield.
  • Concurrency models that are safe by construction are harder to reason about locally — you have to think about the whole system, not the function.

Where it came from

Simula 67 had coroutines; Hoare’s CSP, 1978, gave the theory; Erlang, 1986, made it a language.