Skip to content

Odin v0.7.1

Compare
Choose a tag to compare
@gingerBill gingerBill released this 19 Nov 09:59
· 12703 commits to master since this release

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