All lessons

Your First Program

5 min · Elixir

Write and run your very first Elixir program, right here on the page.

Elixir · Your First Program0/5 cleared

Enemy 1 of 5

A script with no boilerplate

Elixir runs on the BEAM, the same virtual machine originally built for Erlang — a platform designed from the ground up to run thousands of lightweight, isolated processes and keep running even when individual pieces fail. That heritage is why Elixir is popular for chat systems, real-time services, and anything that needs to stay up under load: fault-tolerance and concurrency aren't bolted on, they're the reason the platform exists.

You won't touch any of that in this first lesson, but it's useful to know from the start: Elixir's syntax is deliberately simple and readable (borrowing a lot of its friendliness from Ruby), while the runtime underneath is built for serious, always-on systems.

Unlike many languages, Elixir doesn't require you to wrap your first line in a class, module, or "main" function just to run it — you can write a statement directly, and it executes top to bottom. `IO.puts` is the standard way to print a line of text: the text goes inside parentheses and double quotes, and `IO.puts` adds a newline afterward automatically, so the next line of output starts fresh underneath.

This directness is convenient for learning and for quick scripts. As programs grow, code gets organized into modules and functions (you'll meet those in a later lesson) — but there's no ceremony required just to get a line printed.

You
Binary Treant

Loading editor...

Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: Hello, World!