Live data from Hacker News

Ask HN: Why isn't Phoenix/Elixir more mainstream?

news.ycombinator.com

51–60 of 130 posts

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#51
post #39

I'm not super experienced with Elixir/Phoenix, but I did notice the documentation was rather disappointing when I tried to learn it, compared to Rust. I kept trying to find a tutorial for a basic web app with Phoenix, everything I could find was for an older version which wasn't compatible with/had different names and locations for the various files than the version I had. Kinda blocked me from getting more into it.

I just recently picked it up and found the official guide [1] to be pretty good. I have never read the Rust docs/book though, so I can't compare it to those.

[1] https://hexdocs.pm/phoenix/overview.html

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#52

I have been a big advocate for Elixir for 5 years before switching off. My takeaways: love José Valim and the team and the libs they produce. The team is always humble and helpful and produces high quality content in both code and documentation. Why I stopped using Elixir: I was using Elixir obsessively as a performance chasing tool, but then it just didn’t fill the gap properly: 1. Python (or other massively used la…

This is an approach I strongly believe in.

For 99% of things, language performance doesn't really matter (it's usually cheaper to just scale up). So you might as well focus on developer experience and hire-ability.

For the 1% where it does matter, drop down to something like Rust, and use the developer-friendly language above as glue.

You see it a lot in Python, where the performance of the runtime itself is kinda crap, but it doesn't matter because it's very developer-friendly. It became the #1 language for high performance data science, thanks to libraries that use C and stuff under the hood.

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#53
post #49

Anecdotally, I think Elixir/Erlang are too difficult/esoteric compared to other languages. That makes it hard to come back to after not touching it for a while, which means it'll be incompatible with a lot of devs that use other languages. When I come back to Golang, I can pick it up almost immediately, so I often use it for personal projects. It also has great concurrency primitives, which is one of Elixir's biggest…

Mind sharing a specific example of what made it difficult to come back to? Was it control flow, a specific library like Ecto, no types, etc?

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#54

I have been a big advocate for Elixir for 5 years before switching off. My takeaways: love José Valim and the team and the libs they produce. The team is always humble and helpful and produces high quality content in both code and documentation. Why I stopped using Elixir: I was using Elixir obsessively as a performance chasing tool, but then it just didn’t fill the gap properly: 1. Python (or other massively used la…

I mean, Elixir is definitely not a replacement for Rust. I imagine it as being closer to Node, Python, or possibly Java. And even then, it's a wild comparison, because of the way Actor Model concurrency is weaved into BEAM languages, in a way that no other language does.

For perf optimisations, you have Ports or NIFs (irc), where Ports are just knowingly volatile processes, and NIFs are FFIs, which is an almost universal feature across all languages.

But I suppose your experience is based on use case. And I would agree that commercial BEAM language experience is generally thin on the ground, if you're role is to build an engineering team (though I can't imagine Rust expertise being that much more abundant either).

One thing I would add, is Erlang/Elixir's emphasis on multi machine concurrency is somewhat at odds with the serverless future we're moving towards. But ignoring that (especially with vendor lock in issues), I often wonder why Elixir hadn't put a larger dent in the popularity of Kubernetes. Because BEAM's approach to managing multiple services across machines seems both much more powerful, and dev friendly.

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#55
I wrote this for Erlang about 10 years ago, and it probably still holds water: https://news.ycombinator.com/item?id=7277957

However, in 2023 rather than the 2013 I wrote that in, I'd add something else. In 2005, BEAM was revolutionary. It had things nobody else had. In 2023, it's a nicely integrated collection of a bunch of features you can get almost everywhere else, plus some features that aren't actually that important anymore because there are other solutions to the problems, even if they aren't the Erlang solutions... and most of those features are now distinctly second best.

Second best performance. Second best isolation story; we have ways of isolating things, both through convention, and with things like Rust, that don't require full immutability and the serious impact on day-to-day coding it brings. Second best messaging platform; the BEAM message bus is highly language-specific, unlike SQS, Kafka, etc., and it chose 0-or-1 where 1-or-many has been over time revealed to be generally preferable as a default. OTP is nifty, but where the Erlang community believes it must be implemented to the letter, with every jot and tittle and minor bit of functionality copied to be of any use whatsoever, in most cases it turns out some internal watchdogs + some sort of systemd-like restart (or docker, or k8s, or...) gets the job done just fine; in this case Erlang is best-of-breed, but the second-best solutions offered elsewhere do the job and the price you pay to fit into that best-of-breed can itself be an impediment at times. (Not everything can be structured as a whole bunch of relatively small communicating processes... though, admittedly, quite a bit more than many programmers may expect!) Second-best type system; I understand why BEAM's types are structured like they are [1], but after a lot of experience, the static type world has figured out to have both static types and upgradability, if that's what you need. Other features, while nifty, like process restarts with new code, just turn out to be more niche than the brochure may advertise. That's a super important feature for phone switches, yes, absolutely, but it's never actually been something I need, and that despite the fact I've done "real network code" beyond just web APIs. It's not like Erlang made my deploy process go away, it just made it different, and I don't miss not having hot restarts in practice. And I could continue on for some more features, I think I made the point though.

I also suspect the BEAM stack has a very leaky bucket now. Yes, there's definitely people who pick it up and find it very impressive, but I also expect there's a lot of people who pick it up, perhaps with a bit more experience in even one of the spaces BEAM plays in, and notice that the solutions are second best and they need something it doesn't provide well, and quietly put it back down again without putting up blog posts. For instance, if you're already hooking up to a cloud message bus and using k8s or something to run a cloud of lots of small instances, you are, frankly, 80% of the way to Erlang already, in most of the ways that count, so switching to Erlang generally comes with all the disadvantages that switching to any language would entail while not bringing all that much to the table to compensate for it. Likewise, are you heavy into serverless? It may be a completely different solution, but it leaves nothing much in the problem space for Erlang. You no longer have the problems Erlang was meant to solve. (You have different problems.)

So, I'm answering the question "why isn't it more popular", not "why does it suck". That's because it doesn't "suck". It's a fine and viable solution to many problems. While I am critical of the now-second-best nature of many of its features, the integration itself is a feature that very few other platforms can compare with! While I can find every feature now in other languages and environments, I will be putting together a stack of my own somehow, which can be beneficial, but is also definitely a cost of its own too. But other than that, BEAM doesn't bring much special to the table anymore. It is very easy to put together a stack in many other languages that exceed it in one or more dimensions, and those are often the dimensions you care about a lot (performance, static type safety, language-agnostic message busses for heterogenous deployments, there are languages/runtimes now better than even BEAM at managing tens/hundreds of thousands of simultaneous connections now... any of these can easily be a determinative factor). But its bucket has a thousand little cuts in it for the water to leak out of. No one big gash by any means, but a lot of little holes.

[1]: https://news.ycombinator.com/item?id=37261154

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#56
We have switched to Elixir and Phoenix as our go to stack gradually over the last 5 years. We've found that LiveView in particular, with it's ability to avoid a separate front-end framework altogether, has let us deliver applications to clients in a significantly more productive way. We were a rails shop back in the day, and were able to build things very quickly. When the whole front-end framework thing got big, it slowed us down a lot because we were building two applications, essentially. Now that we are able to go fast again we (and our clients) are enjoying things a lot more.

I should also say that if you do need to use a separate front-end for whatever reason, I've built a thing called LiveState: https://github.com/launchscout/live_state that lets you keep things far simpler and gives a "LiveView like" experience.

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#57
post #37

I have been a big advocate for Elixir for 5 years before switching off. My takeaways: love José Valim and the team and the libs they produce. The team is always humble and helpful and produces high quality content in both code and documentation. Why I stopped using Elixir: I was using Elixir obsessively as a performance chasing tool, but then it just didn’t fill the gap properly: 1. Python (or other massively used la…

> Elixir has very few engineers to source from. this : http://www.paulgraham.com/avg.html comes to mind.

I guess my point would be that Rust is also could be considered an esoteric niche language with a lot fewer engineers than Python, but I would choose Rust over Elixir because of the benefits.

I think PGs advice really depends on the founding team. Now it’s quite common to have only semi technical founders that make an engineering hire instead of the founder being an engineer, because languages like Python and JavaScript have commoditized the initial CRUD aspects of launching a product.

If your product is more technical and low level it makes sense, but if your building a HTTP SaaS app that connects to a database then chances are the difficulties and differentiation happen on the Product/Design level, and much less so on the engineering level unless you make it big.

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#58
Oh, and as far as the "shortage of Elixir developers". Unfortunately with layoffs in the startup community it's probably easy to hire just now. Even when that was not the case, we've had great success with brand new apprentices picking up the language and being productive very quickly. We recently had an apprentice go from brand-new to keynoting Elixirconf in two years. She is super amazing, but still, other apprentices have also done very well.

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#59
post #6

The trend right now is AI, which is mostly written in Python. Most people want to write their whole stack in 1 language, whenever possible. So people just default to Python servers and React clients. There is tooling like Carton being developed to work around this, but the gravity is always towards monolanguage stacks. In the past the incumbent would get stiff and lose resiliency, like Java or C. That's when a shiny…

> Most people want to write their whole stack in 1 language, whenever possible. So people just default to Python servers and React clients.

Haven't you just contradicted yourself there? That's two different languages and two different stacks.

Ironically if you were using Elixir the default would be to use Liveview so you'd use a single language.

Re: Ask HN: Why isn't Phoenix/Elixir more mainstream?

#60
There are a few factors.

Most devs are trained in OO approaches so you have to learn to think about problems from a functional perspective. While a lot of people believe that the functional approach is a huge win (myself included), asking developers to both use a different language AND think about problems differently is a leap.

Truth be told, I was blissfully ignorant of how many concurrency issues non-BEAM languages truly have until I learned Elixir. Now I can't unsee them.

While there are a lot of polyglot devs out there who are happy to utilize a different language for its strengths, there are also a lot of developers and companies who are both time and emotionally invested in their language of choice. It's not exclusive to a particular language, it happens everywhere.

One of the unfortunate things that accompany languages that are able to do more with less, is that the companies which succeed with them...need fewer developers. There are a lot of hugely successful companies using Ruby on Rails, just as an example. Even today, you will see people fight tooth and nail against using it either because: A) They want to use their stack of choice or B) They don't understand why it's a better choice for the job.

In language terms, you win developer eyeballs with 1 easily quantifiable thing...benchmarks. X is faster than Y in benchmarks, a lot of developers will want to use X.

Quantifying productivity is harder (Ruby). Quantifying advantages of concurrency, clustering, heap isolation, maintainability with very high productivity is harder (BEAM). Benchmarks are easy.

Widely adopted language selling points as a comparison for what Elixir is up against:

- Java is taught in schools, heavily adopted in enterprise, portable, fast. It's okay at everything.

- Python is taught in schools, installed by default on Linux. It's okay at everything.

- Javascript is the only language available in browsers and has a selling point of using the same language on the client and server. Widely adopted despite a huge chunk of people who hate it.

- .NET gets the entire backing of Microsoft, usage on Windows and a natural selling point with the various Windows shops out there. It's widely useful on those platforms and has an invested and certified following.

- Apple languages are similar to .NET selling points.

- Go is portable, pretty fast has a low learning curve, fast compiler (productivity win) and the closest concurrency model to the BEAM as well as backing of Google which lets execs rest easy.

I can definitely make a case for why Elixir is a better choice for most of the things you'd use these language for, except mobile apps. But even then, there is going to be an argument. People will defend their choices and you won't see much progress. And somebody will ask for a benchmark, which Elixir won't win because it's not designed to win straight line benchmarks.

Post reply on HN