Live data from Hacker News

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

news.ycombinator.com

201–210 of 297 posts

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

#201

Earlier quoted context omitted.

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

Those advantages are really overblown and not worth the hit in missing libraries or missing hires.

Totally agree. I've been in this industry since 2001 and never, ever had a performance problem which couldn't be solved with just thinking what your code is actually doing. The bottleneck has been always the database, or the network, etc. The only problem I've had with threaded languages is running out of threads/processes due to making external API network requests, etc, but you learn to not block threads by using jobs, etc. And worst case, more hardware has been always cheaper than more developers due to less productive languages (hello Go! :wink: :wink:).

You are not Google.

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

#202
post #178

Earlier quoted context omitted.

It isn't just "ONE TIME" for me. The extension freezes up often and completely stops giving autosuggestions or warnings, and the only way to fix it is to delete the .elixir_ls file and rebuild the database. When I say "often", I mean there are some days where I have to do that at least once an hour, and 5-15 minutes of high CPU usage every hour is just way too much to be acceptable. I love Elixir and the ElixirLS ext…

Is it possible to share more details about your particular setup? I believe you, but this doesn't sound right. I've used the plugin on all three major operating systems in a wide variety of projects and configurations, and have never had this happen to me. Curious to learn more about what could be the culprit for you.

I have had the same issue as the parent poster. I'm on Windows 10. Everything was fine when I was on Elixir 1.9.2, but the moment I upgraded to 1.11.2, the ElixirLS extension just started to break frequently, or getting stuck while building. I ended up disabling it until I have time to troubleshoot further.

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

#203
post #129

Earlier quoted context omitted.

"Also, I've read some comments where people mention "we don't need redis", "we don't need workers" everything is so much easier. That was our thinking at first. But then you realize on deployments you will lose your cache, or your background jobs, etc. So you have to persist them either in mnesia or in the database. At that point you're just reinventing your crappy undocumented and untested version of delayed_job...…

I think that it would be helpful if you provided examples about those things, good and bad. As it is it's mostly "erlang's" bad - perhaps if you offer the counterparts to what would be a better pick we could have a discussion - and then perhaps see how far the tree of dependencies goes on each side? And also what you would loose by picking up those solutions? Just taking on some random stuff: > Trivial pattern matchi…

"If the data structure is being accessed in a module to deal with it specifically then that is part of the knowledge of the module. And you can't escape that with or without pattern matching, since you'll have to codify those things in code anyway, be it long chains of ifs, switches, or whatever, you'll always have to write the code with the same level of knowledge about the data structure to express the same conditions?"

There are other options. In object oriented design, using the loose definition of "anything with 'methods'" (thus, including Go and Javascript even if they don't have "inheritance"), if you want to know something, you ask directly, using a method for that case. It is the difference between "account.getBill(lastMonth)", where you load the logic into the account object to fetch bills from different times, and pattern matching where you write into the code taking the bill deep assumptions about how the account is structured, such that when refactoring the account you have to go change all its consumers. Note I am only criticizing deep pattern matching here; pattern matching in general I like, even if I can live without, but in Erlang terms, if your patterns look like

    [thing, [_, _, {something, X, [Y, _, Z]}]]
you've gone off the rails.

"I've seen libs written in elixir beat libs written in C++ and they had to start a VM to be run. "

There's almost always some microbenchmark a slow language can beat a fast language in, but that doesn't make it a fast language. You might want to dig into that "elixir lib that beats C++", because either the C++ was really bad or the elixir lib is actually written mostly in C(++).

"I haven't seen any language with the concept of an independent program, that has a synchronous interface (mailbox), but can be modelled entirely asynchronously, and can't block whatever running loop."

Yeah, but when you're talking about a 30-40 year programming language, that's not a necessarily a compliment. Nobody else has seen fit to exactly copy it, because we've found better things to cover the problem space than that.

"Given that you can have any socket, tcp or not, and easily handle it"

There is a lot more to being a message bus than just having a TCP socket.

"I also don't understand how it's difficult to integrate Erlang with other things, it basically has a standard lib very accommodating of sockets and inter process communication through STDIN/OUT, with effective monitoring on top."

That is not "easy to integrate with", that's table stakes. What I'm referring to being hard to integrate with is how you tend to be stuck in the ecosystem. It has monitoring, sure... but in 2021 it's a very quirky monitoring that doesn't integrate with any of the rest of what has developed. You can, in theory, connect to an Erlang cluster without Erlang, but in practice the requirements of being "an Erlang cluster" are so specific, with its own quirky term format that isn't quite JSON or quite anything else, is so difficult as to not be worthwhile. Once you've taken the time to speak to a non-Erlang message bus, use a non-Erlang database, wrap your Erlang code in K8S or some non-Erlang manager, use Erlang to hit HTTP APIs, speak to non-Erlang monitoring systems... why are we using Erlang again?

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

#204
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.

I struggled with Ecto. It seemed too complex. I missed find_by_sql and the scopes of ActiveRecord. But once I went past the initial learning curve Ecto is a seriously well designed library. I have not written a single sql query by hand. Now I feel find_by_sql is an anti-pattern as I was mixing sql with ORM.

Once your database becomes sufficiently complex you start writing a lot more sql.

ActiveRecord's way of chaining scopes to combine multiple scopes is brittle. You can't customize the conditions. Ecto solves this by giving you composability. You can build on top of your earlier commands. If you combine this with pattern matching in the functions or Enum.reduce you have an extremely powerful and a flexible query engine.

Ecto also relies on the strengths of underlying database engine rather than treating it as a black box. If you are dealing with 100s of tables Rails way of polymorphic design doesn't give you referential integrity. I like Ecto's recommendations: https://hexdocs.pm/ecto/polymorphic-associations-with-many-t...

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

#206
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?

Yes it's not constant. We have a handful of bursts (tens of thousands of SMS conversations happening at 9am every day that complete in about an hour, for each SMS we send out, we get back 3 status callback webhooks from Twilio). And we've had a couple "mass" message sends where it did take a few hours to send 1.6 million messages. But again, that was due to our twilio limits and not elixir. We had to throttle our jobs when Twilio started saying their queue for our number was full.

I just checked (because we now process most jobs in the background), we have gone as high as about 500 jobs per second in exq on that same machine (and each job typically runs anywhere from 5 to 15 SQL queries). The bottleneck is actually the size of our RDS instance. Not complaining about postgres, just saying elixir hasn't been the bottleneck for that amount. Every hour we process CSV files with 30,000 records, etc.

We only started caching things about a month ago. I have been very lazy about that since it just didn't make any difference until recently.

Again, the point I'm trying to make is that using elixir has been positively and utterly boring in the best way possible. No drama whatsoever. We've spent the overwhelming majority of any of the time related to this looking at postgres. Not even complaining about Postgres either, it's more a conversation of what's the right RDS size and IO for our traffic.

This stack has caused us very little drama.

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

#207
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.

To answer your question, yes. My background is also primarily in Python (after brief flirtations with other languages during and shortly after college). When trying to learn Elixir (or Scheme, for that matter), my primary hurdle has been thinking in terms of idiomatic Elixir. The struggles aren’t with understanding the syntax (even for Scheme) but rather with understanding the typical patterns used such that I can start a project from scratch without heavy reliance on tutorial materials.

In other phrasing, I’ve quickly mastered the “draw three thin ovals” portion but am now stuck at “draw the rest of the phoenix”. Speaking of Phoenix, I also agree about “mix phx.gen” to be more magical than what I’m used to.

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

#208
post #127

It's not argument "against" selecting it (it's a free world, and mileage vary), but a couple of scar-earned advice: - Be careful about libraries. If you know that your system has to interact with X, don't assume that there is a running, idiomatic, maintained libary for X on `hex.pm`. Do a bit of due diligence. We had experience ranging from `meeh` (oauth2, graphql, http) to `pretty bad` (mqtt, swagger.) But as other…

If you're aching for typespecs in Elixir being useful, but are dissapointed with Dialyzer, I recommend checking out my library Hammox: https://github.com/msz/hammox . It's an improved version of Mox, the de-facto mocking library for Elixir, which you can use to automatically assert in tests that your mock calls, or any function calls, fit your typespecs. I personally found that with rigorous enough usage, I don't eve…

This is great! Thanks for sharing.

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

#209
post #129
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…

"Also, I've read some comments where people mention "we don't need redis", "we don't need workers" everything is so much easier. That was our thinking at first. But then you realize on deployments you will lose your cache, or your background jobs, etc. So you have to persist them either in mnesia or in the database. At that point you're just reinventing your crappy undocumented and untested version of delayed_job...…

Can't upvote this enough

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

#210
post #151
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…

I worked on an elixir project at a ruby shop for about a year. We had complex distributed system, and were replacing core ruby services with elixir. Ultimately the project was a failure, and was re-re-written in Ruby, and the Elixir devs were let go. We faced similar issues to you, bad tooling, weak libraries, and very few knowledgeable devs. Finding people to hack on elixir was extremely difficult, and likely the dr…

I think new languages wont be able to break in the top 10 without a mega corp pushing them. The market is too saturated and there is a language for everything under the sun. Elixir is just facing too much competition for web stuff and doesnt enjoy Google pushing it.
Post reply on HN