Preface
Erlang has long been a mysterious dark corner of the programming universe, visited mostly by developers who need extreme reliability or scalability and people who want to stretch their brains.
Developed at Ericsson to serve on telephone switching equipment, it seemed like a strangely special-purpose language until recently, when our computer and network architectures came to look a lot more like massively parallel telephone-switching equipment. Thanks to the rise of NoSQL data stores CouchDB and Riak, you may already be using Erlang without realizing it, and Erlang is moving out into many more fields.
Exploring Erlang, if you come from pretty much any background other than functional programming, will require you to clear your mind of many techniques used in other programming languages. Forget classes, forget variables that change values—even forget the conventions of variable assignment.
Instead, you’re going to have to think about pattern matching, message passing, and establishing pathways for data rather than telling it where to go. Erlang programming can feel like making a key whose teeth set the tumblers on a lock just right for the key to pass, or playing pachinko and watching the balls fall through a maze.
Sound strange? It is—but also enjoyable, powerful, and fun.
My first explorations of Erlang confused me and excited me at the same time. I’d had some experience with what I’d called “invariant variables,” variables that can be bound to a value only once, in XSLT. That ...