Live data from Hacker News

Why am I interested in Elixir?

underjord.io

21–30 of 183 posts

Re: Why am I interested in Elixir?

#21

coming from erlang elixir is much nicer than that. exunit is miles ahead of eunit and i feel like that would be enough to convince me to switch. the with syntax is nice and helps to deal with early exit on errors but still feels a bit awkward compared to imperative control flow. like you can do something like this in an imperative language: foo, err = func() if err != nil { return nil, Err("bad") } bah, err = func2(f…

The idiomatic way to do that is to match errors in the else branch of the with statement.

I've been using Elixir and Phoenix for a customer for a couple of years. It's ok to great, especially when spawning jobs, with some stains.

I'm not a great fan of the with syntax. I wish they implemented it as a native statement of the language instead of as a macro. In that way they probably could let us write the same code inside and outside a with, instead of having to transform = into But the worst offenders are GenServers. They should really have the syntax of OO classes instead of the incomprehensible handle* functions. After all that's what they are, objects with their own CPU. (Remember Armstrong about Erlang being the only true OO language?)

By the way, that would make it easier to code, to understand and to migrate people from imperative languages.

Re: Why am I interested in Elixir?

#22

The Elixir ecosystem offers a lot of interesting things. I'd like to underline those: - LiveView (which I use in production & have recommended for upcoming projects too) is a complete game changer, not because it allows to remove javascript, but because it removes a boundary (between the client & the server), making development & maintenance much faster since you only have one layer, and also making very rich feature…

I can't tell what your description of LiveView is suggesting, I will need to read about it, sounds interesting. Is it like a codebase that is implicitly split on a back-end and a browser, without the need to write JavaScript?

Re: Why am I interested in Elixir?

#23

The Elixir ecosystem offers a lot of interesting things. I'd like to underline those: - LiveView (which I use in production & have recommended for upcoming projects too) is a complete game changer, not because it allows to remove javascript, but because it removes a boundary (between the client & the server), making development & maintenance much faster since you only have one layer, and also making very rich feature…

I can't tell what your description of LiveView is suggesting, I will need to read about it, sounds interesting. Is it like a codebase that is implicitly split on a back-end and a browser, without the need to write JavaScript?

Phoenix LiveView is basically server side rendering in real time.

The user's actions are sent to the Backend via WebSocket, and the Backend rerenders (parts of) the view and sends them to the user.

Re: Why am I interested in Elixir?

#24
post #12

I'm currently building a video course hosting platform with Elixir / Phoenix and all I can really say is this has been the nicest tech stack I've ever used in 20 years of web development. IMO it really does feel like you get the best of everything (developer productivity, developer happiness, great language for creating maintainable code, OTP and the BEAM bring a lot to the table, it's memory efficient, tracing code…

> I don't think I've liked a technology this much ever and I'm honestly surprised it's not already more popular than it already is. To be honest, this can probably be almost 100% attributed to the fact that it is not backed and heavily promoted by a tech giant.

I love Elixir, but the learning curve was steep. Async everything, dialyzer, macros, Erlang errors, charlist vs string vs iolist... It was a lot to take in.

Edit: 4 upvotes in 4 minutes. I guess people are reading this... for anyone who hasn't already discovered it, the saving grace for me was the Elixir Slack channel. I also learned while working with someone who really knows Erlang, which helped quite a bit, too. If anyone learning Elixir gets to the point where they want to scream, feel free to email me. If I can help, I will! Email in profile.

Re: Why am I interested in Elixir?

#25
post #15

Earlier quoted context omitted.

> Dialyzer via Dialyxir is imperfect Imperfect is putting it lightly. I loathe it. Aside from useless errors ("here's what the success typing looks like! Ignore the any()s, and fix it! But I won't tell you what's _wrong_!"), it doesn't run against tests (which bit my ass in production last month due to some return values being ignored, and only actually matched in tests.) > especially with the error message improveme…

I agree, Dialyzer is just... horrible. It' hard to find anything good to say about it, unfortunately. Not that it's a trivial problem to solve, I get that.

As someone who quite likes dialyzer, it is most certainly not optimized for user experience :P

Re: Why am I interested in Elixir?

#26

coming from erlang elixir is much nicer than that. exunit is miles ahead of eunit and i feel like that would be enough to convince me to switch. the with syntax is nice and helps to deal with early exit on errors but still feels a bit awkward compared to imperative control flow. like you can do something like this in an imperative language: foo, err = func() if err != nil { return nil, Err("bad") } bah, err = func2(f…

You need to do it this way, it's more idiomatic:

    with {:user_created?, {:ok, user}}  
        # something
      _ ->
        # some unhandled error
    end
And so on, use an atom on the fly to identify branches and error conditions. But honestly most of the time you worry about happy paths and Let It Crash.

Re: Why am I interested in Elixir?

#27

Earlier quoted context omitted.

> I don't think I've liked a technology this much ever and I'm honestly surprised it's not already more popular than it already is. To be honest, this can probably be almost 100% attributed to the fact that it is not backed and heavily promoted by a tech giant.

I love Elixir, but the learning curve was steep. Async everything, dialyzer, macros, Erlang errors, charlist vs string vs iolist... It was a lot to take in. Edit: 4 upvotes in 4 minutes. I guess people are reading this... for anyone who hasn't already discovered it, the saving grace for me was the Elixir Slack channel. I also learned while working with someone who really knows Erlang, which helped quite a bit, too. I…

.... and no vectors/arrays.

Re: Why am I interested in Elixir?

#28
post #14
post #6

Has anyone who previously preferred static typing converted (at least for certain projects) to using Elixir? I won't even put plain Node into production anymore, TypeScript at the minimum, but otherwise OCaml or Go.

I actually started off with Elixir but now working my way up with statically typed langs, most notably Haskell. I've found Haskell's type system allows me to express complex business logic far better than anything else I've ever gotten my hands on. It's clearly superior to Elixir in that regard in my opinion, although it does come at a price (steep learning curve). That said, in a lot of other ways Haskell is not as…

Sounds like F# on dotnetcore or Reason may suite you

Re: Why am I interested in Elixir?

#29
post #27

Earlier quoted context omitted.

I love Elixir, but the learning curve was steep. Async everything, dialyzer, macros, Erlang errors, charlist vs string vs iolist... It was a lot to take in. Edit: 4 upvotes in 4 minutes. I guess people are reading this... for anyone who hasn't already discovered it, the saving grace for me was the Elixir Slack channel. I also learned while working with someone who really knows Erlang, which helped quite a bit, too. I…

.... and no vectors/arrays.

You're mostly right!

http://erlang.org/doc/man/array.html

Re: Why am I interested in Elixir?

#30

My current side project is in Elixir/Phoenix and it's sweet. Currently on 1.8. I'm hoping to move to 1.9. The language just fit my ideology better, Jose Valim just stated that the language is mostly complete. All major planned features are completed unless something come up. The language isn't bloated, it's small and sweet, and it doesn't go out of the way to add random unnecessary features to the core. I was fullsta…

The important thing to add here is that since it has powerful, hygienic, macros, there is nothing stopping you (or library writers) from adding new constructs and abstractions with zero runtime performance hit.
Post reply on HN