Live data from Hacker News

Ask HN: Who regrets choosing Elixir?

news.ycombinator.com

61–70 of 340 posts

Re: Ask HN: Who regrets choosing Elixir?

#61
post #6
post #3

One counter point to elixir is that there's a significant learning wall to onboard new developers, more so than simpler a language like Go or Python.

An extra point is that finding Elixir developers (or people who are willing to learn it) is also much harder.

I have heard this quite a bit, and it very well may be true, but it has not been my experience. I worked in a rails shop and there are tons of people that want to learn and work with elixir, but there are no jobs they can find. Likewise on Elixir forums and slack, there are lots of people looking for Elixir work, but not many people hiring for it.

Re: Ask HN: Who regrets choosing Elixir?

#62
Erlang/OTP is really cool and I found the Elixir language pretty reasonable and even nice but:

1. Elixir is still a pretty leaky abstraction over Erlang. In my experience it's not enough to learn just Elixir, I regularly had to dive into Erlang library source code to debug or answer questions. This somewhat negates the benefit of a small, stripped down syntax when you often have to learn another one in conjunction.

2. Maturity of ecosystem. This should improve over time but I've had challenges finding high quality libraries, especially for things like database connection drivers or making network requests. It's often hard to tell how well-supported or complete a library is and regressions were a regular occurrence.

3. Documentation. In practice I rarely found official documentation complete or even helpful (outside of big projects like Phoenix / Ecto). Even core Erlang libraries had surprising chunks missing. It's been awhile but I remember it being very hard to figure out what options were supported in Erlang's TLS wrapper. I ended up stitching together pieces from the OpenSSL documentation, Erlang source code, and lots of trial and error.

4. OTP overlap with other scheduling systems. This isn't a design flaw as much as a potential footgun depending on how you deploy Elixir code, but there is a lot of overlap between the cluster management support in Erlang/OTP and, for example, container orchestration in Kubernetes. Both support scheduling some concept of tasks, configuring redundant copies of tasks, detecting problems, and restarting tasks according to policy. Deploying an OTP application on top of Kubernetes (on top of Linux) results in 3 layers of OS-like task scheduling to learn, teach, maintain, and debug through, all with distinct tooling, terminology, and limitations.

All in all, I found Erlang/OTP to be a pretty interesting and compelling platform, especially for certain special purpose applications. If I ever use it again I'll probably skip the extra layer of Elixir syntax and write straight Erlang.

Re: Ask HN: Who regrets choosing Elixir?

#63

Earlier quoted context omitted.

I'm a bit confused by this comment. Having used both Ruby and Elixir (more Ruby) both languages have type systems which are quite capable of modeling domains[1]. They lack static type checking , but I find that a thorough test suite catches most type errors anyway. And while creating a thorough test suite is costly, static types in most languages [2] don't reduce this burden much: there isn't an alternative to thorou…

I agree, but I think it’s a common misconception. Having used many languages, both for very large and small projects, languages with compile time static type checking and run time dynamic type checking, I find it’s easy to rely too much on static type checking. I think what happens for a lot of programmers is that static type checking uncovers a lot of basic bugs and typos, so they feel like it has a major advantage…

This resonates with me as the first 10 years of career was using static typed languages, and saw that I and others in my circle were mostly using it as a very basic type of unit testing. This is helpful but at the cost of extra code and boilerplate. Some folks were incredulous that I shifted to languages like JavaScript and was fine with the weak typing, but tbh I'm a much better at unit testing than in the past. I've never really experienced the "omg no types" reaction that many people do. Different strokes I suppose.

Re: Ask HN: Who regrets choosing Elixir?

#64

Right tool for the right job, I think. I’ve had absolutely wonderful experiences with Elixir doing web apps (both LoB style and SaaS style). Probably the best one, and it’s such a canonical example, is a group chat app using Websockets. It just feels so good, and with libcluster, multiple nodes in K8s can autodiscover and join each other. No problems at all having chats where the members are connected to websockets o…

  let it crash != robustness not required
Let it crash is an engineering design for systems large enough that statistically unlikely failures occur regularly. Like a data center or the original use case, telephone switch centers.

Even if let it crash worked, it seems philosophically inappropriate for a drone controller.

Re: Ask HN: Who regrets choosing Elixir?

#65

Right tool for the right job, I think. I’ve had absolutely wonderful experiences with Elixir doing web apps (both LoB style and SaaS style). Probably the best one, and it’s such a canonical example, is a group chat app using Websockets. It just feels so good, and with libcluster, multiple nodes in K8s can autodiscover and join each other. No problems at all having chats where the members are connected to websockets o…

That seems odd given that the BEAM was designed for reliable real-time telephone switching

You're not wrong! I actually tried doing a bunch of research to figure out how the original Ericsson phone switches worked with Erlang, but couldn't find a whole lot of info.

Re: Ask HN: Who regrets choosing Elixir?

#66
post #14

Earlier quoted context omitted.

> I'm a bit confused by this comment. Having used both Ruby and Elixir (more Ruby) both languages have type systems which are quite capable of modeling domains[1]. They lack static type checking, but I find that a thorough test suite catches most type errors anyway. Most of this is incorrect, both for and against your argument. Elixir has a very incapable and incomplete type system. It's optional but can be checked v…

Modeling your domain using types and checking your types are two different things. Could you explain where you think the Elixir type system falls short for modeling domains? Your post only gives examples of problems with type checking.

Elixir doesn't have any concept of real tagged unions or sum types. Modelling is intimately connected to checking because when we change something (as we are wont to do) we want to have that change bubble out into the rest of the system safely. This just isn't reliable at all in Elixir.

The most potent data modelling tool you have in Elixir is a `struct`, which is just a `Map` with `atom`s for keys. You can then associate this map with an ad-hoc `atom` tag in some return value if you want, and that's as far as we can go.

Modelling behavior in Elixir is easier and better, with processes, but having absolutely zero guarantee that what you're doing makes sense when it comes to data hierarchies and composition is just not useful when trying to outline what data represent and how it can be represented.

Re: Ask HN: Who regrets choosing Elixir?

#67
We are EOL'ing Elixir at work - almost all of our stuff is built with Rails. My personal web projects are back to using Rails. I also never did contract work that produced Phoenix apps because I don't want to leave clients with something that they can't easily find support for later on.

Lots of great ideas in Elixir, Phoenix, and Ecto, but it just didn't hit the critical mass or completeness that makes the Rails ecosystem impossible to walk away from.

And because abandoning Rails is not a practical option, maintaining brainspace for an additional thing that is not widely used and nearly identical in function is not worth the cost.

Sadly.

Re: Ask HN: Who regrets choosing Elixir?

#68
If you come from the Ruby / Rails world, then you've probably developed some level of skin thickness about my biggest problem with elixir: it's dynamically typed, therefore almost impossible to write right the first x times. (For a value of `x` that's big enough for me.)

Coupled with the relative slowness of the compiler, this means your average development session is a loop of

1. trying to get something that pass syntax check

2. starting your application

3. making a request

4. `no match of right hand side...` because you had a function that expected `{:error {:ok {:foo %{bar: 0}}}` down a five-level-deep stack, and you typed `%{"bar" => 0}`, you fool ! Or maybe you typed "baar". Or maybe you did not type it, and some of your colleague did. How would she know ? `dialixir` was probably disabled a few years ago because the error messages were not helping anyone, and you're not going to write `@spec` anymore at this point.

I heard some people managed to overcome this by using the REPL, but in my experience it just means making the spelling mistakes in a terminal rather than in an editor.

Elixir is great for code that mostly does "routing" of messages from sources to sources.

Phoenix channels are a blasts.

Pattern matching would be great if the compiler could help you with the obvious mistakes.

Libraries are exactly how you would expect for a few-years-old language. Name one topic, and there are three competing libraries : one of them does not work, the other one is unmaintained, the third one has completely changed its API in latest alpha. You're going to pick the wrong one anyway.

If I could go back in time, I'd avoid writing any kind of business logic in it.

(Opinions mine.)

Re: Ask HN: Who regrets choosing Elixir?

#69

Right tool for the right job, I think. I’ve had absolutely wonderful experiences with Elixir doing web apps (both LoB style and SaaS style). Probably the best one, and it’s such a canonical example, is a group chat app using Websockets. It just feels so good, and with libcluster, multiple nodes in K8s can autodiscover and join each other. No problems at all having chats where the members are connected to websockets o…

Just curious -- were you using Nerves[0] for the drone flight controller? [0]: https://github.com/nerves-project/nerves

That was the eventual plan! I was prototyping stuff out on a BeagleBone Black with vanilla Elixir, and if the prototype felt promising I was going to bake it into a Nerves image. This was quite a while ago too; Nerves may have some bits baked into it now that might have helped.

Re: Ask HN: Who regrets choosing Elixir?

#70
Doing Elixir since 2016, deployed multiple Phoenix Projects to Production.

Of you want to build dynamic web applications, phoenix+LiveView is imo _the_ best Option currently. It also keeps the promises: reliable (zero-maintenance apps running for years on heroku), productive (prototyping things is really fast: like rails 2/3 days), fast (templates render fast even when complex). It is also great to have actor processes and ETS at your fingertips.

Having said that: dynamic typing truly sucks for bigger projects/large teams. It is awful how much you have to write tests for, and these tests will slow down further velocity when things will change... stellar opposite to Rust.

Never attempt to do any serious number crunching in Elixir/Erlang, the BEAM truly is not made for this stuff. Plan to use/write NIFs or Ports for computational tasks. Even compiling larger Phoenix codebases will take minutes if you aren’t cautious of using „import“ in modules.

Finally: deployment is really the major pain point. I love the single file deployment story of rust and go.

Post reply on HN