Erlang Programming - A Concurrent Approach to Software Development
- ISBN: 978-0-596-51818
- Publisher: O'Reilly Media
- Publication Date: May 2009
- Pages: 496
- Price: £38.50
It's important to learn a new programming language every so often. Even if you never expect to use it, learning a language that is sufficiently different from one you already know gives you a fresh perspective on programming.
I hadn't learned a new language for a while, and decided to take a look at Erlang, primarily because I had never used a language that had such a strong emphasis on fault-tolerant concurrent and distributed systems. Erlang was originally created at Ericsson as a language suitable for creating telecommunications systems, but is now used much more widely, including in well known networked applications such as CouchDB, Facebook chat, GitHub, and many others.
This book is an introduction to Erlang aimed at programmers who are already familiar with another language such as Java or C. Erlang is a functional programming language, but the book makes no assumptions that the reader has used a functional language before. It introduces the language from the ground up, covering the core language and its distinctive features, as well as going into some depth on more advanced topics. It covers a lot of ground, but in general is clearly written and proceeds at a suitable pace.
The book begins by explaining the benefits of Erlang and how it differs from other languages, as well as giving a little bit of history and some case studies of real world applications implemented in Erlang. This introduction does a good job of convincing the casual reader (such as myself) that the language is worth exploring further. Pleasingly, it doesn't read too much like a sales pitch --- the authors are also keen to explain when you *shouldn't* use Erlang.
The book gives a thorough introduction (perhaps too thorough for more experienced programmers) to everything you'd need to know about the core language, and practical details such as how to interact with the language's shell. It introduces the basics, starting with values of various types, atoms and lists, and built in functions (BIFs, in the Erlang terminology) over them. But what's really interesting about Erlang is its focus on robust communicating concurrent and distributed systems. As you'd expect, the book gets into this as early as possible, as soon as the basic types and control structures have been introduced. Several chapters are devoted to concurrent processes, and detailed (but not overwhelming) examples of common programming patterns.
For the more serious Erlang developer, the book goes into some depth on more advanced topics which are necessary for practical software development, such as GUI programming, databases, and socket programming.
Summary: The book sets out to convince the reader of the value of Erlang in implementing robust concurrent and distributed systems, and successfully achieves that aim. I don't think it's a language I will end up using a lot myself, but reading this book has given me a fresh perspective on concurrent programming in particular.