[erlang-questions] Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Oliver Korpilla Oliver.Korpilla@REDACTED
Tue Feb 13 09:28:10 CET 2018


Hello, Hakim.

At my workplace I did a 1 1/2 year project in elixir that eventually grew to have a few dozen developers in it. This was in the 2016/2017 timeframe.

I was actually the one who evaluated first Erlang, then elixir and then chose elixir. The reason was simple: The syntax was a big driver of adoption and teaching it to other people. We had way more problems with Erlang syntax and quirks than we had with some of the choices made in elixir's language design. In a workplace where Python is common knowledge and often Ruby is, too, I simply had an easier time convincing people to adopt the less "alien-looking" elixir. 

Your mileage may of course differ.

I personally feel very at home with elixir constructs like the Pipe operator to structure my code and make it more readable. The closer a language gets to write to how I think, the better. We also had people wanting to experiment in reactive patterns, etc.

Adopting elixir also had its quirks, too, of course. It took me quite a while to find some things documented, I was figuring out myself how to reuse gen_fsm state machines because there was no "elixir-ism" layered over it. I indeed kept referring back to the extensive Erlang and OTP documentation all the time. (We eventually adopted elixir 1.3 as our final version.)

mix, elixir's build tool, did what we wanted and I eventually came to appreciate distillery as well.

I must admit we practically made no use of features like elixir macros because I always ran into trouble when trying to do that. Having a basic proficiency with Lisp macros I still struggled with how elixir was doing it and ran into unexpected snags there, eventually giving up on it. I have to admit, it was not really missed. In some cases, libraries relying on macros to build their basic constructs could be harder to understand, even though we used only very basic ones like the "amnesia" wrapper around Mnesia.

Being able to mix (ha!) elixir with Erlang was a big boon because you could always fall back to Erlang if that was easier or needed. Erlang was like a conservative (in the adopting of features sense) base on which we started using newer elixir features where more experimenting with broadening the language were done. When it came to the underlying BEAM infrastructure one will always refer back to the documentation at the Erlang pages, and sometimes things can be harder to find because first you have to find out what of Erlang's feature set you access how from the elixir/mix/distillery amalgam.

The project is still an example to many of us how rapidly a complex networked application can be built and changed when leveraging OTP. It still excels in many features over its successor - which was built in C++. A management decision. Sigh. Some of us are still trying to apply the lessons learned from that project into our work today.

Hope this helps,
Oliver
 

Gesendet: Dienstag, 13. Februar 2018 um 03:48 Uhr
Von: "Hakim Fajardo" <keam7095@REDACTED>
An: "Erlang/OTP discussions" <erlang-questions@REDACTED>
Betreff: [erlang-questions] Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

I've been spending time teaching my self Elixir and Erlang. But I can't help but ask why learn Elixir if's built on top of Erlang? Why not just learn Erlang. I enjoy learning both but what's the point? 
 
I find myself constantly referring back to the Erlang Manual to understand Elixir. It feels redundant. 
 
Any experienced Erlang/Elixir users have thoughts?
 
Best,_______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list