Odin
A systems programming language designed as a C alternative with data-oriented design, explicit control, and joy of programming.
Created by Bill Hall (Ginger Bill)
Odin is a general-purpose systems programming language designed as a modern alternative to C. Created by Bill Hall (known online as Ginger Bill), Odin emphasizes data-oriented design, explicit control over memory and procedure calls, and aims to bring “the joy of programming” to systems-level development. The official tagline describes it as “The C alternative for the Joy of Programming.”
History & Origins
Odin was born one evening in late July 2016, when Ginger Bill – a physicist with a background in condensed matter physics, quantum optics, and high precision metrology – grew frustrated with programming in C++. The initial prototype started as a Pascal clone with begin and end keywords, but quickly evolved into its own distinct language.
The first commit to the GitHub repository was made on November 23, 2016. Unlike many language projects that aim for a formal 1.0 release, Odin follows a monthly development release cycle with versions named dev-YYYY-MM. While the compiler has not declared a “1.0” milestone, the language is actively used in commercial production software.
Ginger Bill works at JangaFX, where all of the company’s products – including the EmberGen real-time fluid simulator – are written entirely in Odin. This provides strong real-world validation of the language’s capabilities.
Design Inspirations
The official FAQ states that Odin “borrows heavily from (in order of philosophy and impact): Pascal, C, Go, Oberon-2, Newsqueak, and GLSL.” The FAQ also notes that “Niklaus Wirth and Rob Pike have been the programming language design idols throughout this project.”
Language Design Philosophy
Odin takes a pragmatic approach to systems programming, with several core design principles:
- Data-oriented design - First-class support for Structure of Arrays (SOA) via the
#soadirective - Explicit over implicit - No implicit type conversions, no hidden control flow
- No exceptions - Error handling through multiple return values
- No classes or inheritance - Procedural style with structs and procedures
- No constructors or destructors - Explicit initialization and cleanup with
defer - Manual memory management - Custom allocators with an implicit context system
- No pointer arithmetic - Safety feature; helper procedures like
ptr_offsetare used instead
Key Features
Distinct Type System
Odin’s distinct type system is a defining feature. It allows creating new types that share the same underlying representation but are type-incompatible at compile time:
| |
This prevents entire categories of unit-mismatch bugs at compile time.
Implicit Context System
Odin uses an implicit context parameter passed through the call chain, carrying allocators and other configuration without explicit threading:
| |
Built-in Array Programming
Odin has native support for array operations and GLSL-style swizzling:
| |
Built-in Matrix Type
Odin includes a native matrix type with SIMD-optimized operations:
| |
Platform Support
Odin supports compiling on and targeting multiple platforms:
| Host OS | Architectures |
|---|---|
| Windows | x86-64 (requires MSVC) |
| Linux | x86-64, ARM64 |
| macOS | x86-64, ARM64 |
| FreeBSD | x86-64, ARM64 |
| NetBSD | x86-64, ARM64 |
| OpenBSD | x86-64 |
Odin can also compile to WebAssembly (wasm32/wasm64p32) targets. The compiler requires LLVM and Clang on Linux/BSD, MSVC on Windows, and both Xcode command-line tools and LLVM (via Homebrew) on macOS.
Odin vs. C
| Feature | Odin | C |
|---|---|---|
| Type system | Distinct types, tagged unions | Typedef aliases, untagged unions |
| Memory management | Custom allocators via context | Manual malloc/free |
| Error handling | Multiple return values | Error codes or errno |
| Generics | Built-in parametric polymorphism | Macros or void pointers |
| Array bounds | Bounds-checked by default | No bounds checking |
| String type | Built-in string type | Null-terminated char arrays |
| Pointer arithmetic | Not allowed | Allowed |
| Build system | Built into compiler | External (Make, CMake, etc.) |
Comprehensive Vendor Library
Odin ships with official bindings for many popular libraries:
- Graphics: OpenGL, Vulkan, Metal, Direct3D 11/12
- Windowing: SDL2, SDL3, GLFW
- Game development: raylib
- Audio: miniaudio
- Networking: Built-in socket support
This makes Odin particularly well-suited for game development and graphics programming without needing to write C bindings manually.
The Odin Community
- odin-lang.org - Official website with documentation and language overview
- GitHub - Active development at github.com/odin-lang/Odin
- Discord - Primary community communication channel
- Showcase - Official showcase page featuring projects built with Odin
Timeline
Notable Uses & Legacy
EmberGen
Real-time volumetric fluid simulator written entirely in Odin, used by studios including Bethesda, CAPCOM, and Weta Digital according to the official Odin showcase.
GeoGen / LiquiGen
Terrain and liquid simulation tools from JangaFX, also built with Odin.
Ols
Community-maintained Language Server Protocol implementation for Odin, featured on odin-lang.org, enabling IDE support.
Spall
A high-performance profiler tool with both web and native desktop versions.
Language Influence
Influenced By
Running Today
Run examples using the official Docker image:
docker pull primeimages/odin:latestExample usage:
docker run --rm -v $(pwd):/app -w /app primeimages/odin:latest sh -c 'cp hello.odin /tmp/hello.odin && cd /tmp && odin run .'