Today, Elixir powers companies like Discord with millions of concurrent users.1
In this article, we look at the origin story of Elixir and its creator, José Valim.
What led José to create Elixir? What were the early days like? How did it grow?
Who is José Valim?
José Valim is a Brazilian software engineer, who developed an interest in multi-core systems at a young age.2
Going back to my first computer that I got when I was 8 to 10 years old, it was a powerful computer at the time, but two years later, not even that… So I had a Pentium 100, and a boy at school told me he had a Pentium 233. And I was like, “How come? We just got this computer, we’ve barely finished paying for it. How come you have a machine that is more than twice as fast as mine?
José understood early that the next step in computing would not simply be more powerful single-core machines, but rather machines with multiple cores.
José and Ruby
The first programming language José got really good at was Ruby.
A year after graduating from University in 2009, José founded Platformatec, a Ruby-focused software development agency. A year into Platformatec, he became part of the Rails core team, and continued contributing for another four years.
In his Rails projects, José frequently kept running into hard-to-reproduce bugs related to race conditions. In a multi-core system, it’s possible that two cores try to modify the same place in memory, or handle the same resource at the same time. Languages such as Ruby didn’t protect against such race conditions caused by improper synchronization of memory access.
José started thinking about how he might tackle this problem.
It’s this curiosity that led him to create Elixir.
Converging Ideas
In his search for a solution, José attributes two points of no return.
The first was discovering functional programming — specifically, immutability. The concept of immutability meant that data was not shared across processes. This eliminated a category of problems plaguing other procedural and object-oriented programming languages. The second was his discovery of the Erlang Virtual Machine.
Erlang was first developed as proprietary software within Ericsson in 1986. It was later released as free and open-source in 1988. It was designed to scale telephony systems that required fault tolerance and distribution. Erlang supported concurrency both within a single machine and communication between machines. The latter was something other languages did not support easily.
José's exploration into functional programming wasn't limited to Erlang. He delved into languages like Frink and Clojure, enriching his understanding of functional paradigms. However, it was the capabilities of the Erlang VM that ultimately inspired him.
Recognising its potential, José chose it as the foundation for his own programming language — Elixir.
Early Days of Elixir
By April 2011, José had v0.3 of Elixir ready, and was using it for personal projects.
However, his initial prototype did not meet the complete vision he had for Elixir.
Replicating Ruby- features within the Erlang VM required adding extra layers of abstraction over Erlang, reducing Elixir's interoperability with it. Any new function or module in new Erlang releases would have to be wrapped first in Elixir, which meant that Elixir would constantly be playing catch up with Erlang.3
As a result, Jose took a break to first study other languages and gather insights for improving Elixir. He became more critical of features added to Elixir. For every feature, he questioned its necessity and optimal implementation.
After months of research, Elixir’s foundation was formed. José approached Plataformatec in February 2012 to discuss the possibility of sponsoring Elixir, and got their green signal. He published v0.5 of Elixir in May 2012, the very first release on the Elixir website.
To get others excited about Elixir, José attended events and met other programmers. He shared about Elixir and gathered feedback about the language. During the Oredev Conference in 2012, José expressed his vision for Elixir. He wanted Elixir to enhance developer productivity and promote language extensibility. He also wanted to preserve a high degree of compatibility with Erlang. 4
The early iterations of Elixir did not have as many features as the language today. In fact, the Stream module was only introduced in v0.10 in July 2013, a year after the release of v0.5. Another milestone for Elixir was the announcement of ElixirConf in April 2014.
Nowadays, major releases are less frequent, often focusing on "quality of life" improvements. However, the ecosystem has been growing, supporting Elixir's use in modern systems.
Elixir’s Ecosystem
One of Elixir's greatest strengths is its community of developers who contribute libraries and frameworks. These are five of the projects that have become the cornerstones of the Elixir ecosystem.
Phoenix
Phoenix was first developed in 2014 by Elixir developer Chris McCord. Phoenix is a server-side web framework inspired by Ruby on Rails. It brings the familiarity of the Rails framework to Elixir. One of its modules is LiveView. It flips the traditional client-server architecture on its head. It uses a persistent web socket/long polling instead of client-server HTTP requests. This reduces latency and removes the network overhead of HTTP requests.
Scenic
Scenic is a client application library. Scenic provides GUIs for fixed screen connected devices. These devices are often used in the Internet of Things (IoT). Boyd Multerer, the person behind Scenic, is also responsible for Xbox Live. He founded and led the team that worked on the Xbox One operating system.
Nerves
Nerves is an open-source platform for building embedded systems with Elixir. It creates a specialized environment that runs the BEAM VM. This brings all the benefits of Elixir and the BEAM VM to the embedded system.
Nx
Nx (or Numerical Elixir) is a multi-dimensional tensor library that leverages multi-staged compilation to the CPU/GPU. It is a newer addition to the Elixir ecosystem and it is an attempt to bring AI/ML capabilities to Elixir.
Membrane
Membrane is a multimedia processing framework that supports a wide range of multimedia types. It can be used to develop real-time communication applications like Zoom.
Elixir’s Popularity
Interest in Elixir has grown over the years as the language and its ecosystem have matured. According to the Stack Overflow Developer Survey, Elixir has consistently ranked in the top three "most loved languages by developers". Phoenix has also become the most liked web framework of 2022 and 2023. 5
Elixir’s popularity has also risen among companies. Companies like Discord use Elixir to support five million concurrent users. Elixir has also seen growing use cases in areas like embedded systems and web development.
Embedded Systems with Elixir
Embedded systems programming is dominated by lower-level languages like C or C++. This is because these Internet of Things (IoT) devices need to be performant given their limited processing power. Yet, Elixir has found a niche in the embedded systems space. Elixir focuses on solving problems outside of writing performant systems.
IoT devices may be used in areas with external factors like network connectivity and physical accessibility. These factors influence the maintainability of such devices. In these cases, performance is not the only consideration when building the embedded system. In such scenarios, Elixir can help to maintain the connection between devices and the central server. This reduces the amount of manual intervention necessary for such systems.
Connor Rigby, a former embedded systems engineer at Farmbot, has mentioned how using Elixir allowed Farmbot to build lean systems that worked well in low-bandwidth areas. 6
Web Development with Elixir
Elixir has also grown in the web development space with the introduction of Phoenix. Companies like Heroku and Mozilla have adopted Elixir. They use it to develop and migrate their web applications and core services.
Using Elixir allowed Heroku's analytics service to handle 3,000 to 4,000 requests per second. The average response time was also reduced to about 1ms.7 Mozilla uses Phoenix to build REST endpoints, implement chat messaging, and create real-time avatar tracking features.
Flaws of Elixir
Elixir has a low adoption rate in industry. Languages like Javascript for web development remain the go-to language for most teams. This is likely due to the greater diversity of tools available for these languages.
The functional programming paradigm also introduces a learning curve for those learning Elixir. Elixir's module system and immutability is a departure from imperative languages like Java. This means that developers will take time adjusting to this new way of solving problems.
Elixir also has a lack of educational resources compared to other languages. This can make it trickier to learn the language for those accustomed to languages with more resources like Javascript.
Conclusion
Elixir is proof that the growth of a language relies on its community.
Individuals like Chris McCord, Frank Hunleth, and Boyd Multerer have contributed libraries, as well as their time and expertise for the community. These contributions have shaped Elixir's ecosystem.
Elixir’s development also highlights the importance of keeping high-level objectives in software development. Every feature of a project should always be met with two questions, “Why do we need it?” and “What is the best way to do it?”. This helps to keep the project lean and focused.
Discord has been an early adopter of Elixir and have extensively written about its usage on an engineering blog post.
An interview transcript with Jose Valim.
Elixir v0.5.0 was released on May 25, 2012. The release blog post contains a “Looking Back” section that goes into the history.
Elixir has published a case study of Farmbot’s usage on its blog.
Elixir has published a case study of Heroku’s usage on its blog.