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
