Erlang logo

What is Erlang

Cover

Expand All
Contract All

Table of Contents

1 What is Erlang

1.1  In a nutshell, what is Erlang?

Erlang is a general-purpose programming language and runtime environment. Erlang has built-in support for concurrency, distribution and fault tolerance. Erlang is used in several large telecommunication systems from Ericsson. Erlang is available as open source from http://www.erlang.org.

1.2  What is OTP?

OTP (Open Telecom Platform) is a large collection of libraries for Erlang to do everything from compiling ASN.1 to providing a WWW server. Most projects using "Erlang" are actually using "Erlang/OTP", i.e. the language and the libraries. OTP is also open source.

1.3  What sort of applications is Erlang particularly suitable for?

Distributed, reliable, soft real-time concurrent systems.

  • Telecommunication systems, e.g. controlling a switch or converting protocols.

  • Servers for Internet applications, e.g. a mail transfer agent, an IMAP-4 server, an HTTP server or a WAP Stack.

  • Telecommunication applications, e.g. handling mobility in a mobile network or providing unified messaging.

  • Database applications which require soft realtime behaviour.

Erlang is good at solving these sorts of problems because this is the problem domain it was originally designed for. Stating the above in terms of features:

  • Erlang provides a simple and powerful model for error containment and fault tolerance (supervised processes).

  • Concurrency and message passing are a fundamental to the language. Applications written in Erlang are often composed of hundreds or thousands of lightweight processes. Context switching between Erlang processes is typically one or two orders of magnitude cheaper than switching between threads in a C program.

  • Writing applications which are made of parts which execute on different machines (i.e. distributed applications) is easy. Erlang's distribution mechanisms are transparent: programs need not be aware that they are distributed.

  • The OTP libraries provide support for many common problems in networking and telecommunications systems.

  • The Erlang runtime environment (a virtual machine, much like the Java virtual machine) means that code compiled on one architecture runs anywhere. The runtime system also allows code in a running system to be updated without interrupting the program.

1.4  What sort of problems is Erlang not particularly suitable for?

People use Erlang for all sorts of surprising things, for instance to communicate with X11 at the protocol level, but, there are some common situations where Erlang is not likely to be the language of choice.

The most common class of 'less suitable' problems is characterised by performance being a prime requirement and constant-factors having a large effect on performance. Typical examples are image processing, signal processing, sorting large volumes of data and low-level protocol termination.

Another class of problem is characterised by a wide interface to existing C code. A typical example is implementing operating system device drivers.

Most (all?) large systems developed using Erlang make heavy use of C for low-level code, leaving Erlang to manage the parts which tend to be complex in other languages, like controlling systems spread across several machines and implementing complex protocol logic.

1.5  Who uses Erlang for product development?

The largest user of Erlang is Ericsson. Ericsson use it to write software used in telecommunications systems. Many (dozens) projects have used it, a particularly large one is the extremely scaleable AXD301 ATM switch. AXD301 has several hundred people working on it and the code volume has reached about 850 kloc of Erlang (and 1 Mloc of C/C++).

A few of the other companies using Erlang are

If you want to be listed here, send me some mail: matthias@corelatus.com

1.6  Who uses Erlang for research and teaching?

Many universities use Erlang at various levels. This list is far from exhaustive!

If you want to be listed here, send me some mail: matthias@corelatus.com

1.7  Can I get commercial support for Erlang?

Many consulting companies provide support and training courses, the most well-known one is Erlang-solutions.com .