Jake Worth

Note: any code contained in this post is more than a year old. Please use at your own risk.

I've been learning and using Elixir lately, and loving it.

More than once, I've been asked some version of the question: why are you learning Elixir? What makes this language unique?

I thought I'd take a moment and try to distill my rationale. There are two main points: Elixir solves problems, and it's aesthetically interesting to me as a language.

Real Problem Solving

Elixir is written in Erlang, a language for telephony. Erlang is thus optimized for two things:

  • Concurrency: must be able to run on multiple machines at once
  • Uptime: phone call customers won't tolerate a crash

As networks grow, tenants multiply, and microchip processor speeds approach physical plateaus, concurrency is gaining importance as a feature. Elixir is built for concurrency. Ruby is not (a fact that inspired José Valim to create Elixir in the first place).

Elixir's (Erlang's, really) outstanding uptime is useful, too.

Aesthetically Pleasing

Elixir was written by a Rubyist, and Ruby idioms abound. I've never picked up a language faster than Elixir. Ruby was optimized for programmer happiness, and Elixir shares many of those friendly, hard-won conventions.

I've been fascinated by functional programming since reading Seven More Languages in Seven Weeks, and learning Elixir helps me further develop that new perspective. It's made me a better Rubyist— I am much more aware of a side effects and more likely to consider recursion to solve problems.

Conclusion

Is Elixir going to replace Ruby? I'm not yet convinced. But it does solve some real problems in ways Ruby can't or won't, and it's been fun and pleasant to learn.

Elixir has been designed in a way that might make it a better language than Ruby for the web in the future. As a technologist I have an awesome (both common meanings of the word) responsibility to investigate it.

Jul 6, 2016

Hi! I'm Jake Worth, a developer at Hashrocket, based in Chicago. I co-organize Vim Chicago. Read my blog, learn about my work, follow me on Twitter and Github, get in touch.