Elixir vs Erlang: a question of momentum

I fiddled around with Erlang the first time a number of years ago, and have come back to it off and on ever since.  I’m currently using it professionally, and enjoying the experience a lot.  However, Erlang has always struck me as a language that is not particularly “well-rounded”: the best in the business at certain things, and… not always a lot of fun for others.  String handling for instance.  You pick up Ruby or Python or Java, you know they’ll probably be “ok” for anything you throw at them.  Maybe not great, but you’re likely to at least be able to put something together, even if it’s got some flaws.  Erlang has always felt a bit more hit-and-miss – if you’re not operating in its sweet spot, you may be in for a slog.  Not that it’s an unpleasant language.  I’m rather fond of it, actually.  Just that you might end up having to write things yourself that you’d get as easy to install libraries in other systems.

While not a user of it yet, this is one of the reasons why it’s so interesting to watch the Elixir programming language evolve.  Outside of the other languages besides Java targeting the Java Virtual Machine, it’s not every day that we get to see a new language created for a VM.

It’s impressive how much momentum they seem to have.  Sometimes Erlang’s progress feels a bit like trench warfare, where major battles are fought over a few meters.  Elixir, on the other hand, seems to have broken out and is charging ahead fast.  This is of course something of a generalization, and there is plenty of good stuff happening with Erlang too, just that I get a feeling of Elixir racing ahead.

Being, among other things, a “web guy”, this is particularly noticeable to me, and perhaps less so to people using Erlang for what Erlang traditionally has done well.  Erlang has long had some tools for the web, but they’ve never been as easy to use as, say PHP, and they don’t have half the tools available that something like Ruby on Rails has available to it.  It seems that Elixir is cranking out a lot of stuff that Erlang never really got:

  • A web framework, Phoenix that seems to have a lot of work going into it.  Erlang has several web servers, like Yaws, and the excellent Cowboy, as well as some other bits and pieces that work well.   But Erlang has been lacking in the framework space.  You can criticize frameworks, but good ones do save you some time initially, and then get out of your way when you want to do more.  They’re a great starting point for someone who just wants to do some learning by making something that works, and then iterating.  Trying to put together cowboy, poolboy, a circuit breaker, a database driver, erlydtl, and various and sundry other pieces, for someone not well versed in Erlang is a losing proposition.  Their friend, using Elixir, will at least have something up and running in short order.  Also, if putting together the same bunch of components is something a lot of people do, why not do it once and do a good job at it?
  • A package management system, “hex”.  Erlang has rebar, to download and compile source packages, which works ok, but hex seems to do more.  A package system has always seemed around the corner for Erlang, and the Elixir guys just went out and built one.

Those are the two that stick out the most, but there are all kinds of things going on – here are a few random examples:

  • Ecto database driver, with Postgres as the first database integrated (yay!).
  • Ecto migrations.
  • Porcelain, for working with external processes, where Erlang  is somewhat lacking (you need https://github.com/saleyn/erlexec ).

These are things that are available for Erlang, but I’m just impressed at how quickly the Elixir guys are cranking stuff out, even if at the same time I also wonder if for some things, they’re not a bit too ready to create something new when there’s already a perfectly good solution.

Naturally, Elixir is young, and can afford to experiment more in some ways, and perhaps much of this code is not quite “battle tested”, but it’s still nice to see things moving so quickly.

Maybe it’s just the “grass is greener” feeling, but it seems like Elixir has something which Erlang never really managed to acquire: momentum.   It should be very interesting to see how this plays out over the next few years.