2017 is my year of functional languages

It’s a brand new year, time to set some goals!   Software wise, my main goal this year is to get familiar with functional programming.

I want to accomplish by learning two languages that I’ve had on my radar for a while: Elixir and Elm.  Not sure if this is “career advancing”, I doubt it, but from the little that I know from both languages, I’m fairly certain that I will learn something that I can bring back to the Java and Javascript worlds.

So, why Elixir and Elm?

First, Elixir is intriguing.  Elixir runs on top of the Erlang VM.  It uses the same VM that powers WhatsApp…. and WhatsApp is VERY performant.  You can find articles and videos on it here:

There seems to be little doubt that a language built on top of the Erlang VM will be performant.

Now, why not learn Erlang instead of Elixir?  Elixir was created by Jose Valim, a key contributor in the Rails world.  He created the “Devise” library in Rails.  I’ve since looked at the Elixir API and it was definitively heavily influenced by the Ruby and Rails APIs.  I’m just hoping to cut some of the API learning time by leveraging some of my Ruby experience and focus on the new stuff: functional programming proper.

One language should be sufficient to learn how functional programming work but I’ve decided to also dig into Elm.

This is an emotional decision, I think.  I listened to a few podcasts that intrigued me:

I’m not crazy about Javascript and I think that I’m just looking for an alternative that I find more pleasing.  It’s not a dynamic vs compiled language decision, I’m fine with Ruby which is dynamic and I’m fine with C++ and Java, which are compiled.  My problems with Javascript are in some of its details. For example, the equality logic (or rather that weird casting it does).  I’m not crazy about the prototype model stuff either.  It’s pretty far from a what a good OO language should be.  Even frameworks like Angular are a bit annoying because they have to piggyback on some of the idiosyncracies of the JS.  (Though ES6 and Angular2 might make me change my appreciation of Javascript, we’ll see).

Elm is a “transpiled” language (Elm -> JS).  Furthermore, it is typed.  It has meaningful error messages and has an intriguing programming model that looks like it might help out with the asynchronous nature of client application.  Everything in an Elm program is message based.  So really, it’s all asynchronous.

So, there you go.  My plate is full.  It’s going to be interesting.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: