Preface
This is a beginner’s book for the basics of Elixir: the language fundamentals you need before you pick up Phoenix, Ash, Nerves, or any other BEAM framework. Pattern matching, the pipe operator, processes, modules and functions, higher-order functions, data types, control structures, recursion, Mix — the bedrock.
Good news first: if Elixir is your first programming language, you’re in for an easier ride than you’d guess. The syntax is small, the feedback loop (iex) is fast, and the compiler is friendly.
The honest part: if you’re coming from an object-oriented world — Java, C#, Python, Ruby — the jump to functional thinking is a real, steep hill. Everything you know about objects, inheritance, mutable state and "just add a field to that class" has to be unlearned. Pattern matching, immutability, processes, recursion: the furniture is unfamiliar. Plan for a week or two of feeling slow before things start to flow. It took me a long time too.
Worth every step of the hill. Once the functional paradigm clicks, it clicks hard — and the reward is OTP, LiveView, and the BEAM’s concurrency model, all things you won’t find assembled this well anywhere else.
The book is written the way I’d teach these basics in a workshop — bite-sized examples, one concept at a time — so you can work through it on your own at the same pace.
Shameless plug: if you’d rather have the training itself — personalized, on-site or remote — drop me an email at sw@wintermeyer-consulting.de.
The material started life as the Elixir chapter of the Phoenix book. It grew large enough to stand on its own and became a separate book. When you’ve got the language under your hands, the Phoenix guide is where the web framework picks up.
Most readers will write Elixir alongside an AI coding agent,
and this book assumes you are one of them. Everything still
works if you type every character yourself. Throughout the
book you will find boxes labelled Agentic Coding Tip
flagging the Elixir-specific places where an agent reliably
takes a wrong turn (reaching for mutation, forgetting that
= is pattern matching, wrapping everything in try /
rescue, turning user input into atoms), together with a
concrete CLAUDE.md rule or prompt that keeps the agent
honest. The tips assume Claude Code as the concrete tool,
but the underlying advice applies to any capable agent.
The sidebar lets you jump to any topic at any time — nothing is locked, and later chapters never assume you read the preceding ones to the letter. That said, the book is written to be read front to back: each topic sets up the next, examples build on earlier ones, and the shortest path from zero to confident Elixir is still "start at the top and keep going".
Further reading
Once the basics here click and you want to go deeper, the official language documentation at hexdocs.pm/elixir is the natural next step. It covers the same ground and much more, written by the people who build Elixir.
Don’t be a stranger
A book like this gets better every time a reader sends me a note.
-
Did a chapter click, or did it leave you more confused than before? Either answer is useful.
-
Found a typo, a broken example, code that no longer works on the current Elixir version, a link that 404s?
-
Missing a topic you expected? Or curious about something this book doesn’t cover?
Write me at sw@wintermeyer-consulting.de. Feedback, bug reports, kind words, angry words — all welcome.
If you’d rather go through GitHub, the source lives at wintermeyer/elixir-book. Issues, feature requests, pull requests — every one of them is appreciated.
— Stefan