Write Your First Elixir Code
While Elixir is a compiled language, it has an interactive console that makes it easy to quickly experiment with code. We’ll use Elixir’s console—IEx—to write and execute basic code. IEx (Interactive Elixir) is the equivalent of IRB (Interactive Ruby) in the Ruby world.
IEx is commonly used to quickly prototype code locally, although it’s a bit more powerful than that. One of the convenient techniques that you can use—and you will later in the book—is to run your web server and interactive console at the same time. This allows you to directly experiment with and modify a running application.
It’s easy to start an IEx session. Run the following command on your command line. If you see an error, then go back to the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access