Elixir is cool, I am learning it now but considering it is compiled to BEAM, and we need to interpolate existing Erlang Libraries into Elixir code, is learning Erlang a must for Elixir developers? Can I just learn Elixir without knowing Erlang? I don’t like the Erlang at all.
We were in the same situation, needing to use Erlang libraries in Elixir code. You’re able to use Erlang libraries from Elixir using native Elixir syntax quite easily, but you’ll need to learn Erlang syntax and semantics to read and understand Erlang API docs. Beyond that, I haven’t learned Erlang in full, and I haven’t had any issues using Elixir for everything. You mostly just need to know the mapping from Erlang to Elixir syntax, which is covered here.
I think what you’re gonna see is that most Elixir developers don’t need to learn Erlang, but the best Elixir developers will be familiar with both to an extent.
Using Erlang libraries in Elixir is easy such that you don’t have to worry about the weirdness of Erlang’s syntax. Also note that Elixir is intentionally designed to not cover every single one of Erlang’s use cases e.g. many things from the Erlang standard library do not have a native Elixir equivalent and shouldn’t, because they work fine already (this may change with time).
So my answer is that after you get good at Elixir and OTP go back and read through the Erlang standard library and see what things you can learn and add to your toolset (
:ets come up often).
FWIW, I think after a few months of Elixir, you’ll find reading Erlang fairly straightforward.
Having just started my Elixir journey I can’t state for sure, but . . . this sounds to me like a familiar question, along the lines of “Can I just learn JRuby or do I have to learn Java too”, or “Can I just learn Rails or do I have to learn Ruby too”. In those situations, sí se puede , but in order to take best advantage of the first situation, or move beyond very basic competence in the second, you do have to learn at least some of the other thing as well. The JRuby/Java situation seems closer, as it’s mainly a matter of learning what’s available and how to deal with it, as opposed to mastering a whole new thing (which is more like the second, probably analogous to learning Elixir in addition to just Phoenix).
And here I was thinking that Elixir had the weird syntax. Of course LFE has the best syntax.
Isn’t this an equivalent to blasphemy? (I’m a YUGE lover of Lisps of all sorts).
I’m an Elixir n00b as they get, so take my answer with a grain of salt, but, coming from the world of QA where I used Selenium with the Java webdriver, I always thought I had to know Java cover-to-cover to be a successful Selenium developer, thus putting countless hours learning it… Turns out I needed only a small subset of it (though you won’t see me shedding any tears about, you know, learning).
Point is, if you need/want to incorporate Erlang’s libs into your code, you’ll need to know the syntax and “lay of the land” of those libs. Which entails a knowledge of some Erlang.
Another pointer: don’t sweat it till you really need it. I spent hours on learning all sorts of Java that I had no use as a Tester. Those are hours I could have instead put into fine-tuning my Selenium knowledge and be none the less for it.
So, to sum things up:
Do you have to know Erlang in full? My past experience says no (your mileage may vary). You do have to know some.
You most defiantly MUST know and have the will to Google/StackOverflow/etc.
You will, most probably benefit tremendously as an Elixir dev if you knew some Erlang (the underlying language).
There’s a reason such language as LFE and Elixir have been invented.
Have you taken a look at some Erlang code? The horror! For real, horrific.
After having learned how Elixir works and getting a good handle on how it’s used, “learning” Erlang will be easy enough where it’s essentially from exposure. Learning the language is more than just learning what syntax it has and which keywords exist, so having learned that from Elixir, which really is just a neat skin on Erlang, you’ve learned the most important part anyway.
Also, if you don’t like Erlang, what is it that you like about Elixir?
Yes, it’s a bit like swearing in church. But I console myself both ways in that they are all part of the same ecosystem which gives you the option of choosing what works the best for you. And you can freely mix so in that respect you will never make the wrong decision.
When I can work out how to do it I will include a picture of the erlang ecosystem, as we see it.
Yes, learning how to use erlang/elixir to build systems is the tricky bit, much more so than the syntax. And at this level they are very similar though the details may vary.
It’s all about building concurrent, fault-tolerant and scalable systems. (buzzword compliant )