logo
logo
Sign in

Elixir Programming: Facts to Know for Better App Development

avatar
Aleksandra Bessalitskykh
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.

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.

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. 

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.

What is Phoenix Framework and How Does It Relate to Elixir?

Phoenix is a web development framework that is written in Elixir and is used for Elixir programming. Phoenix framework also runs on Erlang VM (BEAM). This means that Phoenix gets all the benefits of Erlang as well.

The main characteristics of Phoenix are:

  • Simplicity
  • Maintainability
  • Speed
  • Productivity
  • Scalability

Phoenix web framework is often compared to Ruby on Rails, and there is a good reason for that. Nowadays these popular web development frameworks seem to be competitors because many developers try to compare them and decide which one is better.

Nowadays the Elixir programming language has become very popular, which made the efficiency and advantages of other back-end languages be called into question.

Benefits of Elixir

The usage of the Elixir programming language and its Phoenix framework has some benefits for projects and the development process:

1- Speed
Elixir and Phoenix are fast. For instance, tests of Elixir’s performance give better results than those for Ruby, and Phoenix response times are measured in microseconds. When we speak about user experience then speed matters a lot. It is wonderful to see that the app responds and reacts fast to all the actions. Moreover, good performance saves energy and money.

2- Reliability
This is one of the strong sides of Erlang that is also available for Elixir. Erlang is also called a battle-proven programming language, that is why there is no point in doubting the reliability of Elixir programming as well.

3- Concurrency
It is the ability to run multiple processes simultaneously but keep them independent of one another. Elixir and Erlang have a high concurrency.

4- Productivity
In Elixir programming the speed of development is good. Elixir’s syntax enables a developer to write clean and understandable code without sacrificing the productivity.

5- Fault tolerance
The two main types of programming mistakes are fault-tolerant in Elixir:
Issues that happen outside an app (e.g. problems with a network)
Internal issues (e.g. wrong data, logic bugs)

There are many nodes that work concurrently in an Elixir/Phoenix application. If there is an error in one node then it will not influence the rest of nodes. As soon as the system notifies them about the issue, they will rearrange their work correspondingly.

Because of the compiled nature of the Elixir programming language, an app won’t start if there are mistakes in Elixir code. To cope with the second type of issue and make sure that an app will work, the Erlang VM isolates modules where mistakes appear and restarts them in isolation. Due to this process, the whole system doesn't go down.

6- Scalability
Elixir programming is ideal for applications that have many users or are actively growing their audience. Elixir can easily cope with much traffic without extra costs for additional servers.

7- Clean syntax
An Elixir code looks nice because of the clean syntax of Elixir which makes the code easy to write and to read. Elixir is a functional programming language which has a completely different programming paradigm from that used by object-oriented languages. It means that it may take a developer some time to get used to it.

Follow this article to find out other benefits of Elixir programming

collect
0
avatar
Aleksandra Bessalitskykh
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more