I have been an Erlang/OTP enthusiast for a few years. Considering that most of my day job is spent writing web apps, the platform’s focus on providing highly available, distributed, fault-tolerant systems using immutable data is very appealing.
But what about Elixir?
Curiosity finally got the better of me! Two things in particular finally convinced me to take a closer look:
- Tooling – What is working with Mix like? How easy is it to feel productive?
- To the BEAM! – Erlang/OTP adoption seems to be hindered by the syntax. If Elixir is more comfortable to a wider audience and it still compiles for use in the BEAM, so be it!
How Did I Learn?
My introduction was by following the the Elixir tutorial  provided on the main site. It is a well written guide with many examples introducing newcomers to the syntax, pattern matching, inter-process communication, and OTP libraries. It also uses Mix throughout the guide running code, tests, and generating applications.
The tutorial covers many topics for newcomers, and I encourage you to check it out!
Here are some things that I stood out to me along with some things that I am less enthusiastic about…
While this is not a complete list, these things stood out to me.
This is a powerful feature. It encourages quality examples in the documentation itself while also providing test scenarios, verifying that the examples are sane. I believe that this is a really good way to communicate how a function is expected to be used, leaving the edge cases for unit tests.
The tooling is easy to use and involved in many regular tasks. It drives running tests, code compilation, app loads into Interactive Elixir, app dependency management, and new app generation.
Speaking of app generation, umbrella projects are nice! They can be used to wrap multiple small and focused apps, simplifying the task of grouping multiple apps to form one complete unit.
Rebinding of Variables
* Technically it is possible to reuse variables in an Erlang/OTP shell if you flush out the current process’ knowledge of them, but it is not possible in a running application .
Lowercase Variables and Functions
Erlang/OTP forces variables to be uppercase. When reading code, it makes it very easy to identify by casing alone what are variables that store values and what things provide values (functions, records, etc).
Elixir, however, chooses to make modules uppercase, allowing variables and functions to both be lower case. This is familiar to Ruby developers, but the opposite of what Erlang/OTP developers are used to seeing.
I walked away with a good impression of the tooling:
- Elixir places a priority on documenting and testing code
- The design of small and focused apps is encouraged
- Mix makes it easy to bundle them up with umbrella projects
These things help developers build nicely designed Erlang/OTP apps.
Soon, I am going to check out the Phoenix Framework to explore its use developing web apps!