Languages / Language

1986

Erlang

A language built so telephone calls never drop.

Erlang was born inside Ericsson’s Computer Science Laboratory in 1986, the work of Joe Armstrong, Robert Virding and Mike Williams. The brief was unglamorous and enormous: write the software for telephone exchanges that must never, ever stop — handling hundreds of thousands of calls at once, upgrading themselves while running, and shrugging off hardware faults.

Armstrong’s first prototypes were written in Prolog, which is why Erlang still reads a little like it — clauses, pattern matching, the trailing full stop.

Concurrency-oriented programming

Erlang’s answer to reliability is a radical stance on concurrency, closely related to The Actor Model:

  • Processes are cheap — millions of them, scheduled by the runtime, not the OS.
  • Nothing is shared. Processes communicate only by sending messages.
  • “Let it crash.” Don’t defend against every error; let a process die and let a supervisor restart it into a known-good state.
  • Hot code swapping — replace code in a running system without stopping it.

That last two ideas together get you the legendary “nine nines” — 99.9999999% uptime measured on the AXD301 switch. For someone drawn to feedback and control, a supervision tree is a control system: detect deviation, restart toward a stable state.

Where it runs

Erlang compiles to the BEAM virtual machine (itself written in C) and ships with OTP, a framework of battle-tested patterns. WhatsApp famously served hundreds of millions of users on a tiny Erlang team. Its ideas spread outward into Elixir, and echoed in Akka and Go’s goroutines. Open-sourced in 1998.

The people

In a small, deliberately sheltered lab at Ericsson in the mid-1980s, three people were given room to chase an unreasonable goal with no product deadline hanging over them. That freedom is half the story of how something as strange as Erlang came to be built inside a telecoms giant.

  • Joe Armstrong was Erlang’s heart and conscience. Tasked with finding better ways to write telephone software, he became obsessed with a single question — how do you build systems that never stop? — and his answers (“let it crash”, supervision, share nothing) became the language’s soul. He was also a warm, gifted teacher; his book and talks converted a generation. He died in 2019.
  • Robert Virding brought deep functional-programming knowledge and did much of the early implementation; he later wrote a Lisp for the same VM.
  • Mike Williams brought hard-nosed real-time systems experience from telecom and kept the project grounded in what switches actually needed.
  • Bjarne Däcker ran Ericsson’s Computer Science Lab and, crucially, gave the three of them the room and the cover to invent something strange.

What made them different: they treated failure as the normal case, not the exception. Most languages are designed assuming the code is correct; Erlang was designed assuming everything will eventually break, and asking how the system survives anyway.

Landmark open-source projects

  • Erlang/OTP — the language and its standard framework.
  • RabbitMQ — the message broker that runs everywhere.
  • ejabberd — massive-scale messaging. Elixir — Erlang’s VM, a friendlier face.

Try it

%%% Spawn a process, hand it a number, get its square back by message.
main(_) ->
    Pid = spawn(fun() -> receive {From, X} -> From ! {ok, X * X} end end),
    Pid ! {self(), 9},
    receive {ok, N} -> io:format("a process computed ~w~n", [N]) end.

Sources

See also: Prolog, The Actor Model, C.