Live data from Hacker News

Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

news.ycombinator.com

121–130 of 297 posts

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#121
Unfortunately I can't comment on production Elixir use (yet), but as a proffessional Ruby engineer of 6 years and an Elixir hobbiest of 3, I think that Elixir's biggest drawback is its deceptively high learning curve.

The learning curve is "deceptive" because the Elixir syntax is very easy to pick up for someone familiar with Ruby and, once you get over the functional "gotchas", you can feel productive very quickly. Especially-so given how much you get out-of-the box with a standard "mix new" project.

The learning curve is "high" because in order to actually write Elixir in a way that scales well in prod, you'll need to get comfortable with Open Telecom Platform principles like GenServer and Supervisors, which will likely feel very foreign at first.

For any Rubyist working in Elixir, if you encounter a situation where your Ruby brain wants to start browsing Hex for a library, you should probably answer these two questions first:

1. Can we do this easily with GenServers? 2. Is there an Erlang standard library module that already does this?

Conversely, if you jump in expecting to rely on Hex the same way you rely on Rubygems, you're in for a bad time.

Ultimately, I think you really need someone (ideally two someones) who is comfortable with the Actor Model and OTP in order to use Elixir successfully at a business.

But if you can build that solid OTP foundation for your project, there's a decent chance you're in for a good time.

The real-word business cases provide some encouraging examples of that: https://elixir-lang.org/cases.html

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#122
We started to use Elixir around mid 2016, we were mostly using rails/sidekiq stack at that point and started to face scaling issues with sidekiq. Moved small parts to Elixir first and then later started to use it for most of the new services. We had to create new libraries for some specific use cases. Apart from that, it was mostly smooth experience. We rarely had to tune or adjust the code for performance. Today we have a big monorepo with 20+ apps. My long term concerns are more about whether the tooling will work if we try to scale it to 100+ apps with a single monorepo.

We majorly depend on Plug, hackney, Exq, brod and Ecto.

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#123
post #99

I love Elixir. But… Five years ago I spent time learning Elixir on the side thinking I was investing in an upcoming technology that would pay off for me financially. I eventually built some services in Elixir at work and really enjoyed it. They performed well but the language didn’t catch on with the rest of the team. However, five years later the mainstream languages (Ruby, Go) are still paying more. I still get rec…

Interesting, I've had the opposite experience. I get paid a ridiculous amount for Elixir work because finding experienced Elixir devs is so difficult. Most of the job offers I get for it I avoid because I think "there's no way this company is going to last longer than a year paying that much for developers".

I'd love to know what the going rate is for experienced Elixir developers. I'm interested because I'm toying with a side-project and can still choose the stack after the prototype, and I'm also a developer that knows both Rails and Elixir.

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#124

I use Erlang, Is Elixir a better alternative now?

Answer is always no. Erlang is not better than Elixir. Elixir is not better than Erlang.

- documentation

- testing

- Tasks (they are way better than proc_lib)

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#125

Earlier quoted context omitted.

I am bummed out to see that this is the top comment. I don't doubt your experiences but I hope that other people do not latch on to this and use it as a strong argument against using Elixir. All of these complaints are skin deep and kinda petty, to be honest. > Tooling is just terrible. The VSCode plugin is crap, kills the CPU unless you disable features. There is no IDE from jetbrains. This is a bizarre criticism of…

> This is a bizarre criticism of Elxir the language. There are a lot of developers out there who prefer a more lightweight editor and do not want the bells, whistles and crutches of a heavy duty environment. Right, but...there are also developers out there who do want those things. It feels very dismissive to dismiss a complaint like that as "petty" just because there's a set of people who don't have the same needs.…

Exactly. One of the MOST valid criticisms of a language is the way (or lack of ways) in which it can be used.

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#127

It's not argument "against" selecting it (it's a free world, and mileage vary), but a couple of scar-earned advice: - Be careful about libraries. If you know that your system has to interact with X, don't assume that there is a running, idiomatic, maintained libary for X on `hex.pm`. Do a bit of due diligence. We had experience ranging from `meeh` (oauth2, graphql, http) to `pretty bad` (mqtt, swagger.) But as other…

If you're aching for typespecs in Elixir being useful, but are dissapointed with Dialyzer, I recommend checking out my library Hammox: https://github.com/msz/hammox. It's an improved version of Mox, the de-facto mocking library for Elixir, which you can use to automatically assert in tests that your mock calls, or any function calls, fit your typespecs.

I personally found that with rigorous enough usage, I don't even miss having actual static typing anymore ;)

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#128

Earlier quoted context omitted.

I am bummed out to see that this is the top comment. I don't doubt your experiences but I hope that other people do not latch on to this and use it as a strong argument against using Elixir. All of these complaints are skin deep and kinda petty, to be honest. > Tooling is just terrible. The VSCode plugin is crap, kills the CPU unless you disable features. There is no IDE from jetbrains. This is a bizarre criticism of…

Don't focus on tooling, focus on their complaints about not having enough senior engineers familiar with the language. We're in a similar boat. I don't know the full history of how we came to use Elixir, but I would wager that early on in the company, someone really loved it and evangelized it. But now, we don't have that many senior people who know it well. I can count the ones I talk to regularly on one hand, and o…

What do you think has been the difficulty for people at your company learning it?

I encounter a lot of devs, especially experienced devs who pick it up very rapidly compared to what I've ever seen with JavaScript, ObjC, Rust or other most other languages I've spent time with.

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#129
post #31

My company is moving away from it. We built a few services but after a few years some of the original people that introduced it left the company and it became very difficult to hire for. New hires were either people wanting to learn (so we had to spend a good bunch of resources into teaching + end up with a system built by noobs to the language) or very expensive developers with a lot of experience in erlang and elix…

"Also, I've read some comments where people mention "we don't need redis", "we don't need workers" everything is so much easier. That was our thinking at first. But then you realize on deployments you will lose your cache, or your background jobs, etc. So you have to persist them either in mnesia or in the database. At that point you're just reinventing your crappy undocumented and untested version of delayed_job... Most of what you get from elixir in terms of redundancy, high availability, etc you can have that anyway from kubernetes, heroku or any PaaS.... you will need more than 1 server anyway, so..."

I used Erlang for 5-6 years in a production environment in a deployment that wasn't the world's biggest, but did seriously need clustering because we needed more than one machine to handle the load, not just redundancy. This comment leads to my core observation about the entire ecosystem for anyone considering using anything in the Erlang ecosystem.

Erlang started in the late 1990s. Joe Armstrong was brilliant, and I would imagine was also surrounded by some other very smart people whose names I do not know. Despite what I'm about to say, let nothing I say be construed as disrespect for either the language or the people making it.

Let me set some context here. C++ ruled the day, and still looked to inevitably replace all C. Python, Perl, and the entire dynamic scripting language category had just been invented. Java was in the news, but not on your computer yet. Haskell... pre-monadic IO... had just been standardized somewhere in here. Threading was possible but was every bit the nightmare it has been presented as, and you had to be careful spawning more than single-digit threads because of the resource consumption. Open source was just beginning to be A Thing... that is, it had existed in its embryonic form for decades, of course, but it was just beginning to cohere into the Linux world we know now. Machines were still measured in the hundreds of megahertz and the single-digit megabytes of RAM.

Erlang was a far more radical departure from anything else in this era than it is today. There was a lot of academic work on this stuff, and there was a lot of very specialized high-end work on multiprocessing, but it wasn't being done by "mere mortals" and it wasn't very simple. Erlang's designers looked out into the world, and what they saw was a huge jungle, where what maps we had had huge regions that just said "Here There Be Dragons". And they started in, hacking and slashing and slicing their way through, guided by a few intuitions and a whole lot of engineering firepower.

And they largely succeeded in creating a settlement in the wilderness. They grew and managed to pave over the hack & slash paths into roads, built a community, built a pretty incredible VM, built an ecosystem around them. Let this accomplishment not be underestimated; this is a land that had eaten many others in that era.

However, sitting here in 2021, this is no longer a wilderness. Much of the area has been razed, highways driven through it, McDonald's by every exit, and millions of people living here in various bustling metropolises.

And I think what we've found is that where Erlang plopped itself down is OK... but not more than that.

As a consequence of its isolation, Erlang bundles a lot of things into itself that just didn't exist back in the day. It bundles in messaging passing and a network-aware message bus, almost literally decades before anyone else even thought of a "message bus" as a distinct product segment. (i.e., they existed, you could find academic discussion and some early passes at it, but it wasn't really a distinct category yet.) It has a threading environment. It has these "supervision trees" idea which are cool. It has immutability at a time where Haskell was even crazier than it is now. It has a mechanisms for bundling and distributing applications. It has this entire alternate-reality ecosystem in it. But...

... in 2021, none of these are best-of-breed anymore. Many of them are deeply quirky. Immutability is cool, but we only needed to not be able to pass mutable references on the message bus, not be fully immutable within an Erlang process. I believe Elixir fixes this one. A modern message bus going between processes gives you this whether you like it or not because it also can't carry mutable references between OS processes and systems. Having a message bus integrate into the language is a big mistake, because it makes it hard to hook up anything but Erlang nodes to Erlang. (I say "hard" and not "impossible" because I know it can be done, but it's hard.) A modern message bus like Kafka or the dozen other choices doesn't impose an implementation language on you, nor does it impose that implementation language being the only one. Process restarting is a necessity for production-grade systems, but we've settled to a large degree on OS-level handling for restarts, and within a system, there are easier ways to accomplish the goal than bring in the entire Erlang supervision setup. Mnesia, a clustered DB was a neat idea, but in 2021 is so poorly featured and unreliable it doesn't even qualify as one anymore; nobody in their right mind would bring up an Erlang cluster just to back some other language's code to Mnesia as a database. Pattern matching is cool, but not cool enough to justify all the other issues that come with it, and proper use of other language functionality is often good enough anyhow. (I don't tend to miss it; I tend to properly use some form of polymorphism instead. Trivial pattern matching is replaced by this, and to be honest, non-trivial pattern matching is probably a code smell if not an antipattern; if you're reaching three levels down into a data structure, you know too much about that data structure!) Modern Erlang performance is meh; it used to have the clear advantage when dealing with lots of sockets but now there's a lot of things that can comforably exceed it. Its type system is an annoyance even by dynamically-typed standards, if you like static types than just stay away. (They will cite Dialyzer, but it isn't anything remotely resembling a replacement.) And if I reviewed the docs I could find a few more of these, plus I find there's a lot of cases where Erlang has solutions to problems only Erlang has in the first place, e.g., "gen_server" is neat, but the entire gen_server set up, with its initialization phase and its three proscribed ways to call it and the need for an explicit "gen_server" module type are largely the creation of Erlang in the first place... in other languages you generally get the functionality packed up differently but it's all there without having to exactly match what Erlang does.

So, in 2021, the problem is that going into the Erlang ecosystem tends to lock you into a whole package of things that vary from "not best of breed but mostly OK" to "significantly inferior to the modern alternatives". All it really has is very nice integration of its not-best-of-breed stuff, but even that kinda becomes a trap after a while, like when you realize you need a real database after all, then maybe you have to integrate with another message bus so you can integrate with non-Erlang code, and, you know, a couple more cycles around that loop and you'll really regret having chosen Erlang.

One thing that I think it has going for it, and why it's probably still got a cult following today, is that if you're a relatively new developer, or not experienced in network programming, it is a heck of a trip when you get into it, because the tutorial will introduce you to half-a-dozen ideas you've never seen before. Cross-server message buses? Amazing! A network database with an easy API? Amazing! Spawn a million processes on a commodity box? Amazing! I think this explains a lot of the appreciation it gets today. But no longer are any of those things unique. It's just that the normal developer lifecycle will tend to encounter those, one at a time, over the course of years, instead of having them all thrown at you in one amazing, mind-blowing language introduction.

But in 2021, you can do not just "better" than Erlang for all of them, you can do much better. Except that whatever you put together will be something you had to put together, and it won't be quite as nicely integrated. But it will allow for multiple languages, it'll allow you to better integrate with the direction modern ops is going, it'll scale better both internal to your language and in terms of performance, and you'll be better able to hire for it.

The Erlang ecosystem was brilliant and far ahead of its time. I honor it as an incredible pioneer and recommend, even after everything I said, that anybody thinking of writing some incredible new language spend some time in the Erlang ecosystem to see some of what is possible with that sort of integration. But I can't in good conscience recommend it, in either its Erlang flavor or its Elixir flavor (or its Lisp flavor or anything else) to a modern developer. Everything Erlang does is much better done now by other things, minus the language/ecosystem lockin. This is not because Erlang lost, it is because it to a large degree won. It blazed a trail, and we all now agree, it was a trail very worth blazing. But the next waves of settlers & builders ultimately have created something better.

Re: Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?

#130
Somebody posted my post which sums up my experience a while ago[0]. In short: No regret, just make sure you are not building something that can be done twice faster with an existing Ruby library or so. But for a long-term team project, I would prefer Elixir codebase.

[0] https://news.ycombinator.com/item?id=26702222

Post reply on HN