Live data from Hacker News

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

news.ycombinator.com

51–60 of 297 posts

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

#51
post #23

We chose elixir in 2016 for our product and never regretted it. Apart from application bugs we’ve caused, it just keeps chugging along and working beautifully. It’s never once been the bottleneck in our stack. Finding people has not been tough at our scale, and they’ve been good quality. We are just scratching the surface with OTP. And between that and the data processing tools, we know we can handle pretty much any…

55 / 2.62 (millions of seconds in a month) ~= 20reqs / second That's not very impressive, you could achieve that easily on something deemed "slow" like Django or RoR But I guess your load is not constant. How many reqs/sec can it handle in the peak time?

> 55 / 2.62 (millions of seconds in a month) ~= 20reqs / second

I'm pretty sure Java 1.0 running on an Amiga could handle that...

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

#52
The more I use and learn languages the more I prefer Elixir's (to be honest, Erlang's) programming model. I'm not a types person (yet) so that is not as important to me as the building blocks and how it allows you to organise programs.

I think the first question you should ask yourself is, do you expect the same level of "pick a lib, drop a lib" as you would in RoR, or Nodejs? I haven't had any problem with libs, basically because I'm ok with writing http requests if I need to, or do an auth flow myself - it's not like those things are complex - but the first times it might take you more time than just picking something off that works immediately. On the other hand, the core of what I usually need, is pretty sturdy and extendable - Phoenix/Websockets/Ecto(Postgresql, you might have a different exp with other dbs)/Oban and the standard lib/erlang for all sorts of things that in many languages require external libs (or aren't really doable without taking a sabbatical).

Also I don't know if I live in a parallel world, but in many other languages, even ones with pretty heavy investing, many libraries that aren't just translating http responses into whatever language representation of that, are subpar, or not extendable, or you need to almost learn a new language to use them, they're solving things that shouldn't be a library. There's plenty of good libraries out there, including in nodejs, but comparing for instance its ecosystem is kinda pointless, when perhaps 90% of the libs in there don't really warrant existing, or are to cover basic shortcomings or don't solve really anything, or are specific to being run in a browser.

The second is, are you curious enough about the underlying mechanics and learning the programming model? This is sort of essential, because in most languages/VMs everything is sort of a single program, where all things sprawl from a form of "main()", and in Erlang you organise (or should) your application as many different "main()"s, it's almost like an OS. It's still obviously started from a single point, but once started it's like having multiple applications running in a concerted fashion. There's a curve to learning how to leverage that - and to be honest, not all problems require that - although again, the more I see other languages and use them the more I miss the structured form of programs it allows.

The third is, it's a functional language - if you're not used to it in any way some ways of solving problems might not be apparent immediately - they're not more difficult or complex, they're just different - for me solving problems with OOP is also not straightforward - it doesn't mean it's worse, I just don't practice it as much as I do functional programming. There's also obviously problems that are much better expressible with mutable data, but you have enough scape hatches for those cases that really need it - on the upside there's also plenty of problems that are better expressed in functional languages.

Lastly, some useful patterns and ways of doing things require some "acclimatisation", like using pattern matching to describe functions, conditions, and execution paths, ditching almost completely (almost) exceptions and throws in favour of tagged returns, building reliable sync/async flows etc. The testing history in my view is excellent, as are the tools it includes, mix, iex, releases, and overall I would say it made me a much better programmer. I also would take some people's shitting directly on the language or libs complaints with a grain of salt - I've seen a fair bit of idiotic uses of stuff in it (like holding a hammer by the head), and in those cases ask yourself if the libraries and programs other's use or suggest instead are good software and evaluate them in the same context - complete external tools run by companies vs basic stdlib functionality.

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

#53
I’m very satisfied with Elixir. I, a longtime Ruby on Rails developer, learned Elixir on the job at CityBase and have been thrilled with it every day.

The first thing that tripped me up with Elixir is the difference between single quoted and double quoted strings. They’re different data types!

Most of the work I’ve done has been writing JSON or GraphQL apis that react apps consume. We’re about to start using Phoenix LiveView.

I like using Phoenix + Ecto. It’s lightweight and very fast. I learned Ruby through my work with Rails, and I did not have the same experience with Phoenix. And that’s for the better.

Deployment-wise, we moved from Edeliver to Kubernetes and it’s worked great.

I need to figure out the right editor experience for NeoVim, I haven’t gotten an LSP to work just right. Sometimes Dialyzer is a pain in the ass. Also, I’ve had some issues installing erlang via ASDF lately and sometimes I’ve had to use homebrew symlinks to skip that problem.

I recommend that OP give Elixir a shot and see what you think. There’s also very nice community on the Elixir language slack server.

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

#54
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…

> Specially now we are using all the hotwire stuff. Maybe I'm missing something, but doesn't this have precisely the same latency characteristics as live view? I do agree that some of the "you don't need redis" and similar are overblown (particularly claims about tasks replacing background jobs), but I think there is truth to these claims in the following sense: Particularly in Rails, Redis gets used not just as a to…

Liveview (as well as stimulus-reflex) promote minimal JavaScript by trying to push most interactions to the server, and let the server decide what should change in the frontend. So for example, to show a modal, you send an event that signals the user wants to show a modal, so the backend sends back the html for the modal. You click to close the modal, this sends an event to the backend, the backend sends you the diff or the instructions to remove the modal from the dom.

In the hotwire world, the encouraged approach would be to already have the html in the dom, and use a stimulus controller to show or hide it [1]. And you only issue backend calls when you really need to reach to the backend anyway (like submitting a form, or refreshing some actual content). You don't call the backend just to signal a button was clicked so that the backend removes html if you can already do that in the frontend. Hotwire is not about avoiding JavaScript, hotwire is avoid organizing it well and reducing the amount you need.

Of course you can do things wrong on both approaches, but it is what one approach promotes vs the other.

As an example of why this is a problem, see this [2] example. I'm in Europe on a fiber connection, and clicking in one of the calendar days, and closing the modal feels just so terrible....

[1] https://tighten.co/blog/stimulus-101-building-a-modal/ [2] http://expo.stimulusreflex.com/demos/calendar/2021-05-01

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

#55
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…

> Specially now we are using all the hotwire stuff. Maybe I'm missing something, but doesn't this have precisely the same latency characteristics as live view? I do agree that some of the "you don't need redis" and similar are overblown (particularly claims about tasks replacing background jobs), but I think there is truth to these claims in the following sense: Particularly in Rails, Redis gets used not just as a to…

> Maybe I'm missing something, but doesn't this have precisely the same latency characteristics as live view?

There's an open GitHub issue on LV which mentions when using live_redirect you're paying a very large penalty in page load speeds due to extra latency being introduced by LV: https://github.com/phoenixframework/phoenix_live_view/issues...

Before this issue existed my non-scientific impression was the same. There was something that felt off when using sites that primarily used LV for navigation and loading content. It always felt like I was clicking, waiting a noticeable amount of time and then the content would appear -- even with a decent ping time (I never experienced that type of delay when using Turbolinks and now Hotwire Turbo with comparable ping times to a server.

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

#56
I've been using Elixir for 4+ years, and I'm very happy with it. I'm a one-man band, so the talent pool isn't an issue.

My biggest joy is that once you get the application working, it stays working. I have ~20 production nodes, and they all just happily run. This was not my experience with Ruby and Rails.

It's not fun to try to interpret Erlang crash dumps, though.

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

#57
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…

> Specially now we are using all the hotwire stuff. Maybe I'm missing something, but doesn't this have precisely the same latency characteristics as live view? I do agree that some of the "you don't need redis" and similar are overblown (particularly claims about tasks replacing background jobs), but I think there is truth to these claims in the following sense: Particularly in Rails, Redis gets used not just as a to…

The trick is to use liveview for data that needs to come from the server anyway. I'd guess that the OP did use it for everything, like popups etc and did not do the same with hotwire.

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

#58
post #17

Nice question, I'm just starting with Elixir for a side project. Has anyone else find it to have a steep learning curve? Coming from Java/Scala and Python, I find it harder to wrap around then Scala was years ago. Shortcuts with mix like mix phx actually make it a bit more complicated for me because I'm used to understanding what is exactly happening under the hood.

Getting hang of functional programming takes time. Writing code elixir way requires unlearning what you have learning from imperative languages.

I've used ocaml in the past and I not new to functional programming, but the whole Phoenix framework is somewhat confusing.

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

#59
There are things about Elixir I love, most of which come from the Erlang language (esp. their processes and gen behaviors). There are those I dislike (tooling is not where I'd like, tracing to underlying Erlang is hard sometimes).

There are projects where I'd choose Erlang or Elixir (typically M&S or HPC efforts where the processes really come into play, or real-time mission critical efforts where every minute of downtime could cost lives).

Most other projects are based on what the shop I'm in uses, or my personal preference for the task. I'm finding I'm choosing Rust more and more, outside of my day job, which is strictly C++ at the moment (but we're investigating Rust).

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

#60
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…

In addition to that, I struggled to find a well maintained library similarly to Devise. Also, many people won’t agree to me, but Ecto is also a kind of pain. I think Phoenix would have been in a better position if there were libraries like ActiveRecord and Devise.
Post reply on HN