Live data from Hacker News

Why Elixir (2014)

theerlangelist.com

21–30 of 59 posts

Re: Why Elixir (2014)

#21

I started learning Erlang a few months ago and after spending a week with the online class at Future Learn [0] I can understand why some people say Erlang is more readable than Elixir. I know if you're coming form Ruby world, Erlang almost feels second nature. However, for people coming from other languages, I recommend looking into Erlang as well. It's more expressive, IMHO. [0] https://www.futurelearn.com/courses

The syntax alone is not really sufficient to justify it, but Elixir's hygenic macros are well worth it and we benefit by having simpler and more elegant APIs and libraries.

Re: Why Elixir (2014)

#22
post #19
post #14

Earlier quoted context omitted.

I appreciate the response, at any rate. I will read more libraries; hopefully I can find some which use flow. I have used distillery but I find myself going down a pretty big rabbit hole just to release something which in most languages is pretty simple. I will look at it again.

If it's any help: I use docker multistage to build a barebones alpine docker image. It uses distillery. I based my dockerfile on https://gist.github.com/bsedat/16cb74ebc8ab0ed61ac598a129b0a... Blogpost: https://zorbash.com/post/docker-multi-stage-elixir-distiller... (I'm not the author)

I just got the same setup this week. Docker multistage builds are amazing and make builds super small and awesome. You can ship releases without having to install Erlang or elixir on the imag, and just use what distillery has. Distillery really is amazing.

Re: Why Elixir (2014)

#23
post #20

Earlier quoted context omitted.

Elixir is very easy to learn. I suppose at the end of day you would be spending more time designing your architecture rather then language.

I disagree that Elixir is easy to learn, the syntax ok, it's weird compared to most OO languages, but actually using OTP is a real paradigm shift that requires a totally different way of thinking about issues. I did not find that easy at all. The other issue is that Elixir and Phoenix have become joined at the hip in the same was as Ruby and Rails, and Phoenix didn't click with me at all, coming from the JVM world I…

I don't think it's easy to learn either. The basics are easy, and the syntax is easy, and writing some code that does what you want in the repl is easy. But then you try to make a real application and you have more questions than answers.

But, you can do OTP without making it distributed. Elixir is awesome in that you have this actor based system (genserver) where the syntax gets out of the way more than in any other language i'm familar with. So the business logic running on these genservers is really easy to understand. And there is nothing stopping you putting them behind message queues or load balancers. Most of the time, that's probably appropriate.

Re: Why Elixir (2014)

#24
post #5

Very relevant to this: How to sell Elixir - a talk from today's ElixirLondon https://speakerdeck.com/evadne/how-to-sell-elixir

Somehow I get the feeling Elixir is the new Ruby, every time I go through such presentations. Basically it looks like the escape route for Ruby developers that care about performance.

I'm amused that Elixir feels like the best language I've ever used, and yet I can't tell you why. I love (most) everything about it. It's kind of like trying to say you should meet my best friend Bob; no matter how much I tell you about Bob, you'd still have to meet him yourself to form your own opinion.

Re: Why Elixir (2014)

#25
post #17
post #13

Earlier quoted context omitted.

As someone working across JVM, .NET, C++, Android and iOS, I don't have any use case for Elixir. If I ever would need BEAM, Erlang would be quite ok, given that I was quite comfortable with Prolog in the past and do like the syntax. Hence why I kind of see it as BEAM for Ruby developers, even if I am way off what is actually happening on the BEAM world.

100% This. The use cases for OTP are actually quite narrow, despite what Erlang/Elixir evangelists tell you. Discord is a fantastic use for OTP. Writing a CRUD app with a couple of reactive/interactive pages for comments on videos and few thousand users, OTP is overkill. If you have an app that needs the scale and safety of OTP, then which language you pick makes no difference. Phoenix is a really cool project, writt…

The great thing with Elixir in your toolbox is that you're prepared to write the quick mostly-static app or the full multi-server connection-processing behemoth.

I just type "mix phoenix.new " and I have a relatively light starter framework that's ready to go as far as I need to take it.

Rails had the same "ready to go" feel as Phoenix, but I learned from painful personal experience that you hit the scaling wall way too quickly - but with that project I never realized that scaling would ever be a problem. How was I supposed to know which sized framework/language to use from the beginning.

So sure, the use cases where OTP will really shine for you are potentially narrow. But Elixir is actually quite fun to work with even for small projects and it's fantastic knowing that if a project grows unexpectedly, I don't have to scrap it and write it in something else.

Re: Why Elixir (2014)

#26

I started learning Erlang a few months ago and after spending a week with the online class at Future Learn [0] I can understand why some people say Erlang is more readable than Elixir. I know if you're coming form Ruby world, Erlang almost feels second nature. However, for people coming from other languages, I recommend looking into Erlang as well. It's more expressive, IMHO. [0] https://www.futurelearn.com/courses

> coming from Ruby, Erlang almost feels second nature

s/Erlang/Elixir I assume.

Re: Why Elixir (2014)

#27
post #8

I really am in awe of Elixir. I think it's an amazing language, and it introduced me to Erlang and OTP. I've come from using scala actors, and I can do more in way less time, less memory, and similar performance if I use Elixir. That said, there are some things that suck so hard about it. The log messages suck. If I want to use them in production and actually ship them to ELK or similar, the format really sucks. Gett…

I know it's probably not the answer you're looking for, but you can learn a lot by just reading the code of popular Elixir libraries, such as Ecto, Phoenix, etc. Error messages have gotten better in Elixir 1.5 The whole ecosystem is actually getting better with each release. For shipping to production I use 'distillery'. You create a 'release' and you can even instruct it to read some arguments from the env vars. But…

> You create a 'release' and you can even instruct it to read some arguments from the env vars.

That's my main complain about Elixir. Releasing and configuring at runtime is a huge pain. I honestly don't see any value in this whole "compile time configuration". If it's at compile time, I can put it in the code. What I call configuration is things I can change at runtime. The fact that something that is a given in any language (config via env vars) requires an extra dependency in Elixir is kind of sad.

Otherwise I love the language, the paradigm and the platform.

Re: Why Elixir (2014)

#28

I started learning Erlang a few months ago and after spending a week with the online class at Future Learn [0] I can understand why some people say Erlang is more readable than Elixir. I know if you're coming form Ruby world, Erlang almost feels second nature. However, for people coming from other languages, I recommend looking into Erlang as well. It's more expressive, IMHO. [0] https://www.futurelearn.com/courses

>I know if you're coming form Ruby world, Erlang almost feels second nature.

I'll assume you meant "Elixir", and seriously I hope people will give up on this myth really soon. Yes, the syntax kind of look like Ruby, but the platform is nothing like it. I'm actually very scared for Elixir to see so many Ruby developers moving to it, thinking that it's just "fast Ruby". They may bring all their Ruby habits with them and defeat the point of using the Erlang VM.

Re: Why Elixir (2014)

#29
post #5

Earlier quoted context omitted.

Somehow I get the feeling Elixir is the new Ruby, every time I go through such presentations. Basically it looks like the escape route for Ruby developers that care about performance.

I'm amused that Elixir feels like the best language I've ever used, and yet I can't tell you why. I love (most) everything about it. It's kind of like trying to say you should meet my best friend Bob; no matter how much I tell you about Bob, you'd still have to meet him yourself to form your own opinion.

Because the design choices are subtle and lead you to excellent designs. Bad code in this language looks bad and feels bad to write, to me.

Re: Why Elixir (2014)

#30
post #8

I really am in awe of Elixir. I think it's an amazing language, and it introduced me to Erlang and OTP. I've come from using scala actors, and I can do more in way less time, less memory, and similar performance if I use Elixir. That said, there are some things that suck so hard about it. The log messages suck. If I want to use them in production and actually ship them to ELK or similar, the format really sucks. Gett…

We use https://github.com/rentpath/ex_json_logger to make logs nicer for consumption by ELK and the like.
Post reply on HN