Station 01 · SetupOpen the adventure map
00Set up your toolsSetup01The starting lineSetup02Processes and mailboxesR1An Elixir data pipelineOptional reviewR2Read ErlangOptional review03Messages and timeouts04OTP rules for messages05A supervision tree that restarts06Put a limit on concurrency07When a BEAM node disappearsX1Agree on shared BEAM termsBilingual extensionX2Two-language partnersBilingual extension08A reliable job runner
Home/BEAM mainline/Station 01
01
FoundationBeginnerSetupBEAMElixirErlang

The starting line

Meet five partners: two write code, one runs it, one offers reliable patterns, and one builds projects.

2checkpoints
About 2 hours · Try 2 sessionssplit it into sessions
QUESTION · ONE PROBLEM FOR THIS STATION

[Prerequisite diagnostic] When mix test fails, how can you first tell whether the problem belongs to the command, project directory, runtime, or code?

Start at the scene

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.

Evidence you can observe
  • Whether the current directory contains mix.exs
  • The output from erl, elixir --version, and mix --version
  • The first error from mix test and whether the project can compile
Why this station matters

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.

After this station

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

Before you start
  • Finish the setup lesson so the terminal can find erl, elixir, and mix
  • Finish Foundation in either language. If values, patterns, functions, or modules still feel unfamiliar, review those lessons first
One job, two ways to write it

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.

Current code
Elixir
# 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}
end
LAB
Hands on

Check the tools, then make a project

About 15–25 minutes

Check the Erlang, Elixir, and Mix versions. Then ask Mix to create a project and run its tests.

  1. 01

    Run erl, enter erlang:system_info(otp_release)., and let Erlang report the OTP version

  2. 02

    Run elixir --version and mix --version, then find the Erlang/OTP, Elixir, and Mix versions

  3. 03

    Run mix new beam_probe and see what belongs in mix.exs, lib/, and test/

  4. 04

    Enter the project and run mix test, then use mix run -e to read the OTP release from the same project

Copy into the terminal and press Enter
# 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)}")'
What you should see
  • 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 run can call Erlang's erlang module directly
Break it on purpose

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.”

What this shows

This computer can use Erlang, Elixir, and Mix to create, compile, and test a small project.

What this does not show yet

This does not promise that every outside package is compatible or that the project is ready to deploy.

Meet the words

Key ideas in this code

01

BEAM

The virtual machine that runs Erlang and Elixir. It gives small processes turns to work and delivers their messages.

02

OTP

A long-tested set of tools and patterns for finding, isolating, and recovering from errors. Supervisor and GenServer are both part of OTP.

03

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.

Name the shape in the code

Design patterns used here

01

Layered Architecture

Check the language, runtime, OTP, and project-tool layers separately.

02

Fail Fast

Verify the environment and project boundary before debugging business code.

Think it through

Which sentence describes OTP most accurately? OTP is...

Your turn

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.

Ready to move on when
  • The card shows OTP, Elixir, and Mix versions

  • It explains that mix.exs describes a project and separates Mix from Hex

  • Each of the three problems has one clear next step

  • It separates operating-system processes from small BEAM processes

Take these with you

Remember three things

  1. 1

    Erlang and Elixir express ideas, BEAM runs the code, and OTP provides reliable patterns.

  2. 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. 3

    Mix manages projects and build tasks. Hex supplies packages. When something fails, first identify which partner reported the problem.

Read a little more

Visit the original sources

Elixir Getting StartedErlang Getting StartedIntroduction to Mix
Station completeYou ran the experiment and thought through the answer. Save this station.