Its been on my list for some times to play with Elixir. I decided to go ahead and document some of my learnings and to hopefully compile some useful information for others benefit.
Quick Dev Environment
To get up and running with Elixir, you can simply run the following image. You can then build applications off this base image, or look at the source and build your own.
$ docker run -it --rm -v ~/dev/elixir:/code -w /code trenpixster/elixir bash
The above command will download and run a one-off container using the trenpixster/elixir image. It will also mount the
~/dev/elixir directory as a volume so the code you develop in this location is available inside the container. This will give you a pretty nice development environment without having to install too many dependencies on your host machine.
Once up, you will be able to run
iex or other various
root@b8be991c937d:/code iex Erlang/OTP 18 [erts-7.2] [source-e6dd627] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Interactive Elixir (1.2.0) - press Ctrl+C to exit (type h() ENTER for help) iex(1)>
That was easy! Within minutes you can step into a interactive elixir repl and can start playing with the language.
Online (and Free) Resources
One thing that I have found to be consistent of the Elixir community is the vast set of guides and documentation available for a language at such an early stage.
Below are some links I have gone through and found to be very helpful.
- Offical Elixir Introduction
- Elixir School
- Elixir With José Valim (Portal)
- Mix & OTP Guide
- Études for Elixir
I always encourage people who are serious about learning to buy books. It not only helps to have a physical copy lying around, but it also helps support the individuals in the community who have taken the time to help others learn.
Below are two books I personally purchased and found to be of great quality.
This book is your guide to Elixir, a modern, functional, and concurrent programming language. Because Elixir runs on the Erlang VM, and uses the underlying Erlang/OTP architecture, it benefits from almost 20 years of research into high performance, highly parallel, and seriously robust applications. Elixir brings a lot that's new: a modern, Ruby-like, extendable syntax, compile and runtime evaluation, a hygienic macro system, and more.
Elixir in Action teaches you how to solve practical problems of scalability, concurrency, fault tolerance, and high availability using Elixir. You'll start with the language, learning basic constructs and building blocks. Then, you'll learn to think about problems using Elixir's functional programming mindset. With that solid foundation, you'll confidently explore Elixir's seamless integration with BEAM and Erlang's powerful OTP framework of battle-tested abstractions you can use immediately. Finally, the book provides guidance on how to distribute a system over multiple machines and control it in production.
In closing, Elixir and Erlang may have a perception of being difficult and while there are certainly some areas which will take getting used to if you aren't familiar with functional programming or Erlang / OTP, there are a vast set of resources available and with these I have found to really enjoy the language.
I hope to cover more about Elixir in the future and others find this collection of information useful.