foreword

For a long time, the world of Erlang programming had only one book—The Book,1 released in 1993 and revised in 1996. Fanatics can still find it in print, at a price of over $100. A decade or so after its publication, The Book was getting long in the tooth, to say the least. The language had evolved to include several new and powerful programming constructs. Higher-order functions, list comprehensions, and the bit syntax are found everywhere in modern Erlang programs but weren’t described in The Book. But the most notable omission was the Open Telecom Platform (OTP), Erlang’s application development framework, which was first released in 1996. Erlang was rather easy to learn; OTP wasn’t, and early adopters like Martin Logan, who started using Erlang in 1999, pretty much had to learn it the hard way through trial and error.

In the past few years, as an indication that Erlang had become interesting enough to justify it, a number of books was released, and we were told that other books were being written. Erlang and OTP in Action by Martin Logan, Eric Merritt, and Richard Carlsson was the one most talked about. And now it is here.

I started programming Erlang in 1993, when I was designing disaster response systems in Anchorage, Alaska. I bought a precompiled version of Erlang for HP-UX, delivered on a magnetic QIC tape. The language was smaller back then, as were the number of support libraries. I had to start designing my own data-access structures, database managers, protocol parsers, and error-handling frameworks—but I enjoyed myself thoroughly. After all, this was a different time: the web was emerging with the release of the Mosaic browser that same year, and the term open source wouldn’t be used for another five years; if you wanted a programming framework with support for distributed computing and fault tolerance, you had to be prepared to pay dearly, both in time and money. I had scoured the market for such tools and felt well-informed about the commercial alternatives. Erlang was raw and unassuming, with a weird-lo-oking syntax and practically no documentation, but its core concepts felt right in a way that no other tools had.

Three years later, I found myself in Sweden, working for Ericsson and chief designer of the largest Erlang-based project to date. We would build what is known as a telecom-class ATM switch using Erlang, as well as a new framework called the Open Telecom Platform. The name was intended to make decision makers in the company feel warm and fuzzy—Telecom was our core business, Open was the buzzword of the day, and the prevailing wisdom was that if you wanted to build a robust complex product, you had to have a Platform that provided things like redundancy, support for remote configuration, live software upgrade, and real-time tracing and debugging.

Ericsson isn’t in the business of selling development tools, but it has designed programming languages by necessity since the early 1970s. To its credit (but also to its own benefit), Ericsson released Erlang/OTP as open source in 1998. Enthusiasts across the world picked it up and used it, mainly in the telecom field at first, but later also in other areas. We made several attempts in the ’90s to pitch Erlang to web developers, but the challenge facing web developers back then wasn’t how to make redundant, scalable, and highly responsive e-commerce sites; the time for such systems hadn’t yet come, nor had the time when concurrency would be a conversation topic for mainstream programmers. Concurrency was hard—everyone knew that. Concurrency was something to be avoided. Why, then, choose a programming language where you could hardly even write “hello world” without introducing concurrency?

The explosive growth of the web and the emergence of increasingly interactive web applications eventually brought Erlang in from the cold. Unexpected help also came from the laws of physics, which finally made it impossible to keep cranking up the clock frequency on our CPUs to produce faster and faster single-core chips. The message “The free lunch is over” from the hardware vendors, urging developers to start learning how to make their programs scale across many weaker cores rather than one very fast CPU, was wonderful news for Erlang. This meant many clever programmers would at least look at Erlang, to figure out what supposedly made it so special. Many would simply look, and others would borrow concepts and implement them in their favorite language. This was wonderful too, because it meant the market value of knowing and loving Erlang and the principles behind it would increase rapidly.

OTP has by now been proven in several problem domains other than telecom and is highly regarded by those who have learned to master it. Erlang/OTP is an amazingly powerful platform, but it does take time to learn, not least when you try to apply it to a new niche. Interestingly, even programmers who have worked for years in OTP-based projects may be fairly ignorant of how to build an OTP-based system from scratch, because the application programmer is exposed only to a fairly small part of the total framework. This is exactly what you want in a large project, but the entrepreneur in a small startup can’t rely on someone else burning the midnight oil and figuring out the subtleties of OTP release-handling and other dark corners without helpful examples and tutorials.

A good book on OTP has been sorely needed, and it’s with great pleasure that we welcome Erlang and OTP in Action. Martin Logan, Eric Merritt, and Richard Carlsson represent an enormous amount of experience combined, and they have contributed greatly to the Erlang community. I’m convinced that this book will help boost the already impressive trend of Erlang adoption.

Enjoy!

ULF WIGER
CTO, ERLANG SOLUTIONS LTD


1 Robert Virding, Claes Wikstrom, and Mike Williams, Concurrent Programming in Erlang (Prentice Hall, 1993, 1996).