Skip to content
gingerBill edited this page Feb 23, 2020 · 34 revisions

Odin vs Jai

Time of writing: February 2020

Similarities:

Differences:

Odin Jai
Publicly Available Private Beta Only (Currently)
Strong Typed with virtually no implicit conversions Many implicit conversions similar to C++
Pascal-family Type System C-family Type System
Modula/Go style directory-based package system File-based library system
Discriminated union type
bit_set
bit_field type
cstring *u8 (not equivalent)
distinct type declarations
Built-in map type (User-level type)
Slicing notation like Python/Go [lo:hi]
where clauses for procedure and record types
switch statements which allow for multiple cases, ranges, and any/union types if cond=={ case x:
Explicit parameter declaration with for val, idx in array{} Implicit parameter declaration with for array { val, idx := it, it_index; }
Extensive constant system which "just works" reducing the need for implicit conversions Basic constant system
rune type for Unicode Codepoints s32 (signed 32-bit integer)
Unicode identifiers (Unknown)
Array programming Available explicitly through operator overloading
Operator overloading
Explicit procedure overloading Implicit procedure overloading
Zero is initialized Default struct fields
Built-in complex and quaternion types (User-level type)
ptr: ^int; i := ptr^; x := &i; ptr: *int; i := <<ptr; x:= *i;
proc(T) -> U (T) -> U
proc(a, b: int, c: string) (a: int, b: int, c: string)
#soa arrays (User-level type through metaprogramming and operator overloading)
Enumerated arrays
Iterators through procedures Iterators through macros
Ranged Fields for array compounds literals
Implicit Selector Expressions .A
#partial switch` (Unknown)
Arbitrary Compile Time Execution
Compile Time AST modification
Hygenic Macros
Clone this wiki locally