Elixir Programming: Facts to Know for Better App Development
We know about many web development languages that have been successfully used by developers for quite a long time so far. The most popular of them are Python, PHP, and Ruby. However, recent years have brought a new technology that is being thoroughly discussed - the Elixir programming language.
Ever since Elixir programming began to gain traction, the efficiency and advantages of other back-end languages has been called into question. That said, is Elixir really so good?
We will try to answer this question in this article. Let’s learn more about what the Elixir language is, what it offers to developers, and what projects it can be used for.
What is Elixir?
Elixir is a functional programming language that first appeared in 2012. José Valim, its creator, built it on top of the Erlang Virtual Machine called BEAM. He chose this basis for good reason. Erlang is a concurrent and productive coding language, and so he wanted his new programming language to be as well.
There is a group of people called the Elixir Core team that maintains the source code. The team consists of six members: José Valim, Eric Meadows-Jönsson, James Fish, Aleksei Magusev, Michał Muskała, and Andrea Leopardi. This fact is favorable for Elixir programming, because the team never changes the codebase until there is a shared understanding of the changes among all members.
Since 2012, there have been 96 Elixir releases. The latest stable release (version 1.7.3) was in August 2018. Even as a young programming language, Elixir already shows good results in its repository. See for yourself:
The comparison above shows that the Elixir programming language is being developing actively and its community is growing step by step.
Erlang: Technology Behind Elixir
To have a better understanding of Elixir, it is necessary to devote some time to Erlang.
Erlang is also a general-purpose functional programming language and was created by Ericson to be used for the development of telephone applications. This purpose of use speaks for itself. To ensure the continuous function of said apps, a platform should be stable, concurrent, fault-tolerant, and should support software updates on the go (hot code upgrade). Since 1986 (the year Erlang first appeared), this functional language has been coping with this task and demonstrating its battle-proven nature and reliability.
You might then ask why developers don’t choose Erlang for back-end programming. Compared to other web programming languages, its syntax is very unusual and its frameworks, tools, and packages are more complicated.
In any case, there is Elixir, which belongs to Erlang VM languages and was created by a Ruby developer. This means that Elixir programming offers a mix of benefits from both coding languages: its syntax is similar to that of Ruby and it has access to all the features of the mature Erlang system. Elixir and Erlang also have different systems of package management and other system tools.
What is Phoenix Framework and How Does It Relate to Elixir?
One more term that requires some clarification is Phoenix - a web development framework that is written in Elixir and is used for Elixir programming.
As with Elixir, Phoenix framework also runs on Erlang VM (BEAM). This means that Phoenix receives all the benefits of Erlang as well.
The main characteristics of Phoenix are:
Phoenix web framework is often compared to Ruby on Rails, and not without good reason. These popular web development frameworks seem to be competitors now, as many developers try to compare them and decide which one is best.
Elixir Language Advantages and Disadvantages
As with all other technologies, the Elixir programming language has its pros and cons. Let’s analyze them to understand what one may face when choosing Elixir programming for their project.
Benefits of Elixir
Leveraging the Elixir programming language and its Phoenix framework has a number of advantages for projects and the development process:
- Fault tolerance
- Clean syntax
Elixir and Phoenix are fast. For example, tests of Elixir’s performance show much better results than those for Ruby, and Phoenix response times are measured in microseconds. Impressive, isn’t it? Speed matters a lot when we speak about user experience. It is great to see that the app reacts and responds quickly to all actions. Additionally, good performance helps to save energy and money.
This is one of the strong sides of Erlang that is also available for Elixir. Erlang is called a battle-proven programming language, thus there is no reason to doubt the reliability of Elixir programming as well.
In software development, concurrency means the ability to run multiple processes simultaneously but keep them independent of one another. Elixir and Erlang are characterized by a high concurrency.
The speed of development in Elixir programming is good. Due to Elixir’s syntax, it is easy to write clean and understandable code without sacrificing the productivity of a developer.
Elixir is fault-tolerant to the two main types of programming mistakes:
Issues that happen outside an app (e.g. problems with a network)
Internal issues (e.g. wrong data, logic bugs)
An Elixir/Phoenix application has many nodes that work concurrently. In the first case, an error in one node will not influence the rest of nodes. The system will notify them about the issue and they will rearrange their work correspondingly.
Due to the compiled nature of the Elixir programming language, an app built with its help won’t start if there are mistakes in Elixir code. To handle the second type of issue and make sure that an app will work, the Erlang VM isolates modules where mistakes occur and restarts them in isolation. This process prevents the whole system from going down.
Elixir programming is a perfect choice for applications that have many users or for those that are actively growing their audience. Elixir can easily handle a lot of traffic without extra costs for additional servers.
Looking at an Elixir code snippet, any developer will tell you that it looks nice. This is because of the clean syntax of Elixir; it makes the code easy to write and to read. The only point here is that Elixir is a functional programming language. Functional programming is a completely different programming paradigm from that used by object-oriented languages. This may take a developer some time to get used to if they switch to Elixir programming from an object-oriented language.
Downsides of Elixir
The disadvantages of Elixir are:
- Smaller amount of Elixir programming jobs
- Lack of Elixir developers
- Elixir is a young programming language
- Smaller community
- Smaller ecosystem
Smaller number of Elixir programming jobs and lack of Elixir developers
As Elixir programming is not that widespread yet, the job market is still developing in this domain. On one hand, the demand for Elixir developers is not very high, on the other hand the number of Elixir developers for hire is even lower. Of course, it’s possible to find a good professional, but it will require more time and effort.
Smaller ecosystem and community
As the Elixir language is comparatively new, its community and the number of libraries and tools available for Elixir developers are still fewer in number than those of other popular programming languages. More time is needed for Elixir to catch up with them, and it certainly will.
Elixir is a young programming language
The Elixir programming language appeared not that long ago, and there are many developers who observed this. Some of them are still not sure what the future holds for Elixir programming and whether it is the right, and most reliable, way to go.
What Projects Can Leverage Elixir Development?
Elixir functional programming can be utilized for various projects. The main advantage of Elixir in this regard is that it doesn’t serve any particular niche. This coding language, along with its Phoenix framework, can be used to build applications for any industry.
You can hire Elixir developers to create applications with any set of features and degree of complexity, but there are cases wherein Elixir programming is the most reasonable choice both strategically and financially. To be more specific, it is a good fit for the projects that need to have the following characteristics:
- Low latency
- A lot of traffic
- Distributed system (e.g. Blockchain projects)
- Embedded system (e.g. IoT projects)
- Real-time applications (instant messaging, chatting, video chatting, financial apps, etc.)
Want to get technical consultation in building your app with the help of Elixir?
Drop us a line with your project idea so we can provide you with detailed feedback regarding its development, technical aspects, and utilization of the Elixir programming language.
Elixir Popularity: Is the Language Worth Using?
Since the first release of the Elixir programming language, its popularity has grown steadily. Look at the worldwide rising tendency from Google Trends over the past 5 years:
In 2017, Elixir was one of the most loved programming languages according to the Developer Survey done by Stack Overflow.
Let’s analyze some good uses of the Elixir programming language.
Who Already Uses the Elixir Language?
Naturally, it is too early to qualify Elixir as one of the most popular programming languages, but its adoption continues to grow. Thus far, the variety of companies who have already switched to Elixir ranges from popular platforms and applications to government websites.
That said, what big projects use Elixir? Among the well-known Elixir adopters are Pinterest, Postmates, and Bleacher Report.
Pinterest is a popular social network for people who are looking for inspiration and motivation through pictures and videos. The app’s monthly user count is measured in millions, making the load extremely high. Pinterest used Elixir programming to implement their notification system and, as a result, its code size went down from 10,000 lines to just 1,000. Additionally, they also cut down the need for server capacity by half.
Bleacher Report is a popular US sports news website. The site was initially built with Ruby on Rails, but it eventually became clear that Rails did not allow them to scale the system any further. At that point, they decided to migrate to the Elixir language. This decision saved the company a lot of money they could have spent on servers and tools. Instead of using 150 servers with Rails, they ended up with only 5 Elixir servers. Impressive, isn’t it?
Postmates is actively adopting Elixir web development for various app systems and even describes their Elixir use in articles and contributes Elixir-based libraries to open source.
Why Developers Like Elixir Programming
If you were to ask developers about the things that contribute to programmer happiness, they would probably tell you the following:
- Working with productive technologies that allow for the growth and scaling of products quickly
- Availability of the right frameworks, libraries, tools, and services that help to build products
- Ability to deliver new features quickly
- Being part of an active and friendly community that can support and help you
- Overall joy of development
The question is: can Elixir programming ensure all these important things? Let’s analyze.
- The Elixir language is very productive. It allows for the scaling of applications and is actually good at it.
- Elixir web framework, called Phoenix, is its big advantage. The toolset available for Elixir programming is also good. Of course, the number of libraries and services is often not enough to cover all developers’ needs, but the core team and numerous contributors are actively working to improve the situation.
- Elixir code is easy to write because of the clean syntax. A command can be implemented by just a few lines of code.
- The Elixir community, though comparatively small, is very welcoming and supportive. As Elixir becomes more popular, the number of Elixir developers, contributors, and followers grows as well.
- Those developers who have already tried programming in Elixir say that it feels great when they don’t have to choose between the development speed and performance. Elixir offers both and developers are happy with that.
This short Elixir language review, based on the key constituents of programmers’ happiness, shows that developers have no reason to dislike this technology.
Interest in Elixir Development in 2018
Although Elixir is still not featured among the most used used programming languages in 2018, its potential is strong. Judging by the number of Elixir conferences in 2018 and the number of attendees that is growing from year to year, developers and companies are keeping their eyes on Elixir.
One of the most popular conferences for those who want to learn Elixir and improve their skills is ElixirConf. It is held yearly on two continents: one in the US, and another in Europe. ElixirConf brings the community together, promotes the Elixir programming language, and provides opportunities for networking and establishing good relationships between attendees. ElixirConf’s popularity is growing and, thus, the popularity of Elixir programming and this positive trend will definitely continue.
There are a few more big Elixir events in 2018, so keep watching and stay tuned for the news.
Time to Try Elixir
As the Elixir programming language and the Phoenix framework gain more and more popularity, and the feedback from developers who have tried these technologies remains positive, we have no other choice but to research them further.
The benefits of Elixir programming are impressive, and its positions are strong enough to make it clear that it will not disappear off the radar. It is high time to try Elixir. Are you in?
Want to try Elixir for your project?
Contact our team to learn more about the new opportunities for your app and let’s make it extremely productive and stable!