The Beginning and End.

Sipping on Elixir

1
2
3
4
5
6
7
8
 __________
< holy cow >
 ----------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

It’s almost the end of my batch at Hacker School, but it’s okay because I’m never [ever] graduating. ❤


This past week José Valim has been in residence at Hacker School! José is the creator of the Elixir programming language, which is built on top of the Erlang Virtual Machine. (Joe Armstrong has said that Elixir “is good shit.” Seriously!). José is also a core contributor to Rails. So. Rad.

On Monday night, José gave us a quick introduction to Elixir and explained that Elixir is a functional, concurrent, but most importantly, a distributed language. He gave us a bit of background on Erlang and its origins as a language used for telecommunication. Erlang provides support for fault tolerent, non-stop, real-time applications. Also, hot swapping is pretty cool (which José did a demo of in Elixir). For these reasons (and many more), Erlang is the language used in messaging systems like Facebook messenger and WhatsApp.

I’ve been spending the past few days working through Etudes for Elixir in order to get a quick introduction to the language, and get myself up and running.

Some quick first impressions/takeaways:

Elixir is compatible with Erlang code, but it has a nice Ruby-like syntax. It’s kinda like the love child of Ruby and Erlang. Elixir has all the goodies like pattern matching, list comprehensions, anonymous functions that I heart from Haskell. There aren’t quite type signatures; instead, there are these things called specs. Specs are mostly used for documenting code, but on some occasion, people use tools like Dialyzer to find type errors (I will probably check this out at some point).

One thing I find super cool about iex, the Elixir repl, is the h command to read documentation.

Also, Elixir has SUPERB documentation. I’ve been very pleased with how well explainations are written out, and that there are examples! Examples!

I’m making my way through most of the topics in Elixir’s getting started section through études (currently getting acquainted processes), and I’m excited to learn about Mix and OTP next. In general, I’m excited to get deeper into Elixir since I don’t know much about concurrent and distributed programming.

Today, José did a seminar on how Iterators are implemented in Elixir, going over eager map, eager filter, the idea of inlining and so on before introducing us to the idea of lazy map, etc. It was a very informative session and I will write about that more in a different blog post.

And just throwing this out there: HOW COOL IS IT TO BE ABLE TO ASK QUESTIONS IN PERSON TO THE CREATOR OF THE LANGUAGE YOU’RE LEARNING? Thanks a ton to Hacker School for this amazing opportunity.

So far, learning Elixir has been quite nice, and the transition from Haskell to Elixir has been pretty smooth.

Looking forward to all of the things I learn before the end of my batch.