Programming Erlang: Software for a Concurrent World by Joe Armstrong
Publisher: Pragmatic Bookshelf
With the rise of multi-core CPUs, concurrency becomes an ever increasing concern. Until now, mainstream computing has tried to solve parallelism with multithreading. Is multithreading really the answer or a problem itself?
A few weeks ago I visited a talk on multithreading. It was a great talk and it demonstrated the thread support in the upcoming C0X C++ standard. What deeply worried me, was the questions and discussions amongst the audience. The audience consisted of several world-class C++ experts, including members of the standardization committee. More than once, not even they could tell the correctness of the presented examples in the presence of more than two threads! When the experts fail, what can we expect from the industry average? Threads are so hard to do right that I believe we're in a need of a completely different paradigm and that languages like Erlang are the answer.
The most defining property of Erlang is that concurrency is built into the core language. Erlang models concurrency as pure message passing between processes. These Erlang processes are extremely lightweight and cheap to create (you can use 100 000 of Erlang processes in a program). Not only does this model allow Erlang programs to take advantage of multi-core CPUs; it also makes the programs inherently scalable as the processes may be distributed on different physical machines.
Erlang was originally developed for Ericsson's telecom applications. These are applications that need high reliability and fault-tolerance. And Erlang provides the tools to achieve it by its remote error handling mechanisms and this book is actually worth reading for the discussions of error handling alone, whether you'll ever program in Erlang or not. Besides its clean concurrency and error-handling models, Erlang may be described as a high-level functional language with pattern-matching as its core. Joe Armstrong covers all of it and explains each concept in a remarkable clear way together with a lot of practical examples. Joe loves programming in Erlang and his enthusiasm really shines through; Programming Erlang is a true joy to read and a perfect introduction to the future of programming.
Reviewed June 2008