Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there things Elixir can do that Erlang cannot, or vice versa?

This question is in the context of the Beam VM and the capabilities that it provides, not in the general context of what a Turing complete language can do. I want to invest some time to learn either pure Erlang or Elixir. I get the basic differences between the two and I am leaning towards Elixir because of the macros, better syntax and faster development of the language this day.

My question is: if I choose Elixir, will I stumble on something that I cannot do in it, but can do in Erlang? Can I use all the OTP stuff, all the Erlang libraries, code reload, etc. with Elixir?

I am not asking for someone's preference between the two; just facts about the possibilities of the languages. Preferably from someone who used both in production.

like image 272
Saša Šijak Avatar asked Jun 22 '16 10:06

Saša Šijak


People also ask

How is Elixir different from Erlang?

Erlang was mainly used in the field of telecommunication, banking, ecommerce, etc. Elixir is a functional language that is meant for developing applications that are scalable in nature. They are mainly used in handling the distributed applications.

What is advantage of Elixir over Erlang?

Here are Elixir's advantages over Erlang: Modern syntax. The syntax of Elixir is much easier to understand if you've already programmed in virtually any other popular programming language. It removes some amount of boilerplate code and can lead to higher developer productivity.

Is Elixir better than Erlang?

You have a highly experienced development team: You should choose Elixir. It offers greater freedom than Erlang, and experienced developers can utilize it to build powerful applications quicker. Since Elixir offers better documentation, programmers can find more help when they use powerful features.

What can Elixir do?

It's a functional and dynamic language used for building scalable and maintainable web applications. Elixir has a reputation for being fun and easy to learn, and there's an active Elixir community where you can interact with other Elixir programmers.


1 Answers

You shouldn't stumble on anything you can do in one that you can't in the other, since you can freely call Elixir code from Erlang and vice-versa. You can even easily mix Erlang and Elixir files in one project.

In Elixir:

:erlang_module.erlang_function(args) 

in Erlang:

'Elixir.ElixirModule':elixir_function(args) 
like image 72
Paweł Obrok Avatar answered Oct 16 '22 13:10

Paweł Obrok