Content deleted Content added
m Fix syntaxhighlight errors (via WP:JWB) |
Add more citations |
||
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]], [[GLSL]]<ref>https://odin-lang.org/docs/faq/</ref>
}}
'''Odin''' is an [[imperative programming|imperative]], [[General-purpose programming language|general-purpose]], [[statically typed]], [[distinctly typed]], [[compiled programming language|compiled]] [[system programming language]] designed by [[Ginger Bill]]<ref>https://www.youtube.com/watch?v=2YLA4ajby00</ref>
The language is designed for "high performance, modern systems, and built-in [[Data-oriented_design|data-oriented]] data types", supports [[compile-time]] [[parametric polymorphism]], [[Type introspection|runtime reflection]], [[cross-compilation]], [[manual memory management]], [[array programming]], and [[AoS_and_SoA|SOA]] data types.<ref>https://www.youtube.com/watch?v=iCqW_RepcW0</ref><ref>https://odin-lang.org/docs/overview/</ref><ref>https://graphitemaster.github.io/odin_review/#quality-of-life</ref><ref>https://medium.com/swlh/something-is-happening-to-our-programming-languages-and-i-like-it-a66447beade</ref>
== Example ==
Line 58:
== Design ==
Odin is designed as being an alternative for the [[C_(programming_language)|C programming language]] on "high performance, modern systems"<ref>https://odin-lang.org/</ref><ref>https://www.c3-lang.org/compare/#odin</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>https://graphitemaster.github.io/odin_review/#procedure-groups</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>https://bgthompson.com/blog/octonions-in-odin.html</ref><ref>https://odin-lang.org/docs/overview/#array-programming</ref>, enabling arithmetics on array elements:
<syntaxhighlight lang="go">
Line 155:
Compared to Go, Odin:
* Has [[manual memory management]]<ref>https://dev.to/patrickodacre/low-level-programming-with-odin-lang-perfect-for-beginners-5cc3</ref>
* Does not have interfaces
|