Skip to content

Releases: odin-lang/Odin

Odin v0.9.0

22 Nov 10:43
Compare
Choose a tag to compare

New Features

  • package system
  • Improved PDB support with code inspection
  • typeid type (also a keyword)
  • type is not a keyword any more
  • opaque 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 for map and bit_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 and no_inline on procedure calls
  • deprecated attributes
  • Built-in procedures:
    • #defined
    • #assert compile time assert
    • expand_to_tuple for (fixed length) arrays
    • typeid_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

03 Mar 11:14
Compare
Choose a tag to compare
llvm-windows

Allow enums for array lengths

Odin v0.8.1

11 Feb 11:17
Compare
Choose a tag to compare

Fixes

  • Fix initialization value for variables

Odin v0.8.0

09 Feb 18:19
Compare
Choose a tag to compare

New Features

  • Basic Debug Information Support
    • PDB generation with -debug
  • distinct types
    • My_Int :: distinct int; My_Int != int
    • Foo_Bar :: int; Foo_Bar == int
    • struct, enum, union, proc, and bit_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

19 Nov 09:59
Compare
Choose a tag to compare

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 system
    • foreign import
    • foreign blocks
    • foreign export blocks
    • foreign 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 and no_inline prefix keywords for procedure literals
    • foo :: 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 replaces match
  • context <- expr {} replaces push_context expr {}
  • push_allocator has been removed in favour of general procedures to generate contexts
  • -build-mode=dll replaces build-dll

Core library additions

  • mem.ptr_to_bytes
  • assert and panic use printf style parameters

Odin v0.7.0

18 Nov 21:46
Compare
Choose a tag to compare

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 system
    • foreign import
    • foreign blocks
    • foreign export blocks
    • foreign 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 and no_inline prefix keywords for procedure literals
    • foo :: 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 replaces match
  • context <- expr {} replaces push_context expr {}
  • push_allocator has been removed in favour of general procedures to generate contexts
  • -build-mode=dll replaces build-dll

Core library additions

  • mem.ptr_to_bytes
  • assert and panic use printf style parameters

Odin v0.6.2

03 Aug 20:25
Compare
Choose a tag to compare

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

01 Aug 16:31
Compare
Choose a tag to compare

Changes

  • Minor fixes for *nix systems

Odin v0.6.1

01 Aug 14:25
Compare
Choose a tag to compare

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

30 Jul 21:30
Compare
Choose a tag to compare

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 {...}
  • union
    • union{int, f32, FooBar, string, map[int]string}
    • Duality between any and union now. Same usage with syntax.
  • raw_union is now a tag on struct
    • struct #raw_union {...}
  • struct fields use semicolons
    • struct {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 block
    • if cond do foo();
  • Removed ++, --
    • Use += and -= instead
  • 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
  • Compiler options:
    • -opt=0,1,2,3
    • -show-timings
    • -thread-count=4
  • Multi-threaded Parser