Elixir in Action
Manning – paperback
“Elixir,” Saša Jurić writes, “is a modern functional programming language for building large-scale, distributed, fault-tolerant systems for the Erlang virtual machine.”
What Elixir really is, of course, is a breath of fresh air for software developers who find it hard or confusing to work with Erlang’s sometimes complicated syntax and conventions.
Erlang has long been almost off the chart–the bottom of the chart–when computer languages are stacked up by popularity. It began its oddball life in the 1980s as a programming language for the computers in telephone switching systems, specifically Swedish-made, Ericsson telephone switching systems.
Indeed, I first encountered Erlang in the late 1980s while trying to help Ericsson sell Swedish-made computers to American banks. Back then, I counted my lucky stars that I didn’t have to learn it, because I was a tech writer, not a software developer.
Today, however, Erlang and its Open Telecom Platform (OTP) libraries are gaining new converts among serious practitioners of functional programming. Many of them likewise are drawn to Erlang’s built-in support for concurrency, distribution and fault tolerance.
The digital Swedish meatball known as Erlang turns out to be a powerful choice for providing high reliability and scalability to networked and distributed systems with multi-core processors. Telephone networks require high reliability and flexible scalability. And Erlang was designed to help provide both — without limiting itself to telecom systems.
Some of Erlang’s lack of popularity can be blamed on the language’s somewhat difficult learning curve. But it also has not been heavily promoted to software developers. That has been changing recently as companies and developers learn more about Erlang’s good track record, Saša Jurić points out.
“It powers various large systems and has been doing so for more than two decades, such as the WhatsApp messaging application, the Riak distributed database, the Heroku cloud, the Chef deployment automation system, the RabbitMQ message queue, financial systems, and multiplayer backends. It’s truly a proven technology.”
In Elixir in Action, Saša Jurić nicely meets his goal of writing a book that brings “programmers new to Elixir and Erlang to the point where they can develop complex systems on their own.” Elixir provides an alternative language based on several other languages, including Ruby and Clojure, as well as Erlang.
His book is divided into three parts:
- Part 1, “The Language,” offers a high-level overview of Erlang and Elixir. Then it delves into Elixir’s basic building blocks and details common functional programming idioms.
- Part 2, “The Platform,” focuses on primary aspects of BEAM, the Erlang virtual machine, as well as “how concurrency works and how it can help you build reliable systems.” Indeed, “[c]oncurrency is at the heart and soul of Erlang systems,” Jurić writes. “Almost every nontrivial Erlang-based production system is highly concurrent. Even the programming language is sometimes called a concurrency-oriented language.”
- Part 3, “Production,”discusses “production aspects of BEAM-powered systems,” as well as “how to package components, reuse third-party libraries, and build a simple web server,” and “how to build a deployable standalone release and how to interact with the running system.”
Elixir in Action does not cover everything. But it provides fine overviews, clear how-to instructions, and compact code examples that illustrate important points. It can get you going in good directions.
“Elixir,” the author emphasizes, “lowers the entry barrier into the Erlang world and improves developer productivity.”
— Si Dunn