Preface
I learn by doing. So I'll have you write a lot of small, complete programs, each one teaching a single idea, before we build something bigger that puts it all together. By the end, you'll have written a temperature converter, a word counter, a handful of ASCII figures, a number-guessing game, a screen you can clear, colour, and frame with box-drawing characters, and finally Muninn, a small DOS-style console note-keeper you'll be able to run, use, and hand to someone else.
Who this is for
Ok, honestly, this is for me, no jokes. I learn better by doing, and Odin is something I'm very keen on getting much better at. That being said, if you are interested in learning Odin, this might be of value to you if...
You've written some code before, in something: even a single weekend of Python counts, or a JavaScript project you half-finished. You've never written Odin, or you've poked at it and want a proper run through it this time. You're comfortable enough at a terminal to run a compiler and edit a file. That's genuinely the whole list.
This isn't a first-ever-programming book: loops, functions, and variables should already feel like ideas you sort of get, just not in this particular language yet. And unlike my two sibling volumes, it assumes nothing about games, vectors, or graphics APIs. If you want the gentlest possible on-ramp to Odin itself, before deciding whether you want to point it at a browser or a game window, you're in the right place.
What you'll build
Most chapters here give you your own small, complete, standalone program: that's deliberate. You'll write a Fahrenheit/Celsius converter, a word counter, a nested-loop shape drawer, a number-guessing game, and a file-backed notes tool: each one fully working on its own, each one teaching you something you'll actually reuse.
From Chapter 7 onward, a second thread starts running alongside those standalone programs: a DOS-style text interface, built entirely from raw ANSI escape sequences you write yourself, no library involved. From Chapter 9, everything converges into Muninn, named for Memory, one of Odin's ravens, which feels right for a program whose whole job is remembering your notes between runs. By Chapter 12, you'll have a single native binary you could genuinely hand to a friend and say, "Here, try this."
The ground rules
A handful of constraints shape every chapter, and each is a deliberate teaching decision, not an accident:
- Only what Odin ships. The compiler and its bundled
core:/base:packages: no third-party libraries anywhere, and specifically no terminal/ncurses-style binding. The DOS look you'll build comes from writing ANSI/VT100 escape sequences directly, which I treat as a real, first-class technique rather than a workaround you'd reach for a library to avoid. - Text only. No images, no fonts, no sound files. Every visual effect is characters and colour codes printed to standard output.
- Self-contained. Nothing in any chapter is fetched from outside. Every standalone program appears in full in the chapter that builds it; Muninn's finished source appears in full in Appendix B.
- Exercise-dense. Every chapter ends with several exercises of rising difficulty: extending what you just wrote, or working out what would break and why. My centre of gravity here is you typing programs in and pushing on them, not reading about somebody else's build.
How to read it
Build along, don't just read. Type every program in, run it, look at what it actually prints before moving on. Every code block in this book is real Odin I compiled and ran; where a chapter shows you exact output, that output is what really printed, not an approximation.
Three kinds of callout recur throughout:
Why: the reasoning behind a design choice, not just the mechanics of it.
Gotcha: a real trap you're likely to hit sooner or later. Worth remembering these; when a strange bug shows up two chapters later, this is often where the answer already lives.
Odin note: a language detail worth pausing on, usually with a link to the official docs.
Where to go next (before you've even started)
This is the gentlest entry point into a small family of three. Once you've finished it and want to point what you've learned at something with graphics, sound, and a real-time loop, two sibling volumes are waiting:
- Yo Odin (https://nofuss.co.za/yo_odin/): a WebAssembly arcade game, built from an empty directory down to the browser boundary, with your own batched-Canvas2D renderer along the way.
- Odin't Know That (https://nofuss.co.za/odint_know_that/): a native desktop endless runner using
vendor:raylib, one source tree compiling unchanged on Windows, macOS, and Linux.
Neither requires the other, but if you're choosing where to start, start here. And for the whole language, in far more depth than any of my three books attempt, Karl Zylinski's Understanding the Odin Programming Language (https://odinbook.com/) is the one to reach for next.
My thanks are due to Ginger Bill and the Odin community for a language this pleasant to write about.
Right. Let's go annoy the compiler.