Hacker News new | ask | show | jobs
by brigadier132 994 days ago
Here is why I think it's not more mainstream

1. The really cool and differentiated aspects of elixir require specialized deployments. Cloud vendors are optimized for stateless horizontally scalable infrastructure not stateful infrastructure.

2. Elixir is a functional programming language and this means you cannot mutate variables. While I like many aspects of elixir, not being able to mutate state makes elixir unsuitable for any task that cares about performance at all. Many algorithms are memory bound and you really cannot justify using things like linked lists.

1 comments

I disagree with the "require" specialized deployments – we have hosted our elixir apps for years as stateless web apps, just like any other architecture.

In fact, you can build a release that's just a zip file which also contains the full elixir/erlang runtimes, that can be deployed on a barebones server (assuming the same libc, etc). It's not "single-executable" nice like Go/Rust/.NET but it's much simpler than it used to be.

The one use case we've seen for clustering things is having our cache stay in sync. But apart from that, we really haven't seen a need to cluster our nodes.

But if we wanted to, it's beautifully and trivially easy to do things in a cluster in Elixir/Erlang.

Immutable state is definitely one of the steeper learning curves to get over.

I qualified it with the "really cool and interesting parts of elixir". While being a beautiful programming language I don't think anyone thinks elixir is cool because you can use it to build rest api servers :)

I'd be curious to hear more about how elixir makes running a cluster easier from a devops point of view. At the end of the day you probably still want to use something like kubernetes right?

I suspect getting nodes to connect across the cluster is easy in most stacks nowadays, kubernetes or not.

But the idea that you can just call Module.func(), and not care WHICH node it runs in, right out of the box, is quite nice.

I would wager though that 90% of elixir/phoenix devs just aren't doing any of that most of the time, instead just using it like a more performant Ruby on Rails, with ecto being awesome too. :)

Just losing the while loop was a big one for me. I miss it often. I know the cost of calling something recursively. It's never going to be as cheep as a while loop.
There is Enum.reduce_while that I've used a couple times.

But I don't remember using while loops all that much (for loops/iterators, yes, but not while loops) in other languages.

I think I had a tougher time with the immutable stuff than anything else. I'd love to just update a map 3 levels down by saying thing.other.stuff = "new value" sometimes, but you can't. But overall it's nice to work with immutable structures.

Instead I either do a deep merge or use put_in(map, ["thing", "other", "stuff"]) but that doesn't always work as I expect.

If other elixir devs can set the record straight, I'd appreciate it :)

Some times I miss being able to do updates in the way you described.

Have you seen Pathex? https://github.com/hissssst/pathex It may not be what you are looking for. But I think it may improve developer experience in some circumstances.

Let me know what you think.

That depends on the compiler and lang implementation. What you are saying is true for Java or imperative langs. It's not true in langs like OCaml who has ergonomics around functional programming. while loops are just as performant as recursive functions and HOF.