Content deleted Content added
mNo edit summary |
Citation bot (talk | contribs) Add: date, title, website. Changed bare reference to CS1/2. | Use this bot. Report bugs. | Suggested by Spinixster | Category:Draft articles on computing | #UCB_Category 51/568 |
||
Line 15:
| designer = Ginger Bill
| released = {{start date and age|2016|07|07}}
| latest release version = dev-2023-0x<ref>{{cite web |title=Latest releases |website=[[GitHub]] |url=https://github.com/odin-lang/Odin/releases|access-date=}}</ref>
| latest release date =
| latest preview version =
Line 25:
| file ext = .odin
| website = {{URL|//odin-lang.org/}}
| influenced by = [[Pascal (programming language)|Pascal]]<ref>https://gamefromscratch.com/odin-programming-language/</ref>, [[C (programming language)|C]], [[Go (programming language)|Go]], [[Oberon-2]], [[Newsqueak]], [[JAI_(programming_language)|Jai]]<ref>{{cite web |title=Jai vs Odin systems programming languages | website=[[YouTube]] |url=https://www.youtube.com/watch?v=M763xHjsPk4 |access-date=2022-07-06}}</ref>, [[GLSL]]<ref>{{cite web | url=https://odin-lang.org/docs/faq/ | title=Frequently Asked Questions }}</ref>
}}
'''Odin''' is an [[imperative programming|imperative]], [[General-purpose programming language|general-purpose]], [[compiled programming language|compiled]], [[statically typed]], and [[distinct types]] using [[system programming language]] designed by [[Ginger Bill]]<ref>{{cite web | url=https://www.youtube.com/watch?v=2YLA4ajby00 | title=Interview with Odin language creator gingerBill | website=[[YouTube]] }}</ref>
The language supports: [[compile-time]] [[parametric polymorphism]], [[Type introspection|runtime reflection]], [[cross-compilation]], [[manual memory management]], [[array programming]], and [[AoS_and_SoA|SOA]] data types.<ref>{{cite web | url=https://www.youtube.com/watch?v=iCqW_RepcW0 | title=Overloading and/Or (Multi) Methods in Julia, C, Odin, Nim, C#, & TypeScript | website=[[YouTube]] }}</ref><ref>{{Cite web|title=Overview|url=https://odin-lang.org/docs/overview/|access-date=2022-10-20|website=odin-lang.org}}</ref><ref>{{cite web | url=https://graphitemaster.github.io/odin_review/#quality-of-life | title=Odin programming language review }}</ref><ref>{{cite web | url=https://medium.com/swlh/something-is-happening-to-our-programming-languages-and-i-like-it-a66447beade | title=Something is Happening to Our Programming Languages, and I like It | date=31 May 2020 }}</ref>
== Example ==
Line 58:
== Design ==
Odin is designed to be an alternative for the [[C_(programming_language)|C programming language]]<ref>{{cite web |title=Introducing Odin Lang (Japanese) |url=https://qiita.com/sh1so6/items/40bdda93d6fa2f094fd7 |website=Qiita |access-date=2019-09-29}}</ref> to achieve "high performance" on "modern systems"<ref>https://odin-lang.org/</ref><ref>{{cite web | url=https://www.c3-lang.org/compare/#odin | title=Comparisons with other languages - C3 Documentation }}</ref>, with features like compile-time [[parametric polymorphism]], [[array programming]], and [[Type_introspection|runtime reflection]].
=== Syntax ===
Line 76:
=== Explicit procedure overloading ===
Odin has [[Function_overloading|procedure overloading]]<ref>{{cite web | url=https://graphitemaster.github.io/odin_review/#procedure-groups | title=Odin programming language review }}</ref>, but unlike C++ the overloads have to be specified explicitly.
<syntaxhighlight lang="go">
bool_to_string :: proc(b: bool) -> string {...}
Line 86:
===Array programming===
Odin provides [[array programming]]<ref>{{cite web | url=https://bgthompson.com/blog/octonions-in-odin.html | title=Generating the multiplication table for octonions in Odin }}</ref><ref>{{Cite web|title=Overview|url=https://odin-lang.org/docs/overview/#array-programming|access-date=2022-10-20|website=odin-lang.org}}</ref>, enabling arithmetics on array elements:
<syntaxhighlight lang="go">
Line 97:
</syntaxhighlight>
The language also features "swizzling" of arrays, similar to the operation in shader languages like GLSL.<ref>{{cite web | url=https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling | title=Data Type (GLSL) - OpenGL Wiki }}</ref>
<syntaxhighlight lang="go">
Line 140:
</syntaxhighlight>
The internal representation of a <code>matrix</code> in Odin is stored in [[Row-_and_column-major_order|column-major]] format<ref>{{cite web | url=https://odin-lang.org/docs/overview/#matrix-type | title=Overview }}</ref> while the matrix literals are written in standard (row-major like) order (e.g. <code>matrix[2, 3]f32</code> is internally <code>[3][2]f32</code> (with different a [[Data_structure_alignment|alignment]] requirement)). Column-major is used in order to utilize ([[SIMD]]) vector instructions effectively on modern hardware, if possible.
==Comparisons with other languages==
Line 155:
Compared to Go, Odin:
* Has [[manual memory management]]<ref>{{cite web | url=https://dev.to/patrickodacre/low-level-programming-with-odin-lang-perfect-for-beginners-5cc3 | title=Low-Level Programming with Odin Lang - Perfect for Beginners }}</ref>
* Does not have interfaces
==Notable software built with Odin==
* [[EmberGen]], a real-time [[Voxel|volumetric]] [[Fluid_animation|fluid simulator]] by [[JangaFX]]<ref>{{cite web | url=https://jangafx.com/software/embergen/ | title=EmberGen: Real-Time Fluid Simulations for Fire, Smoke, and Explosions! }}</ref><ref>{{cite web | url=https://gamefromscratch.com/embergen-real-time-fluid-simulation-2/ | title=EmberGen Real-Time Fluid Simulation | date=9 May 2022 }}</ref><ref>{{cite web | url=https://www.allanmckay.com/289/ | title=Episode 289 - EmberGen | date=9 March 2021 }}</ref>.
==See also==
|