Live data from Hacker News

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

news.ycombinator.com

71–80 of 130 posts

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

#71
post #66

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…

Rust isn't really showing the kind of adoption rate required for long-term success (at least not that exhibited in the past by almost all languages that have achieved long-term success), either. Early adopters tend to be fickle, it seems.

Large companies like Meta, Google, etc have Rust as part of their official stack. The market cap of companies that have Rust listed is pretty significant compared to Elixir.

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

#72
post #4

I made a fair amount of money with Phoenix and Elixir and I like them. My take is that what's hindering their further expansion to mainstream are: Elixir is not curly braced and it's not object oriented. Those two alone make a big difference in familiarity. The vast majority of developers are using curly braced OO languages and it takes less effort to learn another one. I was coming mostly from Ruby and Elixir was de…

> I made a fair amount of money with Phoenix and Elixir and I like them. As a consultant, startup founder, employee?

Consultant.

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

#73
I feel it's because the main draw of Erlang/Elixir and the BEAM, was scalability. Since the time Elixir was introduced, the Cloud system vendors have developed many solid alternative answers to the scalability question, with products that don't even require developers to learn a new language.

The soft-realtime and failover concepts that Erlang/Elixir champions are still features that are unmatched elsewhere though. I have less experience with Phoenix, but writing a WebSocket server in Elixir with Erlang's Cowboy feels like the best possible way to write a WebSocket server. In fact, in that context (which is admittedly narrow), I think Elixir might be the best possible tool available for WebSocket server programming. Even if it's only used on a single machine.

I also see the Elixir team making efforts to push into the ML space. If they can develop a user friendly solution to Distributed Model Training, based on OTP semantics, I can imagine Elixir pulling some attention away from Python.

But tbf, to get the most out of the Elixir, you need to learn a little about OTP, which is very different. In fact, while I won't go as far to say learning Erlang is a prerequisite to learning Elixir, it helps alot, and that can be intimidating.

And if you're doing webdev work, then Elixir would mean that you also have to manage / maintain your own servers too. Then there's the niche status of all BEAM languages, but that's the 'network effect' I guess.

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

#74
post #61

Honestly, after years of writing python I have now gotten to a point where I fear dynamic typing. The fact that Erlang and Elixir do not have static typing, outside of a voluntary type checker, makes me worry about using them. And yes, the approach to error handling in Erlang and Elixir is "let it crash" etc. The runtime debugging tools are excellent. There's approaches to design which ensure that even if there's som…

This is a concern that I hear a lot and it really doesn't impact Elixir projects. You're getting the same thing in different ways thanks to pattern matching.

The defacto pattern matching approach for everything gives every function an interface and you still get strong typing for all of your core types too (numbers, strings, bytes, etc).

You just don't have static typing, but the typing that's there is significantly stronger than dynamic languages and IMO it has the perfect blend of wins from static typing without the flexibility impairments that come with it.

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

#75
i don't find all-in-one frameworks attractive at all.

the frontend/backend split is the easiest way to separate concerns, and ever since the first frontend frameworks i never wanted to go back to the old way of having them integrated.

the pros of keeping them separate are that i can often reuse the backend for multiple applications/websites, or replace the frontend while keeping the backend, and inversely, i can replace the backend if needed without changing the frontend, and therefore without affecting the user experience. i find this flexibility invaluable.

i also prefer to write frontend code in native javascript, although that depends on how well the transpiler/framework works in helping me find errors browser errors in the original code.

using an all-in-one framework almost always means that i have to start from scatch for a new project because the reusability is much more limited.

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

#76

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…

It's worth noting that the pattern you describe here is an emergent property of programming languages that changes with the era:

http://www.paulgraham.com/pypar.html

Sadly, the culture of programming language choice in commercial contexts has changed a lot in twenty years, but you can replace python with rust or elixir because programming language choice is a good proxy to understanding insight, intuition, and intelligence.

I like python, but if the broad preference mattered, we'd all be running J2EE apps today. My reasons for choosing python around Y2K were as philosophical then as they are now.

Where your argument goes awry is that what matters is how the programming language catalyzes better interdisciplinary team communication. Code tells a story that, the easier it is to read, the clearer the story gets, and that pays unforeseen dividends in development, deployment, debugging, and distribution.

Computer optimization is straightforward by comparison to scaling human commercial endeavors.

“Programs are meant to be read by humans and only incidentally for computers to execute.”

― Donald Knuth

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

#77
post #66

Earlier quoted context omitted.

Rust isn't really showing the kind of adoption rate required for long-term success (at least not that exhibited in the past by almost all languages that have achieved long-term success), either. Early adopters tend to be fickle, it seems.

Large companies like Meta, Google, etc have Rust as part of their official stack. The market cap of companies that have Rust listed is pretty significant compared to Elixir.

Significant compared to Elixir, alarmingly low compared to languages that truly made it. By the way, the moment when large companies start adopting a language is critical. For a language to make it, it must spread like wildfire inside those companies; if it doesn't, that's a huge negative signal to more cautious observers.

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

#78
post #68
post #53

Earlier quoted context omitted.

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?

There were several things: * The entire model of state with Genservers * Pattern matching made my code unreadable * Libraries that I needed had Erlang documentation I created some pretty gnarly code when pattern matching authorization cookies for some Plug middleware I made. Plus I had to dive into some Cowboy stuff, which had really awful documentation at the time. "Just use Phoenix!" is what most people will say. B…

About your pain points

* The entire model of state with Genservers

Yes and no. They are very useful. Too bad that they insisted following Erlang with that handle this / handle that nonsense (sorry if it sounds snarky) instead of building a better abstraction for the usual scenarios of creating a de facto object and calling methods to mutate its state.

* Pattern matching made my code unreadable

Pattern matching actually made my code much mode readable. I had a large web app with less ifs than the fingers of my hands. I wish I had that kind of pattern matching on function definitions when I code in Ruby and Python for my current customers.

* Libraries that I needed had Erlang documentation

This is true. The point is that many Erlang libraries had no Elixir version. Maybe the new languages on the JVM had the same problem with Java jars. Luckily translating from Erlang to Elixir is almost a 1:1 syntactical matter so it's usually easy to understand what a library does.

Edit:

> What if I want to scale a specific worker up/down?

Running BEAM inside docker was getting popular the last time I developed in Elixir with Phoenix. The project I was working on was considering to run the app in a Kubernetes cluster. We already had workers running in a docker container but I can't remember how we were spinning them up. Some service on Google Cloud.

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

#79

for me its hard to justify betting on something without a compelling edge computing (eg cf workers) story in 2023. i could not even think of a case where beam would be the right fit for a webapp/webpage except maybe a static rendered status page for something that runs on beam anyways. and i say this as a diehard erlang fan who would love to have a justification to use it more. of course there are plenty of services/…

> for me its hard to justify betting on something without a compelling edge computing (eg cf workers) story in 2023.

fly.io? https://news.ycombinator.com/item?id=28621478

> i could not even think of a case where beam would be the right fit for a webapp/webpage except maybe a static rendered status page for something that runs on beam anyways.

LiveView / the "PETAL stack" are my first choice for web applications due to productivity & developer experience. Great summary here: https://thinkingelixir.com/petal-stack-in-elixir/

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

#80

Earlier quoted context omitted.

For a Phoenix application, a Ruby on Rails developer will be able to pick it up pretty fast. Usually just takes one or two pair programming sessions going through the full MVC flow with test-driven development and they're good to take on most tasks. Then reading up some of the official Getting Started Elixir docs fills in the gaps, particularly understanding how a Process[0] works, working up to Tasks/GenServers/Supe…

The discussion is why isn’t it more mainstream not is it good. Like you said it’s mostly senior expensive engineers. They are really good, but is it worth it? Do 90% of startups need it? I have had success hiring younger inquiring Elixir engineers also, but the question is about why isn’t it mainstream not how to find a diamond in the rough. If you are running a company today the fact of the matter is Elixir a a exec…

Really appreciate your focus on economic reasons. That indeed makes a lot of sense.

I guess the gamble to use Elixir/Phoenix only pays off in certain circumstances and if your business grows in such a way that you can simply afford to hire more expensive devs in later stages of the journey.

Post reply on HN