Live data from Hacker News

Why am I interested in Elixir?

underjord.io

11–20 of 183 posts

Re: Why am I interested in Elixir?

#11
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.

Came from Java. Was an adherent to static typing everything. Dialyzer via Dialyxir is imperfect but helps you bridge the gap, especially with the error message improvements available via my Erlex library. You can turn on an optional Credo rule to require @specs for every public function, and adapt the rule trivially to require on private functions. Dialyxir is notably imperfect, but it catches a surprising amount of…

> 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 improvements available via my Erlex library

My interest is piqued. Does it help unfuck Dialyzer error messages?

Re: Why am I interested in Elixir?

#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 without a ton of experience is very doable, it's fast as balls and Phoenix channels / LiveView is a great abstraction on websockets). I find myself fist pumping all over the place as I make progress towards this app while learning as I go.

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. I've been around for the release of a lot of major frameworks and technologies (Rails / Django, Node, Go, etc.). Nothing has impressed me this much. It truly feels like it's a zero compromise environment to write code in and I hope I can still be using it in 10+ years.

Re: Why am I interested in Elixir?

#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 ideal for web development, particularly if you need clustered stateful stuff.

Typescript and friends I've never really managed to develop any keen interest on, even though Typescript itself is an upgrade over JS.

Re: Why am I interested in Elixir?

#15

Earlier quoted context omitted.

Came from Java. Was an adherent to static typing everything. Dialyzer via Dialyxir is imperfect but helps you bridge the gap, especially with the error message improvements available via my Erlex library. You can turn on an optional Credo rule to require @specs for every public function, and adapt the rule trivially to require on private functions. Dialyxir is notably imperfect, but it catches a surprising amount of…

> 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.

Re: Why am I interested in Elixir?

#16
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 generally prefer static types. Elixir is the exception. Immutable variables and structs, coupled with OTP, make it arguably as safe for me as Typescript (whose types can lie if you get unexpected data from an api that doesn't match your type definition, for example). Refactors kind of blow though. Refactors are where I actually miss types, otherwise, I don't really notice.

Re: Why am I interested in Elixir?

#17
Elixir is great. It's the most fun I've had programming. I wrote Erlang for a little more than a year, and I grew to like the idea, but found it hard to work with. Elixir is bringing me back around.

Re: Why am I interested in Elixir?

#18

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…

Not sure I understand completely your problem and I apologize if this is a stupid question, but can’t you just pattern match the errors in with’s else block?

Re: Why am I interested in Elixir?

#19
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.

Re: Why am I interested in Elixir?

#20
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 love hearing stories like yours. I wonder how Elixir would compare to Clojure, which I've used and liked for web development for many years. I hear nothing but good things about Elixir but I wonder if it would bring something new to the table for me in the "really liking it" category.
Post reply on HN