4 ms·
I've been doing some reading about Elixir this morning...seems like the reviews are overwhelmingly glowing. Though people argue that developers should choose Ra
by danso 10y ago
I've been doing some reading about Elixir this morning...seems like the reviews are overwhelmingly glowing. Though people argue that developers should choose Rails (over Phoenix) because of its ecosystem...I haven't seen anyone argue that they prefer Ruby to Elixir.
For folks who have switched over, what are the things you don't like about Elixir?
edit: nm, plenty of discussion on this in the Elixir 1.3 thread: https://news.ycombinator.com/item?id=11945389 https://news.ycombinator.com/item?id=11945389
- xutopia 10y agoI've been a Rails developer for 10 years. I'm looking at Elixir and Phoenix today and I'm sad that I started my last project in Rails. My test suite takes upwards of 10 minutes to run and everything I hear about Elixir is that tests run 10 times faster.
- smt88 10y ago> My test suite takes upwards of 10 minutes That is absolutely mind-blowing. Can you explain a little more about what is causing that? Are there lots of HTTP calls or something? What machine is this running on? (I'm not a Ruby dev, but I have heard Ruby is slow.)
- segmondy 10y agoIt's true that ruby is slow, but your algorithms and code organization matters more than the language. Quick sort in BASIC will still beat bubble sort in C for a sufficiently large data. Are you doing DB tests? consider using a clean in memory DB. Are you calling 3rd party API's? Black box it, mock, stub, dummy em. 10 minutes is really a lot, unless you happen to have thousands up thousands of tests and running on a raspbery pi. Put your tests through a profile to find out why it's taking too long.
- tomku 10y agoSo I switched from Python to Elixir for web backend stuff, but I also have experience with other functional languages like Scala, Clojure, Haskell. I've recently been learning Swift. I really like Elixir overall, these are the parts that I find frustrating. 1) Erlang's (and by extension Elixir's) persistent data structures are great but there are times when (for performance reasons) they're completely unusable and you have to resort to things like using ETS or spawning a process for each value you want to store. There are times when I would kill for something like Clojure's transients. 2) The syntax has some weird edge cases, particularly around first-class functions. For example, having to call closures as "closure.(arg1, arg2)" rather than "closure(arg1, arg2)" or having to (seemingly) immediately invoke a lambda to make it fit in a pipeline like "7 |> (&(&1 * 2).())". I know WHY those two bits of ugliness exist but it doesn't really make me any happier about them. 3) The BEAM VM is very much a world of its own, with limited and well-defined entrance/exit points. It's very easy to do anything in Erlang/Elixir that stays inside the VM or communicates via network socket. It's difficult to do things that interact with the host OS or native processes, things that would be trivial in Perl/Ruby/Python. The reason why none of these are deal-breakers is that I understand that they're the result of tradeoffs, not poor engineering. It would be easy to design a new language that has none of the above problems but it wouldn't have the massive benefits that the BEAM VM gives Erlang and Elixir.
- danso 10y agoThanks for the detailed writeup! I do Ruby and Python for all my backend/data work...but I would love to switch out for a more elegant glue language. That Phoenix seems to have the potential to be the next Rails is a nice carrot, but I'm hoping that just means that Elixir attracts more of the kind of community that I've loved in Ruby. I don't have nearly the same breadth of exposure to functional languages that you do...I worry (prematurely, of course) that I don't have enough insight to understand what parts of the language are "weird" because I'm new, or legitimately weird, e.g. print-as-a-statement in Python 2 or `==` in Javascript.
- andy_ppp 10y agoAgree with what you have said but check out porcelain + goon (which is written in go) for handling external processes [1] - it's really great. [1] https://github.com/alco/porcelain https://github.com/alco/porcelain Also erlport looks interesting: http://erlport.org/docs/python.html http://erlport.org/docs/python.html
- tomku 10y agoWow, I actually thought about writing a process monitor in Go for my current Elixir project before deciding to just muddle through/learn how to use ports instead. The inability to send signals from Elixir was and continues to be a pain point. I'll be trying out porcelain/goon, thanks!
- ch4s3 10y agoI've read about these issues before, and have run into 2 and 3. I wonder if there are other common complaints.
- richardwhiuk 10y agoNiche languages overwhelming only have people saying good things about them, because very few people care about any complaints. Well used languages have large numbers of people complaining about them, because a) change is harder b) more people care about the result, so you get heard more c) they are more likely to be forced by circumstance to use the language. Reviews of languages are generally a rubbish metric for deciding if it's any good.
- danso 10y agoSo what metric do you think is more optimal for deciding how to sort languages from "must try" to "meh", other than actually using the language in production? (Obviously, in an ideal world with infinite time, that would definitely be my choice) While I agree that the nature and value of reviews is highly determined by things not inherent to the quality of the language (which is to be expected for anything that deals with the real-world), I do think reviews of nascent languages have significantly higher signal to noise ratio than they do for languages that are at their peak or heading towards legacy land: 1. New languages are rarely used by novice programmers. Which means that they are rarely written about by novice programmers. Doing a search for "state of Ruby/Node" requires a lot of work to find reviews authored by experienced developers who have a clear mindset (i.e not just personifying a shallow version of Bjarne Stroustrup's famous axiom), while filtering out everyone who just got out of coding bootcamp and has a good Medium presence. 2. The fact that a language is new means that nearly everyone, except for the creator and early dogfooders, is new to it, which means they come to it with roughly the same perspective (and needs and wants) as anyone who is curious to jump in. Moreover, they are often wont to compare the new language with whatever language they've been using, which helps as a metric for gauging the experience level and judgment of the reviewer. Sure, there's the problem of early adopters not wanting to shit on a language before it is stable...on the other hand, the kind of people who like to try out languages before they hit saturation are generally opinionated and will make critiques as way to help influence the language, so it's not a total whitewash. Speaking for myself, reviews are not my first metric for judging a new language or framework. Understanding why it was created and how it is currently doing in production is by far the most important thing to me. Even though React felt very strange to me and many others at first, I still gave it the benefit of the doubt knowing that it was being used in Instagram and Facebook.
- true_religion 10y agoAbout Elixir, I don't have very many complaints due to the fact that it is built over Erlang which means for day-to-day operations its solid. At the edge, performance relies heavily on implementation, and the ErlangVM is great at dealing with high concurrency, and methods that do small pieces of work. If your implementation works against that, then the VM is going to work against you as well because it was designed with those assumptions in mind. Elixir however is a very new language. Coming from Python, the first things I noticed was: 1. There's no real consensus on if we should use exceptions or error return types. Support for return types is improving with the new with syntax, so perhaps that's what most people will use. The standard library uses both, and occasionally will just return nil on error. 2. The standard library is still evolving. For example Date/Time/Calendaring was all out of the STL until 1.3, and support is still currently anaemic comparative to Python. 3. Most OTP in the Erlang ecosystem are built in Erlang. Those built in Elixir are derived from some specific use case of some specific company. Language support for OTP constructs is improving though, and more generic forms are being built into the STL for Elixir 1.4, upcoming. With regards to Phoenix, its a well thought out, throughly implemented library.... but its not Django; and makes different philosophical choices. Short list: 1. no user system 2. no authentication or permissions 3. templates do not follow the engine/loader structure of Django 4. Plug is like Rack, not like Django middleware so whilst it is more powerful in some respects, it is unidirectional in control flow unlike Django where data flows up/down the chain of middleware. 5. Ecto is a pretty solid database layer, but its not integrated into Phoenix at all because #1/#2 do not exist, and Phoenix doesn't have a admin layer at all... so there's no real reason for the framework itself to tie itself to a single database layer. So you get into a situation that's akin to using SQLAlchemy with Django. Yes it works, no this library wasn't built for your framework.