Odin Programming Language
For the full release notes of dev-2024-04, see its release
-vet
happybit_field
access on implicit dereferencebit_field
to core:odin
Full Changelog: https://github.com/odin-lang/Odin/compare/dev-2024-04...dev-2024-04a
bit_field
typeFoo :: 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 {
...
}
-json-errors
-terse-errors
are only a single line now-lld
on non-Windows machinespath_to_fullpath
on Linux/macOSvendor:darwin/Foundation
to core:sys/darwin/Foundation
core:crypto
core:encoding/json
using _: T
fieldscore:math/big
core:math/linalg
core:slice
core:odin/parser
base:runtime
vendor:x11
fixesos.read_entire_file
for pipes and consoleFull Changelog: https://github.com/odin-lang/Odin/compare/dev-2024-03...dev-2024-04
-no-crt
on Darwin and Linuxodin run
args take the first '--' as the start of the args, instead of the last '--'odin report
runtime.type_table
to allow RTTI to be constantly initialized on all platforms
#c_varargs
according to C rulescore:crypto/hash
core:container/avl
fmt.*printfln
add to core:fmt
core:mem/virtual
arena_static_reset_to
vendor:OpenGL
shader procedures inreturn
in json unmarshal for enumerated arraysID3DUserDefinedAnnotation
to direct3d packagevendor:raylib
to use non-universal binariesvendor:raylib
's ModelAnimation
alignment to match that of C'score:net
vendor:glfw
add RawMouseMotionSupported
core:math
roundFull Changelog: https://github.com/odin-lang/Odin/compare/dev-2024-02...dev-2024-03
As part of the Journey to Odin 1.0, we are cleaning up the packages that Odin provides and making explicit delineations for what is needed. A new library collection has been added: base
.
This means that there are now 3 official library collections as part of the official compiler:
base
- packages which are required by the language itself, defined by the language specification, and all compilers must implement (implementations may different, but interface must be the same)
freestanding
) will be supported in this library collectioncore
- packages which are core to most programming development and supported by most platforms.
vendor
- third-party packages with first-party support which are useful for numerous projects (graphics APIs, audio, window management, specialized networking, etc).
Packages which have been moved to the new base
library collection:
core:builtin
-> base:builtin
(previous is still valid as an alias)core:intrinsics
-> base:intrinsics
(previous is still valid as an alias)core:runtime
-> base:runtime
(previous is still valid as an alias)builtin.quaternion
call must name the elements with x y z w
or real imag jmag kmag
rather than be positionalstruct #field_align(N)
#packed
, but can be used with #align(N)
.#align(N)
is less than #field_align(N)
, then a warning will be printed.incl
and excl
built-in procedures. Prefer:
s += {.A,}
for incl(&s, .A)
s -= {.A,}
for excl(&s, .A)
@(entry_point_only)
attribute to mark a procedure which can only be called within main
(the entry point procedure)builtin
matrix procedures to intrinsics
base:intrinsics
or core:math/linalg
etc packagescore:simd/x86
calling conventions-subsystem
option on Windows-default-to-panic-allocator
"system"
calling convention everywhere "stdcall"
was previous used
core:mem/virtual
virtual.map_file
core:dynlib
dynlib.initialize_symbols
dynlib.last_error
core:c/libc
libc.to_stream
core:math/fixed
improvementsvendor:raylib
IsGestureDetected
bindingwasm
targetsbase:runtime
previously depended on (e.g. core:os
)-obfuscate-source-code-locations
flag to hash location strings-no-crt
now works-lSystem
linker warning#load
now works with absolute pathstemp_allocator
/arena edge casesassign_at_elems
bugcore:sys/linux
: syscall additionscore:sys/windows
: HIDPI, Error codes enumvendor:raylib
: update to version 5core:slice
: reduce_reverse
, filter_reverse
, repeat
, unique
, unique_proc
core:log
: Allocator
print formatted (kb, mb etc.) bytescore:fmt
: Make %g
the default for floatscore:encoding/json
: basic union unmarshalling-microarch:<string>
map
's minimum capacity to 8
from 64
union_tag_*
related stuff&x[i]
of ^#soa
typesvendor:x11/xlib
core:crypto
-no-crt
improvements to all platformscore:sys/linux
or_break
or_continue
#relative [^]T
(relative multi-pointers)
#relative []T
(relative slices)-sanitize:<string>
(can be applied together)
-sanitize:address
(Windows, Linux, Darwin)-sanitize:memory
(Linux)-sanitize:thread
(Linux, Darwin)raw_data(^matrix[R, C]T) -> [^]T
for in
and switch in
in favour of for _ in
and switch _ in
any
and typeid
ODIN_PLATFORM_SUBTARGET
global constant-vet-unused
-vet-shadowing
-vet-using-stmt
-vet-using-param
-vet-style
-vet-semicolon
-vet
is equivalent to -vet-unused -vet-shadowing -vet-using-stmt
//+vet
file tags
//+vet
enables -vet
for that file//+vet using-stmt
to enable -vet-using-stmt
for that file//+vet !using-stmt
disables -vet-using-stmt
if it is enabled in some way (e.g. -vet
)//+vet semicolon !using-stmt
enables -vet-semicolon
but disables -using-stmt
#reverse for
for &e, i in array
and for k, &v in map
and switch &v in ...
&e
value will still be of the same type but will be addressable (a reference to the actual value)
intrinsics.type_merge
ODIN_COMPILE_TIMESTAMP
(unix timestamp in nanoseconds)panic
allocator for wasm targetsio.Stream
interface - details
core:math/cmplx
vendor:fontstash
vendor:nanovg
math.sincos
vendor:darwin
packages@(require_results)
to many procedures within core
math
procedures "contextless"
Mutex
to mem.Tracking_Allocator
bindFramebuffer
was added to WebGL
packageself_cleanup
flag to properly auto-clean threadscore:fmt
for ODIN_ERROR_POS_STYLE