Search⌘ K
AI Features

Running Elixir

Explore how to run Elixir through interactive sessions using IEx, understand its helper functions, and learn to compile and execute Elixir scripts from source files. This lesson prepares you to move beyond simple commands to writing and running full Elixir programs.

Interactive Elixir with iex

Let’s start an interactive Elixir (IEx) session. In the terminal below, type “iex”.

Terminal 1
Terminal
Loading...

Once we have an IEx prompt, we can enter the Elixir code, and we see the result. If we enter an expression that continues over more than one line, IEx prompts for the additional lines with an ellipsis (...).

There are several ways of exiting from IEx, but none are tidy. The easiest two are typing ...