Station 01 · SetupOpen the adventure map
The starting line
Meet five partners: two write code, one runs it, one offers reliable patterns, and one builds projects.
[Prerequisite diagnostic] When mix test fails, how can you first tell whether the problem belongs to the command, project directory, runtime, or code?
The errors happened on different layers
One learner runs mix test outside a directory with mix.exs. Another has an incompatible OTP version. Both conclude that the code is broken. Locate the failing layer before choosing what to inspect next.
- Whether the current directory contains
mix.exs - The output from erl,
elixir --version, andmix --version - The first error from
mix testand whether the project can compile
The problem it solves
You do not need to memorize five names. Erlang and Elixir express code. BEAM runs it. OTP supplies reliable patterns. Mix manages a project. Run each one once and their jobs become clear.
You will be able to
Explain in your own words what Erlang, Elixir, BEAM, OTP, and Mix each do
Open erl and IEx and run a short piece of code in each
Find the Erlang/OTP, Elixir, and Mix versions in command output
Use Mix to create a project, run code, and pass the first test
- Finish the setup lesson so the terminal can find
erl,elixir, andmix - Finish Foundation in either language. If values, patterns, functions, or modules still feel unfamiliar, review those lessons first
See what it does before how it is written
The spelling differs, but the actions match: start a process, send a tuple, then receive it by pattern.
# In IEx
# Remember the current process so the child can reply to it
parent = self()
# Start a lightweight process and send a tuple to parent
spawn(fn ->
send(parent, {:hello, :from_elixir})
end)
# Wait for a message with the matching shape and take it apart
receive do
{:hello, source} -> {:received, source}
endCheck the tools, then make a project
Check the Erlang, Elixir, and Mix versions. Then ask Mix to create a project and run its tests.
- 01
Run
erl, entererlang:system_info(otp_release)., and let Erlang report the OTP version - 02
Run
elixir --versionandmix --version, then find the Erlang/OTP, Elixir, and Mix versions - 03
Run
mix new beam_probeand see what belongs inmix.exs,lib/, andtest/ - 04
Enter the project and run
mix test, then usemix run -eto read the OTP release from the same project
# Print the Erlang/OTP version directly, then stop
erl -noshell -eval 'io:format("OTP ~s~n", [erlang:system_info(otp_release)]), halt().'
# Check the Elixir and Mix versions
elixir --version
mix --version
# Create a project, enter its folder, and run the tests
mix new beam_probe
cd beam_probe
mix test
# Read the OTP version again inside the project environment
mix run -e 'IO.puts("OTP #{:erlang.system_info(:otp_release)}")'- The three commands report Erlang/OTP, Elixir, and Mix versions that can work together
- Mix creates
mix.exs, a source folder, and a test folder, but it does not create another virtual machine - The sample test passes, and
mix runcan call Erlang'serlangmodule directly
Leave the beam_probe folder and run mix test again. Decide whether the message says “there is no project here” or “the code is wrong.”
This computer can use Erlang, Elixir, and Mix to create, compile, and test a small project.
This does not promise that every outside package is compatible or that the project is ready to deploy.
Key ideas in this code
BEAM
The virtual machine that runs Erlang and Elixir. It gives small processes turns to work and delivers their messages.
OTP
A long-tested set of tools and patterns for finding, isolating, and recovering from errors. Supervisor and GenServer are both part of OTP.
Mix
Elixir's project tool. It creates, compiles, formats, tests, and manages dependencies. mix.exs describes the project. Mix is not BEAM, OTP, or Hex.
Design patterns used here
Layered Architecture
Check the language, runtime, OTP, and project-tool layers separately.
Fail Fast
Verify the environment and project boundary before debugging business code.
Which sentence describes OTP most accurately? OTP is...
Write a programming checkup card
In no more than 12 lines, record the three versions. Then write the first step for three problems: a missing command, a missing mix.exs, and incompatible versions.
Hint 1Take the first step
Let elixir --version, mix --version, and mix help each report its own information.
Hint 2Make it a little smaller
When an error appears, first decide whether the tool is missing, you are outside a project, or the versions do not fit.
Hint 3You are close
Save the result. This card will help when you ask someone for support later.
Hint 4Work backward from the finish
Choose one success signal and write the smallest test for it. If the computer cannot show the result, rewrite the signal as something you can truly observe.
The card shows OTP, Elixir, and Mix versions
It explains that
mix.exsdescribes a project and separates Mix from HexEach of the three problems has one clear next step
It separates operating-system processes from small BEAM processes
Remember three things
- 1
Erlang and Elixir express ideas, BEAM runs the code, and OTP provides reliable patterns.
- 2
When Elixir calls Erlang, it usually calls a module directly inside the same BEAM virtual machine. It does not need to shout across a network.
- 3
Mix manages projects and build tasks. Hex supplies packages. When something fails, first identify which partner reported the problem.