Condensed Odin Language Overview
Odin is a small, simple, pragmatic, consistent, batteries-included, non-OO, general-purpose language (which also contains features to support low-level programming). Odin is ergonomic. It’s a compiled language, and utilizes manual memory management. Some details about Odin:
- source files end in “.odin”
// comment,/* multi-line comment*/- curlies, but no semis (well, semicolons optional)
- arrays and maps are built-in
- not OO. No methods.
- package = library = directory of .odin files (all with the same
packageline at the top) x: intdeclarexas an int. Init val = 0x: int = 3is unnecesary; instead, just do:x := 3(the type is inferred)- types of ints:
i8,i16,i32,i64(intisi64on 64-bit machine) - types of unsigned ints:
u8,u16, etc. - types of floats:
f16,f32,f64 - inferred type of 3 is
int. inferred type of 3.0 isf64. - bools are
trueandfalse - strings work like you’d expect:
s := "hello world"
See also https://odin-lang.org/docs/overview/.