| I worked at a ruby on rails startup and currently am 5 years into a stint as CTO and lead engineer of a startup using elixir. Ruby shines where you need to just pull some off the shelf libraries and get something together. you save on developer time but your devops setup needs to be a bit more complicated to handle scaling issues which will come sooner. That said, ruby is a lovely language to work in for the most part. Havign said that, I personally think elixir is the winner for reliability and maintainability. yes, there aren't as many libraries for elixir and they don't have the same level of "drop in and use" functionality that ruby has. elixir's ecosystem's whole approach is to make everythign standardized lego pieces so there's a little but more work up front. Once you are actually writing your own code however, i find there's less bugs as immutable data structures eliminate whole classes of bugs you find in ruby. Its not as air tight as a fully typed language but I do get descent warnings at compile time to catch plenty of low hanging fruit when it comes to runtime errors. to be sure, you definitly have to think differently about how you code as you haev to think in a more functional style. Of course elixir's real claim to fame is going to be a combination of concurrency and performance. elixir's metaprogramming happens at compile time and in my experience, elixir systems just run faster than the equvalent ruby code. at my startup, all scaling conversations end up being around pushing postgresql and optomizing our queries. We have yet to really hit the ceiling of our api server. Ecto, phoenix's db library, is just a better abstraction for database interaction than activerecord. it doesn't try to shoehorn database queries into objects. database records map to elixir records and you write queries using a set of macros that map pretty cleanly to sql with easy escape hatches if you need to use soe nonstandard sql. The result is that we don't spend much time tryign to debug how a db query in elixir maps to the output sql. its easy to tell at a glance. of course this does require that you actually understand how sql works. lastly, if you want to build anything on top of websockets. there's no comparison. elixir is just better. comparing ror to elixir in terms of websockets is like comparing a cesna to an f16. |
This is my experience too - Elixir might not be statically typed, but it's not nearly as big of a problem as you'd think. Immutability, pattern matching, and the general functional style all give you some strong guardrails that avoid a lot of the usual pitfalls of a dynamic language. Plus you also get the benefits of dynamic typing too (flexibility, more succinct code, faster iteration time.)
Sure, it's not as foolproof as a full static type system, but it's good enough in my experience. It's not even close to the uber-fragile NoMethodError clusterfuck that is Ruby development.
I wrote a longer blog post a while back expounding on this point if anyone's interested: https://phoenixonrails.com/blog/you-might-not-need-gradual-t...