New Features
- New importation system
importusing importexport
- Import collections
- `import "core:fmt.odin"
import "shared:glfw.odin"-collection=foo=path/to/foo
- Improved
foreignsystemforeign importforeignblocksforeign exportblocksforeign 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;
inlineandno_inlineprefix 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
switchreplacesmatchcontext <- expr {}replacespush_context expr {}push_allocatorhas been removed in favour of general procedures to generate contexts-build-mode=dllreplacesbuild-dll
Core library additions
mem.ptr_to_bytesassertandpanicuseprintfstyle parameters