Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Hakim Fajardo
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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

zxq9-2
On 2018年2月12日 月曜日 21:48:30 Hakim Fajardo wrote:
> 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?

Hi, Hakim.

Having worked in both, I emphatically prefer Erlang as a language. It still has some warts, but they aren't metastasizing the way such things so commonly do in other languages. In this respect I view Erlang's extremely slowing changing nature as a language to be one of its greatest features. It is a small language and looks like it will remain so.

The tooling that Elixir has built around it is more convenient, though.
That said, the importance of "convenient tooling" drops dramatically as a project's size goes up.

I'm hoping to bring some tools out for Erlang that bridge the tooling gap at least a little, but I'm not quite there yet (real life keeps getting in the way).

My 2c.

-Craig
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

José Valim-3
In reply to this post by Hakim Fajardo
The important parts: concurrency, distribution, fault tolerance, etc will be mostly the same, regardless of your choice. After you learn those concepts, moving from one to another should be straight-forward and they interoperate fairly well.

So pick whatever makes you more productive and enthusiastic while learning.

In any case, if there are parts in the Elixir documentation that are vague or unclear, we would appreciate if those reported. The same applies to the Erlang/OTP documentation too.

Enjoy!

José Valim
Founder and 
Director of R&D


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

zxq9-2
On 2018年2月13日火曜日 8時28分32秒 JST José Valim wrote:
> The important parts: concurrency, distribution, fault tolerance, etc will
> be mostly the same...
> ...and they interoperate fairly well.

This is something I forgot to mention.
Aside from the Elixir environment being a bit of a large dependency, they interoperate VERY well. Quite a nice end result, however you get there.

The same goes for LFE (at least in my experience so far).

It is really lovely what has happened. Even if I don't particularly care for lang X or Y so much, it doesn't really matter. I've had a much better time getting Erlang-family languages to play well together than, say, some combinations of JVM languages.

That's really something.

-Craig
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Gordon Guthrie-6
In reply to this post by José Valim-3
Hakim

Depends on your use case - Elixir, with its macros and all, is designed to make some things super easy, things that you might to again and again - building web sites, apis, back-ends to apps...

The cost side of that is that you have to invest time in learning how Phoenix (for example) works and your code is harder to read - you need to dig around to find out how stuff does what...

Erlang itself is a much smaller language - but the tooling is way behind Elixir, so horses for courses.

Gordon

On 13 February 2018 at 07:28, José Valim <[hidden email]> wrote:
The important parts: concurrency, distribution, fault tolerance, etc will be mostly the same, regardless of your choice. After you learn those concepts, moving from one to another should be straight-forward and they interoperate fairly well.

So pick whatever makes you more productive and enthusiastic while learning.

In any case, if there are parts in the Elixir documentation that are vague or unclear, we would appreciate if those reported. The same applies to the Erlang/OTP documentation too.

Enjoy!

José Valim
Founder and 
Director of R&D


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




--
---
Gordon Guthrie
@gordonguthrie
+44 (0) 7776 251669 (in Bonnie Scotland!)

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Aaron Seigo
In reply to this post by Hakim Fajardo

On 2018-02-13 03:48, Hakim Fajardo wrote:

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 really enjoy both languages for being the mix of pragmatic FP and the wonder that is OTP that they are. So it is easy to understand how people fall into liking one or the other language more: the important stuff is common, it's the details that make up the differences.
 
There are things that Elixir brings with it, though, that are hard to replicate with Erlang on its own. There are lots of little things (like multiple modules in the same file, not having to name source files after modules, and visibility of functions attached to the function definition; all products of the times when Elixir and Erlang were "born") which probably aren't enough on their own to really warrant making a choice.
 
The big things that do make the difference, at least for me, include the tooling (which is hands-down nicer in Elixir, even though rebar3 with hex.pm support has helped a bit), testing framework, macros, the more pleasant APIs (compare Erlang's map with Elixir's Map, for instance), and the libraries / projects like Ecto, Phoenix, Flow, Nerves, ... 
 
I still use a lot of pure-Erlang libraries (so many good things! :), but many of the nicer Elixir libraries would be hard to replicate with pure Erlang. Ecto and Plug are good examples as they both rely on macros quite a bit to make them as easy to use while remaining powerful.
 
So, for me, that's the reason to use Elixir. Being able to use Erlang code with Elixir code is a pure godsend, though, and I still write Erlang where it makes sense to do so :)
 
--
Aaron

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Oliver Korpilla
In reply to this post by Hakim Fajardo

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" <[hidden email]>
An: "Erlang/OTP discussions" <[hidden email]>
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 [hidden email] http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

scott ribe
In reply to this post by Hakim Fajardo

> On Feb 12, 2018, at 7:48 PM, Hakim Fajardo <[hidden email]> wrote:
>
> 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?

Why learn C++?

--
Scott Ribe
https://www.linkedin.com/in/scottribe/
(303) 722-0567

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

zxq9-2
On 2018年2月13日火曜日 6時44分06秒 JST scott ribe wrote:
> Why learn C++?

Indeed. That is a rather good question. Why WOULD anyone? ;-D

-Craig
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Why Learn Elixir if it's built on Erlang? Why not just learn Erlang?

Hakim Fajardo
In reply to this post by Oliver Korpilla
Everyone, thank you for the feed back. I agree the syntax of Elixir feels simpler and easier to understand. Either way, I enjoy learning both and I guess I will get to a point where I will clearly understand the advantages of Both. Happy Coding! 

On Tue, Feb 13, 2018 at 3:28 AM, Oliver Korpilla <[hidden email]> wrote:

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" <[hidden email]>
An: "Erlang/OTP discussions" <[hidden email]>
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 [hidden email] http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions