
Ruby vs Elixir – Panel discussion at Wroc_love.rb [video] - jschepmans
https://www.youtube.com/watch?v=O5dzsG5grK4
======
enraged_camel
I think it comes down to this: with Elixir, you gain a _lot_ over Ruby and
lose very little. Any Elixir app will be significantly more performant and
reliable than its Ruby counterpart. This is due to several reasons:

\- Elixir runs on a battle-tested virtual machine, and stuff like supervisor
behavior (e.g. auto-restart of crashing processes) is built right in

\- Elixir is a functional language, which makes the code you write more
testable

\- State in Elixir is immutable, which greatly reduces the side effects of
running code

I used to develop in Ruby circa 2014-2015. It will always have a special place
in my heart, but to be frank, I don't really miss it. Elixir, as a language,
is better in almost every way. And once the ecosystem becomes a bit more
mature, it will be unstoppable (OK maybe not really, but it's definitely here
to stay).

~~~
losvedir
Former Ruby, now Elixir, developer here and I agree.

The one use case where Ruby still wins for me, though, is a little one-off
script. Last time I had occasion to do that, I found you couldn't use any
Elixir hex packages without generating a whole mix application. In ruby you
could just globally install the gem and require it right into your script.

I forget why this came up, but I think it was something like just wanting to
download a web page and parse out a certain bit of it into a CSV file or
something like that. Pretty trivial in Elixir with HTTPoison and Floki, but no
real way to use those in a one-off .exs file (I don't think?). Whereas in
ruby, I've already got HTTParty and Nokogiri in there somewhere, and you can
toss it together in a minute.

~~~
networked
>In ruby you could just globally install the gem and require it right into
your script.

I've been using Elixir for one-off scripts lately and this is something I
miss. In my book, it is a clear advantage that Ruby and other scripting
languages have over Elixir. In the case of HTTP(S) my solution has been

    
    
      {data, 0} = System.cmd("curl", ["-sf", url])
    

but as soon as you need a JSON library it is time to create a project. (The
"-f" flag ensures you get a non-zero exit status from cURL if the HTTP status
code isn't 2XX.)

I do not particularly like the usual global package installation model,
though, because it means that you can only have a single version of a package
available for your scripts to require. The best package management model for
standalone scripts that I have seen is Groovy's [1]: a script can include a
special directive that downloads a specific version of a package just for that
script. Any versions can be stored in the global (per-user) package cache so
that you don't have to redownload them every time a script runs, but your
import statements always give you strictly the version you asked for. This is
the model I'd adopt for Elixir.

[1] [http://docs.groovy-
lang.org/latest/html/documentation/grape....](http://docs.groovy-
lang.org/latest/html/documentation/grape.html)

------
tkyjonathan
There is a thing that was missed. You may have developed an application very
quickly with ruby and go to market faster in 6 months, but you spend the next
5 years trying to fix performance issues with barely writing any new features.

------
hartator
I am falling for Elixir. However, my big drawback that made me stay in Ruby is
the community don't seem to like NoSQL solutions like MongoDB and you can feel
it in the libraries and global architecture.

~~~
_asummers
It's just that they have their own ways of expressing it, using things like
ETS, DETS, mnesia, Riak-core, depending on your use cases and consistency
requirements.

