Summary
Joe Armstrong, creator of the Erlang language, was recently interviewed in Dr. Dobb's Journal. In the brief interview, he explains the basic philosophy behind Erlang, and points to a few applications where Erlang's unique features proved useful.
Advertisement
Erlang, a concurrent, functional language created by Joe Armstrong in the late 1980s, is enjoying renewed interest, thanks in part to its unique approach to supporting concurrent development. Armstrong, who just completed a new book on Erlang, gave a brief interview to Dr. Dobb's Journal about the language and its underlying philosophy, Programming Erlang, noting that:
Erlang is built on the ideas of:
Share nothing. (Process cannot share data in any way. Actually, this is not 100% true; there are some small exceptions.)
Pure message passing. (Copy all data you need in the messages, no dangling pointers.)
Crash detection and recovery. (Things will crash, so the best thing to do is let them crash and recover afterwards.)
Erlang processes are very lightweight (lighter than threads) and the Erlang system supports hundreds of thousands of processes... It was designed to build highly fault-tolerant systems. Ericsson has managed to achieve nine 9's reliability [99.9999999%] using Erlang in a product called the AXD301.
The advent of multicore CPUs is one of the main reasons behind new-found interest in Erlang. Armstrong notes that Erlang's shared-nothing philosophy is ideally suited to programming for multicore CPUs:
The Erlang philosophy was always to build system with lots of cheap processors and allow them to fail. We don't prevent failure; we live with it and recover when failures occur. That's what Erlang was designed to do. That's why there is "no shared state". Shared state and failure are ill-suited bed-fellows.
Today multi-cores are really like "distributed system on a chip" with very high-speed message passing. Since we have share-nothing and concurrency, Erlang programs map beautifully onto multi-cores. Ericsson is shipping products on dual-cores that run virtually twice as fast as the uni-cores with only tiny changes to the code.
What do you think of Erlang and its support for shared-nothing concurrency?
> What do you think of Erlang and its support for shared-nothing concurrency? I just love it :-). The shared nothing approach is sure not a silver bullet for all concurrency related problems (e.g. race conditions) but I think it's much easier to handle "coarse grained" parallelism with it than with other techniques that use shared state.
BTW: this idea is picked up by other languages : termite (scheme based) and Scala's actors.