New Language Features
or_returnatom expression (suffix)- extremely useful for early returning with multiple return values
x, err = foo(); if err != nil { return }can now becomesx = foo() or_return;
or_elseas a binary (infix) operator- Multi-Pointers
[^]T- A way to describe foreign (C-like) pointers which act like arrays (pointers that map to multiple items)
- The main purpose of this type is to aid with foreign code and act as a way to auto-document functionality and allow for easier transition to Odin code, especially converting pointers to slices.
- Allow
lenandcapto returnuintif a type isuintto aid people wanting to use unsigned integers - Unify semantics of the built-in
swizzleprocedure with the selector expression semantics e.g..xyz - Define where
#bounds_checkand#no_bounds_checkcan be applied- May only be applied to one of the following statements:
{},if,when,for,switch,return,defer, assignment, variable declaration - May only be applied to a variable declaration, and not a constant value declaration
- May only be applied to one of the following statements:
Packages
core:math/big(big integer support)core:encoding/hxa(reader and writer)core:c/libc- (mostly) projected all of C11's standard library to Odin, as defined by the C11 specification: N1570, or ISO/IEC 9899:2011.- Remove
core:encoding/cel - The new
vendorlibrary collection vendor:sdl2- Full bindings to the SDL2 library
- Ships with DLLs and Libs for Microsoft Windows
- Bundled with
gamecontrollerdb.txt
vendor:sdl2/imagevendor:sdl2/mixervendor:sdl2/netvendor:sdl2/ttfvendor:OpenGLvendor:vulkanvendor:glfwvendor:portmidi
Compiler Improvements
- Unify multithreading logic through the compiler
- Remove numerous possible race conditions
- Disallow
usingon enum declarations in favour of implicit selector expressions:.A - Simplify data structures within the compiler for better memory reuse
- Correct
DllMainbehaviour - Delete a lot of dead code
General Changes
- Prefer
..=over..in the core library - Add
Allocator_Error.Mode_Not_Implemented - Allow
+in import paths - Add
#any_intdirective to replaceauto_castuses on parameters - Add
map_insertwhich returns the pointer to the inserted value (assuming no resizes happen in the mean time)