New Language Features
bit_fieldtype
Foo :: bit_field u16 { // backing type must be an integer or array of integers
x: i32 | 3, // signed integers will be signed extended on use
y: u16 | 2 + 3, // general expressions
z: My_Enum | foo.SOME_CONSTANT, // ability to define the bit-width elsewhere
w: bool | foo.SOME_CONSTANT > 10 ? 2 : 1,
}Handle :: bit_field u32 {
slot: u32 | 16,
generation: u32 | 15,
in_use: bool | 1,
}-
name: type | bit_width -
name: type | bit_width "field_tag"(similar to a struct field with a tag) -
Iteration over
bit_set
s: bit_set[Enum; u32]
for x in s {
...
}
// equivalent to
for x in Enum do if x in s {
...
}Compiler Improvements
- Improved Error Reporting System
- Sorted printing based on error position
- Ability to export error list to json
-json-errors -terse-errorsare only a single line now
- Error message suggestions for people making common C mistakes
- Aiding newcomers from C/C++ to Odin
- Loads of debug info refactors and improvements
- Add Haiku OS support by @avanspector & @xslendix in #3230
- Respect "smart linker" approaches
- Respect
-lldon non-Windows machines - Remove entry point when compiled with no-entry-point as shared library
- Numerous fixes to wasm targets
- Numerous fixes to ARM64 ABI on Darwin
- Numerous fixes to SysV AMD64 ABI on Darwin and Linux
- Speed up
path_to_fullpathon Linux/macOS - Numerous compiler fixes and error messages
New Packages
- Moved
vendor:darwin/Foundationtocore:sys/darwin/Foundation
Package Improvements
- Improvements to
core:crypto - Make raylib and stb_rect_pack be free of libc
- Numerous improvements to
core:encoding/json- Support writing enum value names
- Support for
using _: Tfields
- Fixes to
core:math/big - Fixes to
core:math/linalg - Fixes to
core:slice - Fixes to
core:odin/parser - General fixes to
base:runtime vendor:x11fixes- Allow for the new futex API on darwin platforms if it is available
- Fix
os.read_entire_filefor pipes and console
CI Improvements
- Update LLVM to 17 for the CI/Releases
Full Changelog: dev-2024-03...dev-2024-04