Erlang (programming language)

WorldBrand briefing

AI supplement

Original synthesis to sit alongside the encyclopedia article below. Not part of Wikipedia; verify facts on Wikipedia when precision matters.

Erlang is a general-purpose, concurrent functional programming language and garbage-collected runtime system, originally developed for building high-availability, distributed telecom systems at Ericsson.

Key moments

  • 1986Developed by Joe Armstrong and team at Ericsson's CS-Lab
  • 1987First official release as proprietary telecom software
  • 1998Released as open-source software

Core Design and Unique Features

Erlang is built around lightweight virtual machine processes (not OS threads) that use asynchronous message passing for communication, eliminating shared memory locks. It uses a 'let it crash' fault tolerance philosophy paired with supervision trees to automatically recover from failures, plus built-in support for distributed computing and hot code swapping that allows updates without system downtime.

Adoption and Use Cases

Originally designed for telecom switches, Erlang gained widespread use in high-concurrency, high-reliability systems: notable examples include WhatsApp's backend (handling millions of concurrent connections), RabbitMQ message queues, Riak distributed databases, and real-time financial trading platforms. Modern use cases also span IoT, gaming servers, and live communication tools.

Cultural and Technical Legacy

Erlang inspired several modern languages and frameworks, most notably Elixir which runs on the same BEAM virtual machine. Its concurrency model has influenced cloud-native and distributed system design patterns, and the Erlang/OTP (Open Telecom Platform) ecosystem provides standardized libraries and design patterns that have become a gold standard for building resilient distributed systems.

Erlang is a general-purpose, concurrent, functional high-level programming language, and a garbage-collected runtime system. The term Erlang is used interchangeably with Erlang/OTP, or Open Telecom Platform (OTP), which consists of the Erlang runtime system, several ready-to-use components (OTP) mainly written in Erlang, and a set of design principles for Erlang programs.[4]

The Erlang runtime system is designed for systems with these traits:

The Erlang programming language has data, pattern matching, and functional programming.[6] The sequential subset of the Erlang language supports eager evaluation, single assignment, and dynamic typing.

A normal Erlang application is built out of hundreds of small Erlang processes.

It was originally proprietary software within Ericsson, developed by Joe Armstrong, Robert Virding, and Mike Williams in 1986,[7] but was released as free and open-source software in 1998.[8][9] Erlang/OTP is supported and maintained by the Open Telecom Platform (OTP) product unit at Ericsson.

  • Distributed
  • Fault-tolerant
  • Soft real-time
  • Highly available, non-stop applications
  • Hot swapping, where code can be changed without stopping a system.[5]

History

The name Erlang, attributed to Bjarne Däcker, has been presumed by those working on the telephony switches (for whom the language was designed) to be a reference to Danish mathematician and engineer Agner Krarup Erlang and a syllabic abbreviation of "Ericsson Language".[7][10][11] Erlang was designed with the aim of improving the development of telephony applications.[12] The initial version of Erlang was implemented in Prolog and was influenced by the programming language PLEX used in earlier Ericsson exchanges. By 1988 Erlang had proven that it was suitable for prototyping telephone exchanges, but the Prolog interpreter was far too slow. One group within Ericsson estimated that it would need to be 40 times faster to be suitable for production use. In 1992, work began on the BEAM virtual machine (VM), which compiles Erlang to C using a mix of natively compiled code and threaded code to strike a balance between performance and disk space.[13] According to co-inventor Joe Armstrong, the language went from laboratory product to real applications following the collapse of the next-generation AXE telephone exchange named AXE-N in 1995. As a result, Erlang was chosen for the next Asynchronous Transfer Mode (ATM) exchange AXD.[7]

In February 1998, Ericsson Radio Systems banned the in-house use of Erlang for new products, citing a preference for non-proprietary languages.[14] The ban caused Armstrong and others to make plans to leave Ericsson. In March 1998 Ericsson announced the AXD301 switch,[7] containing over a million lines of Erlang and reported to achieve a high availability of nine "9"s.[15] In December 1998, the implementation of Erlang was open-sourced and most of the Erlang team resigned to form a new company, Bluetail AB.[7] Ericsson eventually relaxed the ban and re-hired Armstrong in 2004.[16]

In 2006, native symmetric multiprocessing support was added to the runtime system and VM.[7]

Processes

Erlang applications are built of very lightweight Erlang processes in the Erlang runtime system. The Erlang runtime system provides strict process isolation between Erlang processes (this includes data and garbage collection, separated individually by each Erlang process) and transparent communication between processes (see Location transparency) on different Erlang nodes (on different hosts).

Joe Armstrong, co-inventor of Erlang, summarized the principles of processes in his PhD thesis:[17]

Joe Armstrong remarked in an interview with Rackspace in 2013: "If Java is 'write once, run anywhere', then Erlang is 'write once, run forever'."[18]

  • Everything is a process.
  • Processes are strongly isolated.
  • Process creation and destruction is a lightweight operation.
  • Message passing is the only way for processes to interact.
  • Processes have unique names.
  • If you know the name of a process you can send it a message.
  • Processes share no resources.
  • Error handling is non-local.
  • Processes do what they are supposed to do or fail.

Usage

In 2014, Ericsson reported Erlang was being used in its support nodes, and in GPRS, 3G and LTE mobile networks worldwide and also by Nortel and Deutsche Telekom.[19]

Erlang is used in RabbitMQ. As Tim Bray, director of Web Technologies at Sun Microsystems, expressed in his keynote at O'Reilly Open Source Convention (OSCON) in July 2008: "If somebody came to me and wanted to pay me a lot of money to build a large scale message handling system that really had to be up all the time, could never afford to go down for years at a time, I would unhesitatingly choose Erlang to build it in."

Erlang is the programming language used to code WhatsApp.[20]

It is also the language of choice for Ejabberd – an XMPP messaging server.

Elixir is a programming language that compiles into BEAM byte code (via Erlang Abstract Format).[21]

Since being released as open source, Erlang has been spreading beyond telecoms, establishing itself in other vertical markets such as FinTech, gaming, healthcare, automotive, Internet of Things and blockchain. Apart from WhatsApp, there are other companies listed as Erlang's success stories, including Vocalink (a MasterCard company), Goldman Sachs, Nintendo, AdRoll, Grindr, BT Mobile, Samsung, OpenX, and SITA.[22][23]

Functional programming examples

Factorial

A factorial algorithm implemented in Erlang: is a preprocessor macro for the current module). If there is a new version of the counter module in memory, then its codeswitch/1 function will be called. The practice of having a specific entry-point into a new version allows the programmer to transform state to what is needed in the newer version. In the example, the state is kept as an integer.

In practice, systems are built up using design principles from the Open Telecom Platform, which leads to more code upgradable designs. Successful hot code loading is exacting. Code must be written with care to make use of Erlang's facilities.

Distribution

In 1998, Ericsson released Erlang as free and open-source software to ensure its independence from a single vendor and to increase awareness of the language. Erlang, together with libraries and the real-time distributed database Mnesia, forms the OTP collection of libraries. Ericsson and a few other companies support Erlang commercially.

Since the open source release, Erlang has been used by several firms worldwide, including Nortel and Deutsche Telekom.[36] Although Erlang was designed to fill a niche and has remained an obscure language for most of its existence, its popularity is growing due to demand for concurrent services.[37][38] Erlang has found some use in fielding massively multiplayer online role-playing game (MMORPG) servers.[39]

See also

  • Elixir – a functional, concurrent, general-purpose programming language that runs on BEAM
  • Luerl - Lua on the BEAM, designed and implemented by one of the creators of Erlang.
  • Lisp Flavored Erlang (LFE) – a Lisp-based programming language that runs on BEAM
  • Mix (build tool)
  • Phoenix (web framework)
  • Gleam (programming language) – a general-purpose, concurrent, functional high-level programming language that compiles to Erlang

Further reading

References

  1. N. D. C. Conferences. Joe Armstrong - Functional Programming the Long Road to Enlightenment: a Historical and Personal Narrative Vimeo, 4 June 2014^
  2. Clojure: Lisp meets Java, with a side of Erlang - O'Reilly Radar radar.oreilly.com^
  3. Influences - The Rust Reference The Rust Reference, retrieved 2023-04-18^
  4. Erlang – Introduction erlang.org, retrieved 6 February 2017^
  5. Joe Armstrong, Bjarne Däcker, Thomas Lindgren, Håkan Millroth. Open-source Erlang – White Paper retrieved 31 July 2011^
  6. Hitchhiker’s Tour of the BEAM – Robert Virding http://www.erlang-factory.com/upload/presentations/708/HitchhikersTouroftheBEAM.pdf^
  7. Joe Armstrong. History of Erlang HOPL III: Proceedings of the third ACM SIGPLAN conference on History of programming languages, 2007^
  8. How tech giants spread open source programming love - CIO.com 8 January 2016, retrieved 5 September 2016^
  9. Erlang/OTP Released as Open Source, 1998-12-08^
  10. Erlang, the mathematician? February 1999^
  11. Free Online Dictionary of Computing: Erlang^
  12. History of Erlang Erlang.org^
  13. Joe Armstrong. Proceedings of the second ACM SIGPLAN international conference on Functional programming ACM SIGPLAN Notices, August 1997^
  14. Bjarne Däcker. Concurrent Functional Programming for Telecommunications: A Case Study of Technology Introduction Royal Institute of Technology, October 2000^
  15. Concurrency Oriented Programming in Erlang 9 November 2002^
  16. question about Erlang's future 6 July 2010^
  17. Joe Armstrong. Making reliable distributed systems in the presence of software errors The Royal Institute of Technology, 20 November 2003^
  18. Duncan McGreggor. Rackspace takes a look at the Erlang programming language for distributed computing Rackspace Studios, SFO, 26 March 2013, retrieved 24 April 2019^
  19. Ericsson Ericsson.com, 4 December 2014, retrieved 7 April 2018^
  20. Inside Erlang, The Rare Programming Language Behind WhatsApp's Success fastcompany.com, 21 February 2014, retrieved 12 November 2019^
  21. Erlang/Elixir Syntax: A Crash Course elixir-lang.github.com, retrieved 2022-10-10^
  22. Which companies are using Erlang, and why? #MyTopdogStatus erlang-solutions.com, 11 September 2019, retrieved 15 March 2020^
  23. Which new companies are using Erlang and Elixir? #MyTopdogStatus erlang-solutions.com, 2 March 2020, retrieved 2020-06-24^
  24. Erlang – List Comprehensions erlang.org^
  25. String and Character Literals retrieved 2 May 2015^
  26. Mathias Verraes. Let It Crash Mathias Verraes' Blog, 2014-12-09, retrieved 2021-02-10^
  27. Reactive Design Patterns — www.reactivedesignpatterns.com, retrieved 2021-02-10^
  28. Joe Armstrong. Erlang Communications of the ACM, September 2010^
  29. Erlang Efficiency Guide – Processes^
  30. Ulf Wiger. Stress-testing erlang comp.lang.functional.misc, 14 November 2005, retrieved 25 August 2006^
  31. Lock-free message queue retrieved 23 December 2013^
  32. Joe Armstrong. Erlang robustness retrieved 15 July 2010^
  33. Erlang Supervision principles retrieved 15 July 2010^
  34. Erlang – Compilation and Code Loading erlang.org, retrieved 2017-12-21^
  35. High Performance Erlang retrieved 26 March 2011^
  36. Who uses Erlang for product development? Frequently asked questions about Erlang, retrieved 16 July 2007^
  37. Programming Erlang retrieved 13 December 2008^
  38. Erlang, the next Java retrieved 8 October 2008^
  39. Gavin Clarke. Battlestar Galactica vets needed for online roleplay Music and Media, The Reg, 5 February 2011, retrieved 8 February 2011^