3 ms·
So 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 recent
by tomku 10y ago
So 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.