Two decades ago, I worked for Swedish telecom giant Ericsson, grinding out software specifications, user manuals and other documentation. I was part of a small group in Texas that was supposed to help adapt Swedish-made computers and software to the American banking market.
The coders handled the programming, so I didn’t have to know much code, just how to describe and illustrate the features they were developing. I knew a little assembler, BASIC, and C. But often, the coders worked with what was then a weird-looking proprietary language: Ericcson Language, or Erlang.
For various marketplace reasons, the head Swede suddenly showed up one day, shut our group down, and sent us packing. That was the last time I saw or gave any thought to Erlang.
Learn You Some Erlang for Great Good!, recently published by No Starch Press, is a fun yet serious “beginner’s guide” to Erlang. The proprietary language became an open-source language in 1998.
According to the official Erlang website: “Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang’s runtime system has built-in support for concurrency, distribution and fault tolerance.”
Erlang today has a cadre of fans and serious practitioners who use it to create a variety of applications. (CouchDB, for example, is written in Erlang.) And numerous big-name companies use Erlang in a variety of ways.
It is a functional programming language that also supports concurrent programming, and it has a reputation for being difficult to learn, according to Joe Armstrong, who created the first version of Erlang in 1986. (Indeed, the print version of Fred Hébert’s thick new “beginner’s guide” spans 30 chapters and 595 pages, from “Hello, world” all the way to testing and distribution.)
“One of the biggest barriers to learning Erlang,” Armstrong writes in the book’s foreword, “is not so much that the ideas involved are intrinsically difficult but that they are very different from the ideas in most of the other languages that you will have encountered. To learn Erlang, you have to temporarily unlearn what you have learned in other programming languages. Variables do not vary. You’re not supposed to program defensively. Processes are really, really cheap, and you can have thousands of them, or even millions if you feel like it. Oh, and then there is the strange syntax. Erlang doesn’t look like Java; there are no methods or classes and no objects. And wait a minute…even the equals sign doesn’t mean ‘equals’–it means ‘match this pattern.’”
Fortunately, Fred Hébert’s new book is the perfect antidote to Erlang’s tough learning curve. Hébert, the “Erlang User of the Year 2012,” delivers clear writing, good illustrations, humor, and plenty of short code samples in his well-structured chapters. His long experience as an Erlang programmer and instructor definitely shines through.
He concedes that, while Erlang “does some things very well,” it definitely is “no silver bullet and will be particularly bad at things like image and signal processing, operating system device drivers, and other functions.” However: “It will shine at things like large software for server use (for example, queue middleware, web servers, real-time bidding and distributed database implementations), doing some lifting coupled with other languages, higher-level protocol implementation, and so on.”
At the same time, he urges coders to “not necessarily limit yourself to server software with Erlang. People have done unexpected and surprising things with it.”
— Si Dunn