Site icon Tapscape

Why It Is Worth It to Learn Erlang

Why It Is Worth It to Learn Erlang

There are programming languages ​​that everybody knows about and there are some much less popular. You’ve probably heard about the well-known ones – Java, C, Python, or Ruby. However, today we are not going to talk about them.

Let’s talk about a language that is rarely used in application development and not so many people know about it. This language is Erlang.

Why Erlang?

Erlang is a niche language. It is difficult to write websites or mobile applications in it. It was created in the 1980s to write software switches for telecommunication networks.

Erlang is suitable for organizing processes with small amounts of data, but at high speed with a large number of threads. The language had great potential, and therefore has expanded over the years and found new areas of application. Erlang’s concept allowed it to be used for messengers, video chats, and various services.

Today it is also used to write video streaming and chat servers. Erlang is ideal where there is no complex computation or work with large amounts of data, but there are many clients and strict requirements for fault tolerance.

Companies that use Erlang

Amazon used Erlang for its SimpleDB storage service, and Yahoo! for the bookmarking service, where over 150 million bookmarks have been saved. Facebook once used it to create a chat service that processes more than 100 million active users. One of the implementations of XMPP – eJabberd is also one of the most famous products written in Erlang.

Erlang gives the programmer a certain framework, like any other language. But with Erlang it is impossible to miserably fail. For example, when there is multithreading in Java or .Net, you need to be very careful, and in Erlang there are no variables, so there is no way to make mistakes.

Easy multithreaded programming

Multithreaded programming has always been difficult. In C or Java, writing a thread is almost like writing a separate program: you needs to allocate memory, start, monitor and terminate correctly. At the same time, threads cannot be called “lightweight”: by default, one thread in Java will eat up to three hundred kilobytes of memory only at the start.

Erlang solved this problem: one thread takes only four kilobytes of memory for it to work. At the same time, hundreds of thousands of threads can be launched on a regular laptop.

The thing is that Erlang threads are controlled not by the operating system, but by Erlang itself, its virtual machine (BEAM). For the operating system, it looks as if there is only one stream, but there can be many of them inside BEAM. Due to the fact that the operating system does not interfere with the thread control, the speed of working with them is very high.

A nice bonus to this is that Erlang is able to evenly occupy all processor cores.

The doors that Erlang can open

With the development of messengers such as WhatsApp, there are noticeably more Erlang programmers. The majority of IT agencies that use Erlang for production are located in Sweden, the Netherlands, the USA and the UK. However, even in these countries there are only a couple of institutions that teach Erlang. The majority of programmers master it on their own.

Erlang developers are rare and highly-qualified specialists. That is why all over the world many large companies such as Amazon, WhatsApp, Twitter, Ericsonn and more are prepared to pay quite good money to such specialists. Therefore, learning this functional language is certainly worth it.