Introduction

 

Erlang is a programming language where processes are a fundamental concept. But what is a process? When you run several programs at once on your computer, such as a word processor and a web browser, each one of those programs runs inside its own process. If your word processor should crash, your browser generally stays running as if nothing happened—or vice versa, a crashing web browser will not cause you to lose that document you were writing. Processes are a kind of bubble that provides isolation as well as parallel execution, and Erlang is built entirely around processes.

Erlang makes it easy for you to create processes as you need them—just as easy as it is to create objects in a language like Java. Because processes are so cheap, we can start to look at systems in a different manner. Each independent activity in an Erlang program can be coded as a separate process. No unintuitive event loops, no thread pooling, none of those pesky implementation details. If your program needs 10,000 processes running simultaneously to accomplish a job, it can easily be done. As you’ll see as you read this book, this fundamentally alters the way we look at systems, presenting a view that is, as we hope to show you, much more intuitive (and much more productive).

Where Erlang comes from