Erlang – A concurrent Programming Language [Overview]
What is Erlang?
Erlang is a unit of measurement of traffic density in a telecommunication system. The Erlang describes the total traffic volume of one hour, or 3600 seconds. Alright had enough of Erlang, let’s talk about Erlang programming language
What is Erlang Language?
Erlang is a functional programming language and run-time environment. Erlang has built-in support for concurrency, distribution and fault tolerance. Now let me know it in simple language ! Concurrency means executing different processes at the same time, example of it can be retrieving data from different table at the same time Distribution and fault tolerance Suppose if one process terminates abnormally, a signal is sent to all linked processes, which will terminate abnormally or will receive the message in the mailbox
Asynchronous Message Passing
Erlang supports asynchronous message passing. So let’s take an example here to understand it,
Consider 10 rows and 10 columns-
If I need to know, for each element with a value greater than 100, normal logic would be to run two for loop’s like one for ith row and another for jth column and compare, whereas in Erlang it’s simple we just set a process which will have a buffer wherein it will store values of all elements whose value is greater than 100, it will be done through message passing. And all the elements will having value greater than 100 will reply to it through message and everything happens asynchronously and concurrently. Consider another example where in you have to match two sets of tags against each other where in one set is of 1000 keywords and another set is million keywords, in this case also if it we would have applied two for loops it would have taken immense amount of time and certainly not a feasible option, whereas in erlang you get to know the comparison result in seconds. Another best usage of asynchronous message passing is for chatting purpose used by facebook at the back end. Also asynchronous message passing is widely used in telecommunication industry. Actually Erlang was born to solve problem in telecommunication industry of message passing, but later developers started finding the need of erlang in web applications for the same purpose.
How is Erlang?
Erlang can be installed with simple command like for Linux and Mac users,
>> sudo apt-get install erlang
At the start it may be little hard to deal with those curly braces, but after some practice you fall on with it.
Who uses Erlang?
Yes, Erlang is used at the production level by giant companies like-
–> Rabbit MQ : For enterprise messaging
–> Facebook : For facebook chat at the back-end
–> Cellpoint : For location based mobile services
Which are the sites built using Erlang?