Monday, December 12, 2011

Erlang - A survey of the language and its industrial applications

Erlang is a parallel functional programming language. The most unique feature of Erlang is "massive concurrency". Erlang programs often consist of millions of (lightweight) processes, and communication between those processes is done with message passing, not shared memory. This message passing makes locks unnecessary in Erlang, which is generally believed to be scalable.



Erlang for many-core CPUs

The good news with "multi"-core CPUs is that we have abundant computing power. The bad new with "many"-core CPUs is that we do not know how to utilize them. We are used to sequential programming languages that hinder us thinking problems in parallel, and it limits our programs to exploit the parallelism in our data. Erlang (even though it predates multi-core CPUs) is inherently parallel in its language design, and its concept of lightweight process naturally fits multi-core CPUs. In theory, a well written Erlang program should be automatically scalable with multi cores.


Erlang for cloud computing

If Erlang programs naturally scale to tens of CPU cores, why not to millions of CPU cores in a data center? The asynchronous message passing concept can be mapped to network communication, no shared memory between processes is exactly same with the shared-nothing architecture of data center servers. Many cool features of Erlang such as fault tolerance and hot swapping makes Erlang very attractive to be the Language for Clouds. Conceptually yes in theory, but lots of work should be done, as current Erlang implementation is not designed to be run in an inter-machine manner.


Framework vs Language

Maybe we do not know how to utilize many-core CPUs within a machine, but we certainly know how to utilize a cluster of servers. We have decent frameworks for many different workloads, with MapReduce, Pregel, and Dryad, to name a few. Many workloads of data centers are very data-intensive, but with relatively small programs (usually less than thousands of lines of code). It is not sure that we need to invite Erlang for our party.

No comments:

Post a Comment