Releases: odin-lang/Odin
Releases · odin-lang/Odin
Odin v0.9.0
New Features
package
system- Improved PDB support with code inspection
typeid
type (also a keyword)type
is not a keyword any moreopaque
type- Parameteric polymorphic union type:
union(T: typeid, N: int) {int, T, [N]T}
bit_set
type:bit_set[Some_Enum];
bit_set['A' .. 'Z'];
bit_set[0..8; u16];
cstring
type (useful for interfacing with C libraries)in
binary operator formap
andbit_set
types:x in y
- Parametric polymorphic signature changes with polymorphic names:
new :: proc($T: typeid) -> ^T {}
make_int_array :: proc($N: int) -> [N]int {}
foo :: proc($N: $I, $T: typeid) {}
auto_cast
unary operator- Explicit
inline
andno_inline
on procedure calls deprecated
attributes- Built-in procedures:
#defined
#assert
compile time assertexpand_to_tuple
for (fixed length) arraystypeid_of
"intrinsics"
package:- Atomics
- Diverging procedures
proc() -> !
(no return) using Foo :: enum {A, B, C}; f := A;
Foo :: enum {A, B, C}; len(Foo)
- New
context
features:temp_allocator
logger
(Still in development)- Assigning directly to context parameters creates a new
context
- (
context
is scope based)
- New compiler flags:
-lld
(use LLD as the linker on Windows)
- Improved minimum dependency building
foreign import x {"foo.lib", "bar.lib"}
Removed Features
using in
- Old import system (replaced with the
package
system)
LLVM Binaries for Windows
llvm-windows Allow enums for array lengths
Odin v0.8.1
Fixes
- Fix initialization value for variables
Odin v0.8.0
New Features
- Basic Debug Information Support
- PDB generation with
-debug
- PDB generation with
distinct
typesMy_Int :: distinct int;
My_Int != int
Foo_Bar :: int;
Foo_Bar == int
struct
,enum
,union
,proc
, andbit_field
types will always be distinct if named
- Sized booleans
b8
b16
b32
b64
- Removal of 128 bit integers
using in
using println in import "core:fmt.odin"
using a, b, c in foo;
enum #export
Foo :: enum #export {A, B, C}; a := A;
- Explicit procedure overloading
foo :: proc[bar, baz, asd, goop];
- Remove of implicit procedure overloading
- New build flags:
-no-bounds-check
-debug
- Improved minimal dependency build
Odin v0.7.1
Patch Changes
- Update version string
- Update command line usage text
New Features
- New importation system
import
using import
export
- Import collections
- `import "core:fmt.odin"
import "shared:glfw.odin"
-collection=foo=path/to/foo
- Improved
foreign
systemforeign import
foreign
blocksforeign export
blocksforeign import "system:kernel32.lib"
- Global variable dependency initialization ordering
- Attribute system
@(link_name="gb_foo") foo :: proc() {};
@(link_prefix="gb_") foo :: proc() {};
- Please see wiki for more
- Array Programming - arithmetic on fixed length arrays
a, b: [4]f32;
c := 2*(-a + b) / 3;
d := swizzle(c, 1, 0, 3, 2);
uintptr
- Type aliases
My_Int :: #alias int;
inline
andno_inline
prefix keywords for procedure literalsfoo :: inline proc() {}
- Procedure calling convention syntax
proc "c" ()
proc "std" ()
proc "contextless" ()
- Default arguments allowed after a variadic parameter
print :: proc(args: ...any, loc := #caller_location) {}
- Polymorphic array lengths
proc(a: [$N]$T)
Syntax Changes
switch
replacesmatch
context <- expr {}
replacespush_context expr {}
push_allocator
has been removed in favour of general procedures to generate contexts-build-mode=dll
replacesbuild-dll
Core library additions
mem.ptr_to_bytes
assert
andpanic
useprintf
style parameters
Odin v0.7.0
New Features
- New importation system
import
using import
export
- Import collections
- `import "core:fmt.odin"
import "shared:glfw.odin"
-collection=foo=path/to/foo
- Improved
foreign
systemforeign import
foreign
blocksforeign export
blocksforeign import "system:kernel32.lib"
- Global variable dependency initialization ordering
- Attribute system
@(link_name="gb_foo") foo :: proc() {};
@(link_prefix="gb_") foo :: proc() {};
- Please see wiki for more
- Array Programming - arithmetic on fixed length arrays
a, b: [4]f32;
c := 2*(-a + b) / 3;
d := swizzle(c, 1, 0, 3, 2);
uintptr
- Type aliases
My_Int :: #alias int;
inline
andno_inline
prefix keywords for procedure literalsfoo :: inline proc() {}
- Procedure calling convention syntax
proc "c" ()
proc "std" ()
proc "contextless" ()
- Default arguments allowed after a variadic parameter
print :: proc(args: ...any, loc := #caller_location) {}
- Polymorphic array lengths
proc(a: [$N]$T)
Syntax Changes
switch
replacesmatch
context <- expr {}
replacespush_context expr {}
push_allocator
has been removed in favour of general procedures to generate contexts-build-mode=dll
replacesbuild-dll
Core library additions
mem.ptr_to_bytes
assert
andpanic
useprintf
style parameters
Odin v0.6.2
Changes
Slightly modify the naming convention.
In general, Ada_Case for types and snake_case for values
Import Name: snake_case (but prefer single word)
Types: Ada_Case
Union Variants: Ada_Case
Enum Values: Ada_Case
Procedures: snake_case
Local Variables: snake_case
Constant Variables: SCREAMING_SNAKE_CASE
Odin v0.6.1a
Changes
- Minor fixes for *nix systems
Odin v0.6.1
Changes
- Fix parser threading bug on Windows
- Disable parser threading on *nix
-thread-count=N
- Remove temporary files
- -
keep-temp-files
Odin v0.6.0
Additions and Changes
- Restore original declaration syntax
- Parametric Polymorphism ("Generics")
- Procedures
new :: proc(T: type) -> ^T {...}
new_clone :: proc(v: $T) -> ^T {...}
copy :: proc(dst, src: $T/[]$E) -> int {...}
- Structures
Vector :: struct(N: int, T: type) { e: [N]T; };
- Type specialization
make :: proc(T: type/[]$E) -> T {...}
add :: proc(a, b: $T/Vector) -> T {...}
sub :: proc(a, b: $T/Vector) -> T {...}
foo :: proc(b: ^Bar($T, $E)) {...}
exists :: proc(m: map[$K]$V, key: K) -> bool {...}
- Procedures
union
union{int, f32, FooBar, string, map[int]string}
- Duality between
any
andunion
now. Same usage with syntax.
raw_union
is now a tag onstruct
struct #raw_union {...}
struct
fields use semicolonsstruct {x: f32; y: int; z: string}
- Nested Struct Declarations
struct {
// constants
FOO :: 123;
MyInt :: int;
// fields
x: int;
}
- Default Struct Values
struct {
s: string = "Hellope";
i := 123;
b: bool; // zero value
}
do
for inline statements rather than blockif cond do foo();
- Removed
++
,--
- Use
+=
and-=
instead
- Use
- Removed
atomic
- Type operator precendence change
^T(x) == ^(T(x))
- Additional casting syntax
cast(T)x
(T)(x)
- Uninitialized value
---
- Removal of
*_val_of
- Replaced with
size_of
,align_of
,offset_of
,type_of
,type_info_of
- Replaced with
- Compiler options:
-opt=0,1,2,3
-show-timings
-thread-count=4
- Multi-threaded Parser