v3470

v3470

What's the main reason that Elixir chooses to compile to abstract format rather than core Erlang?

Recently I found some other BEAM programming languages, and most of them choose to compile to core Erlang or standard Erlang. And this makes the Elixir’s choice – the Erlang abstract format become a little mysterious.

Because I’m planning to make a kind of toy language base on BEAM, I’m curious about the pros and cons of each choice.

Thanks.

Most Liked

josevalim

josevalim

Creator of Elixir

It gives us access to more tools in OTP, such as erl_eval, cover, debugger, etc. In the past, even Dialyzer required abstract erlang, but I have fixed it a couple releases ago.

16
Post #2
bjorng

bjorng

Erlang Core Team

I would strongly recommend that you use the Erlang abstract format. It will always be better supported by the OTP team and will have fewer compatibility issues.

For example, in OTP 23 we improved the syntax for binary matching. To do that, we had to change how we generated Core Erlang. We stopped using the receive construct in Core Erlang and started using new low-level primops for handling the mailbox. The changes were not in violation of the Core Erlang specification, but it broke tools that depended on the old implementation.

15
Post #3
rvirding

rvirding

Creator of Erlang

As @bjorng mentioned sometimes the translation from Erlang AST to Core erlang changes which can cause confusion. I had such problem before with LFE when I generated Core. I was generating guards very simply and naively, though correct, and in one version of Erlang one of the optimising passes decided my guards should just fail. Which is not quite what I had intended. :grinning:

So generating Erlang AT is safer and more future proof.

Where Next?

Popular in Discussions Top

pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
Ankhers
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19327 150
New
PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
New
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
AstonJ
If so I (and hopefully others!) might have some tips for you :slight_smile: But first, please say which area you’re finding most challen...
New
Owens
Hello all, I am developing a new mobile app with Flutter frontend and Phoenix backend. The mobile app has real-time task management and c...
New
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
axelson
Decided against including more info in the title, but the gist is that Plataformatec sponsored projects will continue with the assets bei...
New
Markusxmr
Since Drab has been developed for a while in the open, introducing the Liveview functionality in a way it happend appears to undermine th...
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement