Draft:Odin (programming language)

Draft:Odin (programming language)

Copyedit and adding more sources

← Previous revision Revision as of 11:05, 19 April 2026
Line 2: Line 2:
{{Multiple issues|{{Primary Sources|date=February 2026}}{{Unreliable Sources|date=February 2026}} {{AI Generated|date=February 2026}}}}
{{Multiple issues|{{Primary Sources|date=February 2026}}{{Unreliable Sources|date=February 2026}} {{AI Generated|date=February 2026}}}}
{{Infobox programming language
{{Infobox programming language
| name = Odin
| name = Odin
| logo =
| logo =
| paradigm = [[Imperative programming|Imperative]], [[Data-oriented design|data-oriented]], [[procedural programming|procedural]]
| paradigm = [[Multi-paradigm]]: [[Imperative programming|Imperative]], [[Data-oriented design|data-oriented]], [[procedural programming|procedural]]
| family = [[C (programming language)|C]]
| year = {{Start date|2016|07}}
| year = {{Start date and age|2016|07|df=yes}}
| designer = Bill Hall
| designer = Bill Hall
| developer = The Odin Community
| developer = The Odin Community
| latest_release_version = dev-2026-02
| latest_release_version = dev-2026-02
| latest_release_date = {{Start date and age|2026|02|04}}
| latest_release_date = {{Start date and age|2026|02|04}}
| typing = [[Static typing|Static]], [[Strong typing|strong]], [[Type inference|inferred]]
| typing = [[Static typing|Static]], [[Strong typing|strong]], [[Type inference|inferred]]
| implementations = Odin Compiler ([[LLVM]]-based)
| implementations = Odin Compiler ([[LLVM]]-based)
| influenced_by = [[Pascal (programming language)|Pascal]], [[C (programming language)|C]], [[Go (programming language)|Go]], [[Oberon-2]], [[Newsqueak]], [[GLSL]]
| influenced_by = [[Pascal (programming language)|Pascal]], [[C (programming language)|C]], [[Go (programming language)|Go]], [[Oberon-2]], [[Newsqueak]], [[GLSL]]
| operating_system = [[Windows]], [[macOS]], [[Linux]], [[FreeBSD]]
| operating_system = [[Windows]], [[macOS]], [[Linux]], [[FreeBSD]]
| license = [[zlib License]]
| license = [[zlib License]]
| website = {{URL|https://odin-lang.org/}}
| website = {{URL|https://odin-lang.org/}}
| file_ext = .odin
| file_ext = .odin
}}
}}
'''Odin''' is a general-purpose, [[statically typed]], [[compiled language|compiled]] [[systems programming]] language designed by Bill Hall. It was created to serve as an alternative to [[C (programming language)|C]] using [[Data-oriented design|data-oriented programming]] and a modern type system.[https://www.infoworld.com/article/3635189/11-cutting-edge-programming-languages-to-learn-now.html Peter Wayner, 11 cutting-edge programming languages to learn now, InfoWorld][https://hackernoon.com/why-odin-deserves-a-place-beside-c-zig-and-rust-in-your-toolbox Dayvster, Why Odin Deserves a Place Beside C, Zig, and Rust in Your Toolbox, hackernoon.com]
'''Odin''' is a general-purpose, [[statically typed]], [[compiled language|compiled]] [[systems programming]] language designed by Bill Hall.{{Cite web |title=Learn Odin in Y Minutes |url=https://learnxinyminutes.com/odin/ |access-date=2026-04-19 |website=learnxinyminutes.com}} It was created to serve as an alternative to [[C (programming language)|C]] using [[Data-oriented design|data-oriented programming]] and a modern type system.[https://www.infoworld.com/article/3635189/11-cutting-edge-programming-languages-to-learn-now.html Peter Wayner, 11 cutting-edge programming languages to learn now, InfoWorld][https://hackernoon.com/why-odin-deserves-a-place-beside-c-zig-and-rust-in-your-toolbox Dayvster, Why Odin Deserves a Place Beside C, Zig, and Rust in Your Toolbox, hackernoon.com]{{Cite web |date=2026-03-11 |title=Just What IS Odin, Anyway? |url=https://dev.to/dimension-ai/just-what-is-odin-anyway-542a |access-date=2026-04-19 |website=DEV Community |language=en}}


The language avoids [[Object-oriented programming|object-oriented]] concepts such as classes and inheritance. Instead it offers features such as [[structs]], data composition, and a custom context system.{{cite web |title=Odin Programming Language documentation |url=https://odin-lang.org/docs/overview/ |website=Odin-lang.org |publisher=The Odin Programming Language |access-date=17 January 2026}} It is a general purpose language with systems-level performance, so it can be used in [[game development]] and computer graphics. It is used as the primary language for the software developed by JangaFX.{{cite web |title=VDB Deep Dive |url=https://jangafx.com/insights/vdb-a-deep-dive |website=JangaFX.com |access-date=17 January 2026 |quote=It is written in the Odin programming language, which we use at JangaFX for developing our products.}}
The language avoids [[Object-oriented programming|object-oriented]] concepts such as classes and inheritance. Instead it offers features such as [[structs]], data composition, and a custom context system.{{cite web |title=Odin Programming Language documentation |url=https://odin-lang.org/docs/overview/ |website=Odin-lang.org |publisher=The Odin Programming Language |access-date=17 January 2026}} It is a general purpose language with systems-level performance, so it can be used in [[game development]] and computer graphics. It is used as the primary language for the software developed by JangaFX.{{cite web |title=VDB Deep Dive |url=https://jangafx.com/insights/vdb-a-deep-dive |website=JangaFX.com |access-date=17 January 2026 |quote=It is written in the Odin programming language, which we use at JangaFX for developing our products.}}


== History ==
== History ==
Development of Odin began in July, 2016, by Bill Hall (often referred to online as "Ginger Bill").{{cite web |title=Odin FAQ: History |url=https://odin-lang.org/docs/faq/ |website=Odin-lang.org |access-date=17 January 2026}} Hall began the project due to frustration with [[C++]] and a desire for a language that offered the low-level capabilities of C with modern quality-of-life improvements, strict type safety, and better memory control.
Development of Odin began in July, 2016, by Bill Hall (often referred to online as "Ginger Bill").{{cite web |title=Odin FAQ: History |url=https://odin-lang.org/docs/faq/ |website=Odin-lang.org |access-date=17 January 2026}} Hall began the project due to frustration with [[C++]] and a desire for a language that offered the low-level capabilities of C with modern quality-of-life improvements, strict type safety, and better memory control{{Cite AV media |url=https://www.youtube.com/watch?v=0mbrLxAT_QI |title=Odin creator Ginger Bill on his programming language and state of software! |date=2024-12-19 |last=Wookash Podcast |access-date=2026-04-19 |via=YouTube}}.


The language has been developed as an [[open-source]] project, hosted on [[GitHub]], with contributions from the community. It is currently in active development, with frequent releases aimed at stabilising a specification before reaching version 1.0.
The language has been developed as an [[open-source]] project on [[GitHub]] since 7th July 2016{{Cite web |last=odin-lang |title=Initial Commit · odin-lang/Odin@7430008 |url=https://github.com/odin-lang/Odin/commit/7430008fd7088339821923bdff533369b7967904 |access-date=2026-04-19 |website=GitHub |language=en}}, with contributions from the community. It is currently in active development, with frequent releases aimed at stabilising a specification before reaching version 1.0.


== Design and philosophy ==
== Design and philosophy ==
Odin is designed with a focus on simplicity,{{cite web |url=https://learnodin.org/odin/introduction/ |title=Introduction to Odin |website=LearnOdin.org |access-date=17 January 2026}} high performance, and modern systems programming needs. While it shares the goal of being a system-level language like [[C (programming language)|C]], it features distinct syntax and behavior compared to C, adopting a Pascal-style declaration syntax and strict type separation.{{cite web |title=Compare Languages: Odin |url=https://c3-lang.org/faq/compare-languages/ |website=c3-lang.org |publisher=C3 Language Project |access-date=17 January 2026}} To support high-performance graphics and game development, the language includes a rich built-in set of types for mathematics, including vectors, matrices, and quaternions, as well as native support for [[Endianness|endian-specific]] types.
Odin is designed with a focus on simplicity,{{cite web |url=https://learnodin.org/odin/introduction/ |title=Introduction to Odin |website=LearnOdin.org |access-date=17 January 2026}} high performance, and modern systems programming needs. While it shares the goal of being a system-level language like [[C (programming language)|C]]{{Cite web |date=2024-06-07 |title=Introduction to the Odin Programming Language |url=https://zylinski.se/posts/introduction-to-odin/ |access-date=2026-04-19 |website=zylinski.se |language=en}}, it features distinct syntax and behavior compared to C, adopting a Pascal-style declaration syntax and strict type separation.{{cite web |title=Compare Languages: Odin |url=https://c3-lang.org/faq/compare-languages/ |website=c3-lang.org |publisher=C3 Language Project |access-date=17 January 2026}} To support high-performance graphics and game development, the language includes a built-in set of types for mathematics, including vectors, matrices, and quaternions, as well as native support for [[Endianness|endian-specific]] types.


=== Data-oriented design ===
=== Data-oriented design ===
A core pillar of Odin's philosophy is [[Data-oriented design|data-oriented design]]. The language provides native features to manipulate memory layouts efficiently, catering to modern CPU cache architectures. This includes built-in support for [[AoS and SoA|struct of arrays]] (SoA) data structures. While many languages require manual implementation of SoA layouts, Odin provides specific syntax, such as #soa slices and arrays, to automatically transform data structures. This allows developers to switch between Array of Structures (AoS) and SoA without significant refactoring of the codebase.{{cite web |last=Zylinski |first=Karl |title=Structure of Arrays in Odin |url=http://www.odinbook.com/ |website=Odinbook.com |access-date=17 January 2026}}
A core pillar of Odin's philosophy is [[Data-oriented design|data-oriented design]]. The language provides native features to manipulate memory layouts efficiently, catering to modern CPU cache architectures. This includes built-in support for [[AoS and SoA|struct of arrays]] (SoA) data structures. While many languages require manual implementation of SoA layouts, Odin provides specific syntax, such as #soa slices and arrays, to automatically transform data structures. This allows developers to switch between Array of Structures (AoS) and SoA without significant refactoring of the codebase.{{cite web |last=Zylinski |first=Karl |title=Structure of Arrays in Odin |url=http://www.odinbook.com/ |website=Odinbook.com |access-date=17 January 2026}}


=== Memory management ===
=== Memory management ===
Line 49: Line 50:


=== Hello World ===
=== Hello World ===
package main
package main


import "core:fmt"
import "core:fmt"
Line 56: Line 56:
main :: proc() {
main :: proc() {
fmt.println("Hello, World!")
fmt.println("Hello, World!")
}
}


=== Pointers ===
=== Pointers ===
Line 68: Line 67:


== Ecosystem and usage ==
== Ecosystem and usage ==
Odin includes a "core" library for standard functionality (IO, math, networking) and a "vendor" library. The vendor library integrates popular third-party C libraries, such as [[OpenGL]], [[Vulkan (API)|Vulkan]], [[Simple DirectMedia Layer|SDL]], and [[Raylib]], directly into the distribution to facilitate immediate development for graphics and games.
Odin includes a "core" library for standard functionality (IO, math, networking) and a {{Code|vendor|odin}} library. The vendor library integrates popular third-party C libraries, such as [[OpenGL]], [[Vulkan (API)|Vulkan]], [[Simple DirectMedia Layer|SDL]], and [[Raylib]], directly into the distribution to facilitate immediate development for graphics and games.


=== Notable software ===
=== Notable software ===
Line 78: Line 77:
== External links ==
== External links ==
* {{Official website|https://odin-lang.org/}}
* {{Official website|https://odin-lang.org/}}
* [https://www.odinbook.com/ The Odin Book by Karl Zylinski]
* {{GitHub|odin-lang/odin|Odin Repository}}
* {{GitHub|odin-lang/odin|Odin Repository}}
* [https://www.odinbook.com/ The Odin Book by Karl Zylinski]
{{Portal|Computer programming|Free and open-source software}}
{{Portal|Computer programming|Free and open-source software}}
{{Programming languages}}
{{Programming languages}}