What is erlang? Why it is best programming language for distributed applications?


Erlang is a general-purpose, concurrent, functional programming language, as well as a garbage-collected runtime system. It was developed by Joe Armstrong, Robert Virding and Mike Williams in 1986,Erlang was first released by Ericsson as a proprietary language, then released in 1998 as an open source language.The Erlang has the following characteristics:

  1. Distributed
  2. Fault-tolerant
  3. Soft real-time
  4. Highly availablity
  5. Hot swapping,it means code can be changed without stopping a system

The Erlang programming language is popular for the following properties:

  1. Immutable data
  2. Pattern matching
  3. Functional programming
  4. Eager evaluation
  5. Single assignment
  6. Dynamic typing.

Why Erlang is best suited for distributed applications:

  • Horizontal scalability (ability to distribute jobs across machine boundaries easily through seamless intra & inter machine communications). The built-in database (Mnesia) is also distributed by nature.
  • Vertical scalability (ability to distribute jobs across processing resources on the same machine): SMP is handled natively.
  • Code Hot-Swapping: the ability to update/upgrade code live during operations
  • Asynchronous: the real world is async so Erlang was built to account for this basic nature. One feature that contributes to this requirement: Erlang's "free" processes (>32000 can run concurrently).
  • Supervision: many different strategies for process supervision with restart strategies, thresholds etc. Helps recover from corner-cases/overloading more easily whilst still maintaining traces of the problems for later trouble-shooting, post-mortem analysis etc.
  • Resource Management: scheduling strategies, resource monitoring etc. Note that the default process scheduler operates with O(1) scaling.
  • Live debugging: the ability to "log" into live nodes at will helps trouble-shooting activities. Debugging can be undertaken live with full access to any process' running state. Also the built-in error reporting tools are very useful (but sometimes somewhat awkward to use).
  • Erlang are used by Facebook,WhatsApp,T-Mobile,Motorola,Ericsson,Yahoo and Amazon.

Popular Applications written in Erlang are:

  1. Ejabberd
  2. Yaws
  3. CouchDB
  4. MochiWeb
  5. RabbitMQ


0 Comment(s)

Leave a comment

Back to Top