A Brief Introduction to Elixir

It is common knowledge that processors stopped improving around 10 years ago. Since then manufacturers have increased computing power by adding more processors rather than faster ones. Unfortunately, some of our favorite programming languages are not able to easily and efficiently take advantage of these additional processors.

Why Does This Matter?

As users of software, we want our applications to be fast and feel snappy. Our software ideally should be able to react to our desires as quickly as we can conjure them up. Meanwhile, the software we build asks computers to perform an increasing amount of increasingly complex tasks. As you can imagine, these two factors are in competition with each other; eventually we will need to be able to harness those untapped processors to resolve this conflict.

You’re probably thinking, “dude, you said processors stopped improving 10 years ago! Why are we just talking about this now?” The truth is, even though processors stopped improving, they were still capable enough to handle everything we threw at them. We have so far avoided hitting that performance wall by using good programming practices in addition to clever improvements in software. However, we are starting to see that wall loom larger on the horizon. As good developers, we want to be prepared.

How Do We Harness This Power?

The answer is that we need to build software that doesn’t require tasks to be executed sequentially. In programmer parlance this is referred to as concurrency.

Concurrency presents many challenges for software developers: if one part of our application is running on one processor and manipulating data, while another part of our application is running on a separate processor and manipulating the same (or directly related) data, we have a recipe for serious trouble. Luckily, there are smart people who have already thought about how to solve these challenges. Now we have options that make building these kinds of applications easy(ish)!

Elixir!

Here at Foraker, one of the options that we have found intriguing is Elixir. Elixir is a modern extension of Erlang, a programming language with a powerful virtual machine built for concurrency. Erlang is also battle-tested; it has been around for 25 years! It is a solid foundation for building awesome, amazingly fast applications.

The downside of Erlang is that it is not very pleasant to work with. We are Ruby-lovers because Ruby loves us and makes our jobs much more enjoyable. That luxury is not something we want to give up. This is the goal of Elixir: use the foundation of Erlang in a way that is pleasant and enjoyable to work with. We are intrigued by its potential and the potential of Phoenix, a framework for building web apps in Elixir.

Fly with Phoenix

Phoenix is often compared to Rails because they both come from a similar point of view about how a web framework should be constructed. This can make Phoenix an easy transition for Rails developers, which means we can start building cool stuff faster! We can also start building really fast cool stuff! How fast? Phoenix response times are measured in microseconds!

Whoa!

Is Anybody Really Using This Thing?

Yes! The biggest Elixir adopter to date is Pinterest. They have made a big commitment to the Elixir community by developing tools for working with Elixir and making those tools available to everyone. This endorsement bodes well for Elixir’s future.

Bleacher Report, one of the biggest sports news websites in the world, has adopted Elixir for some of their most demanding applications.

WhatsApp, famously acquired by Facebook for $19 billion, is built on Erlang. It may not be Elixir/Phoenix but it shows the potential of what this technology is capable of.

If you’re really curious you can check out some interviews with other companies using Elixir in production here.

Room to Grow

Elixir is still young, but it has the potential to grow into one of our favorite tools. We look forward to seeing more of it. Do you have experience with Elixir? Let us know about it on Twitter!

Tweet at Josh

Share this post!