Skip to main content

Erlang

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/erlang

In short

Erlang is a functional language created at Ericsson for telecom switches, designed for massive concurrency, fault tolerance and systems that must keep running.

What is Erlang?

Erlang is a functional programming language created at Ericsson in 1986 by Joe Armstrong, Robert Virding and Mike Williams to run telephone switches, which must handle huge numbers of simultaneous calls and stay up for years. It was released as open source in 1998. Erlang is almost always used together with OTP (Open Telecom Platform), a set of libraries and design principles for building reliable servers, so the whole package is usually called Erlang/OTP.

Erlang programs are made of many lightweight processes running on the BEAM virtual machine. These processes are far cheaper than operating system threads, share no memory and communicate only by sending messages to each other. Instead of trying to prevent every error, Erlang follows a "let it crash" philosophy: supervisor processes watch workers and restart them in a known good state when they fail. The runtime also supports hot code swapping, which replaces code in a running system without stopping it.

Erlang is used for telecom systems, messaging and chat backends, message brokers, databases and other services that need high availability. Its design resembles a well-run call center: many independent operators each handle their own call, and if one gets stuck, a supervisor replaces them without the rest of the floor noticing. Data is immutable and each variable can be bound only once, which removes a whole class of concurrency bugs.

Erlang is closely linked to Elixir, which runs on the same BEAM virtual machine and uses the same OTP libraries, and the two can call each other's code directly. Erlang has its own compact, Prolog-inspired syntax, where statements end with periods and variables start with capital letters, while Elixir offers a Ruby-like syntax, macros and newer tooling. Erlang's lightweight processes are also different from operating system processes: the virtual machine manages them entirely, and a single node can run millions of them.

Key takeaways

  • Erlang was built at Ericsson for telecom systems that must run continuously.
  • Lightweight processes communicate by message passing and share no memory.
  • OTP supervisors restart failed processes, following the "let it crash" philosophy.
  • Hot code swapping allows updates without stopping a running system.
  • Elixir runs on the same BEAM virtual machine and can use Erlang libraries directly.

Example

Spawning a process and sending messages in Erlangerlang
-module(greeter).
-export([start/0]).

% Spawn a lightweight process that waits for messages
start() ->
    Pid = spawn(fun loop/0),
    Pid ! {hello, "Ada"},
    Pid ! stop.

loop() ->
    receive
        {hello, Name} -> io:format("Hello, ~s!~n", [Name]), loop();
        stop -> ok
    end.

Readers ask

What is the difference between Erlang and Elixir?

Both run on the BEAM virtual machine and share OTP, so they have the same concurrency and fault-tolerance model. Erlang is the original language with its own syntax, while Elixir is a newer language with Ruby-inspired syntax, macros and modern tooling.

What does "let it crash" mean?

Instead of adding defensive code for every possible error, Erlang developers let a failing process crash and rely on a supervisor to restart it cleanly. Because processes are isolated, one crash doesn't corrupt the rest of the system.

Is Erlang still used?

Yes. Erlang/OTP gets a major release every year and runs telecom equipment, messaging platforms, message brokers and other systems where uptime matters most.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings