liveBook · Manning

Interactive shell

As explained in Elixir in Action, Third Edition

An interactive shell is a command-line environment that reads, evaluates, and displays the results of expressions interactively.

An interactive shell is a command-line environment for experimenting with Elixir expressions. Starting iex launches a BEAM instance, gives the Elixir shell control, and lets it interpret input and print each result. section 2.0 section 2.7.2

Use the shell for rapid exploration, while keeping production performance measurements and substantial application code elsewhere:

  • Treat interpreted input as slower than compiled code; do not measure application performance directly from iex. section 2.7.2
  • Define modules in the shell when useful: they are compiled and loaded in memory, avoiding an interpreted-code performance penalty. section 2.7.2
  • Move repeatable work into scripts or projects, using elixir for source files and Mix for multi-file applications. section 2.7.2

How Elixir in Action, Third Edition covers it

How deep it goes
Explains startup, interpretation, compilation boundaries, and performance limits, but does not provide a detailed shell reference.
Examples
Uses iex for expression experiments and contrasts it with in-memory module compilation and script execution.
What it assumes
Assumes Elixir and Erlang are installed, specifically Elixir 1.15 and Erlang 26 for the surrounding setup.
What you can do after
Operate iex for experiments and distinguish interpreted shell work from compiled modules and scripts.
How it connects
Connects interactive evaluation with BEAM, compiled modules, scripts, Mix, and the Elixir type system.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.