elixir command used to run a single Elixir source file.
> elixir source.ex
When you run this command two things happen:
- The file source.ex is compiled in-memory, and the resulting modules are loaded to the VM.
- Every code outside of a module is executed.
> mix run
When you want to run a project created by
mix new project_name)
iex Elixir's interactive shell.
> mix my_source_file.ex
When you want to load a module to the VM in interactive mode.
Note that code outside of the module will not be executed.
You can also use
mix and run a project and load the interactive shell with
iex -S mix run
Top comments (0)