Elixir is a dynamic language built on top of Erlang. Visit the elixir-lang.org home page for the latest information to get set up Elixir on your system and learn more about the language.
If Elixir is already installed on your system, you can check the current version using the
elixir --version command in a terminal session as pictured below.
The instructions to install Elixir vary by platform and it is best to follow the instructions on the install page at elixir-lang.org.
Interactive Elixir Terminal Session
You can run an interactive Elixir session from your windows command prompt:
Or, you can run a session in Windows PowerShell:
Finally, you can also run an interactive session from the Erlang Shell which can be invoked from the command line using the command
iex.bat --werl. This will open a new Erlang Shell window which serves as an Elixir REPL:
Elixir on Docker
You can also run Elixir from Docker and it will automatically point to the latest Erlang and Elixir available:
docker run -it --rm elixir
You will notice in the screenshot below that the installed version of Elixir on my machine is Elixir 1.13.3 and compiled with Erlang/OTP 22) even though I have Erlang/OTP 24. However, the docker image version of Elixir is running the latest version 1.13.4 version of Elixir compiled with Erlang/OTP 24.
Running Elixir using Livebook is a great way to create tutorials and run interactive Elixir sessions. Livebook for Elixir is a better but similar experience to using Jupyter for Python. A number of options exist to set up Livebook on your system. I prefer running it from Docker:
The Elixir Livebook opens in your browser as pictured below:
A lot of options are available to learn Elixir and videos like ” Learn Elixir in One Video,” by Derek Banas make it that much easier.
Elixir in Action – 2nd Edition by Saša Juric is an excellent practical guide to solving problems with Elixir. Publisher: Manning, 384 pages, ISBN-13: 978-1617295027, ISBN-10: 1617295027.
Phoenix is the web framework for Elixir and it brings many sought-after features and functionality.
Phoenix in Action – 1st Edition by Geoffrey Lessel teaches the unique benefits of Phoenix, a modern web framework built for the Elixir programming language. Publisher: Manning, 336 pages, ISBN-13: 978-1617295041, ISBN-10: 1617295043.
Related Articles and Resources
Why Elixir & Phoenix is a great choice for your web app in 2022 | Curiosum