Odin Tutorial

Odin is a general-purpose, statically typed, compiled language created by Ginger Bill in 2016 for modern systems programming. It favours simplicity and orthogonality over cleverness: no hidden allocations, no method tables, no exceptions — just explicit data, explicit memory, and code you can read top to bottom.

Scope: Study the topics in order, compile every example with the Odin toolchain, and treat the language overview as the authority when this track and your compiler disagree.

Odin Study Progress

0% Complete
# ODIN Topic Description
PHASE 1: LANGUAGE FOUNDATIONS
01Why Odin & Design PhilosophyOrigins, simplicity, data-oriented design, and what Odin refuses to hide.
02Toolchain & EnvironmentInstall Odin, run a first program, and understand the build modes.
03Statements, Expressions & CommentsIdentifiers, punctuation, operators, and source layout rules.
PHASE 2: TYPES & CONTROL
04Data Types & ValuesIntegers, floats, runes, booleans, distinct types, and inference.
05Operators & ExpressionsArithmetic, comparison, bitwise operators, and evaluation rules.
06Control Flow: if, when & switchRuntime branching, compile-time when, and exhaustive switch.
07Loops & IterationThe single for form, ranges, matrix iteration, and labels.
PHASE 3: COMPOSITION
08Procedures & Parametersproc declarations, multiple results, defaults, and procedure values.
09Structs, Enums & UnionsModelling data with struct, enum, bit_set, and using fields.
10Arrays, Slices & Dynamic ArraysFixed arrays, slices as views, and allocator-backed dynamic arrays.
11Maps & bit_set SetsHash maps, map iteration, and sets built from enum-backed bit sets.
PHASE 4: MEMORY & DATA-ORIENTED DESIGN
12Pointers & Memory AddressingAddress-of, dereferencing, multi-pointers, and raw memory.
13Allocators & the Context SystemExplicit allocation, the implicit context, and custom allocators.
14Data-Oriented Design (SOA/AOS)Record layout versus split arrays for cache-friendly hot loops.
PHASE 5: RELIABILITY & METAPROGRAMMING
15Errors, defer & or_returnErrors as values, deterministic cleanup, and propagation.
16Parametric PolymorphismProcedures and structs parameterised by type, plus where clauses.
17Compile-time Programmingwhen blocks, intrinsics, and #+build conditional compilation.
18Packages & Collectionspackage main, imports, collections, and the core/vendor libraries.
PHASE 6: INTEROP & TOOLING
19Foreign Interface (C Interop)foreign import, calling C, and sharing data across the boundary.
20Concurrency & Threadingcore:thread, synchronisation primitives, and parallel work.
21Testing, Formatting & Debuggingodin test, assertions, formatting, and compiler diagnostics.
PHASE 7: PRACTICE & DEMO
22Lab ExamplesRun and modify single-file practice demos for every lesson.
23Study ProjectsSmall composed programs that combine the whole language.
PHASE 8: REFERENCE
24References & ToolingPlaygrounds, official documentation, books, and sample repositories.
Credits: Lesson content drafted with DeepSeek via Fireworks AI. References: free tutorials below.

Free References

The full categorized table — online tooling, official documentation, and sample repositories — lives on the References & Tooling page. Start with these: