Releases: odin-lang/Odin
Releases · odin-lang/Odin
dev-2022-05
New Language Features
None
New Compiler Features
- New intrinsics:
intrinsics.type_is_multi_pointer
intrinsics.type_field_type
Compiler Improvements
- Numerous bug fixes
- Refactored filename handling
- Error message if the output is a directory
- Packages are assumed to be directory-based unless
-file
is supplied
New Packages
- New builtin
container_of
core:compress/shoco
A short string (de)compressorcore:container/intrusive/list
An intrusive linked listcore:encoding/varint
LEB128 encode and decodecore:encoding/xml
An XML parsercore:image/netpbm
A reader/writer for the NetPBM image formatscore:image/qoi
A reader/writer for the QOI image formatcore:image/tga
A writer for a common subset of the TGA formatcore:text/i18n
An easy way to translate your software using GetText or Qt Linguist translations
Package Improvements
- Additional D3D and win32 bindings and constants
- Unified
Sema
andAtomic_Sema
behaviour - Fix quaternion implementation #1644
- Updated Vulkan generator and package
- Fixed static arena assertion fail #1740
core:container/lru
Reduce allocations, fixescore:encoding/json
Unmarshal fixescore:hash/xxhash
Fixescore:path/filepath
Add file stem and long-extension procedurescore:slice
More helperscore:strings
Add Levenshtein distancecore:sync
Improvementscore:thread
New thread pool implementationvendor:metal
andvendor:darwin
numerous additions and fixes- Quicksort minor fix
dev-2022-04
New Language Features
- None
New Compiler Features
- Rework of the entire atomic intrinsics (similar to C11 in design)
Atomic_Memory_Order
enumatomic_type_is_lock_free
atomic_thread_fence
atomic_signal_fence
atomic_store
atomic_store_explicit
atomic_load
atomic_load_explicit
atomic_add
atomic_add_explicit
atomic_sub
atomic_sub_explicit
atomic_and
atomic_and_explicit
atomic_nand
atomic_nand_explicit
atomic_or
atomic_or_explicit
atomic_xor
atomic_xor_explicit
atomic_exchange
atomic_exchange_explicit
atomic_compare_exchange_strong
atomic_compare_exchange_strong_explicit
atomic_compare_exchange_weak
atomic_compare_exchange_weak_explicit
union #shared_nil
- This adds a feature to
union
which requires all the variants to have anil
value and on assign to the union, checks whether that value isnil
or not. If the value isnil
, the union will benil
(thus sharing thenil
value)
- This adds a feature to
- Improved build script for the compiler
- Numerous bug fixes
Compiler Improvements
- Improve
-help
messages for define/config
New Packages
- Completely redesigned
core:sync
- Designed from the ground up with making the zero value useful (no need to initialize nor destroy values)
- Utilizes the abilities of modern OSes with native futex support
- Primitives:
Mutex
RW_Mutex
Recursive_Mutex
Cond
Sema
Futex
- Extended:
Wait_Group
Barrier
Auto_Reset_Event
Ticket_Mutex
Benaphore
Recursive_Benaphore
Once
core:math/ease
Package Improvements
- Update Thread Pool in
core:thread
- More additions to
core:sys/windows
- Remove
#caller_location
from certain calls incore:container/small_array
vendor:stb/easy_font
fixes/improvements- Update
mem.nil_allocator
to match the same implementation inruntime
- Numerous improvements and additions to
core:strings
- Add
nil
check onast.walk
incore:odin/ast
- Numerous bug fixes
dev-2022-03
New Language Features
[Enum]Type{...}
checks for missing enumerated fields in a compound literal by default- Opt-out with
#partial [Enum]Type{...}
- Opt-out with
#sparse[Enum]Type
for non-contiguous enum fields used in an enumerated array type#partial #sparse[Enum]Type{...}
can be combined to allow for missing fields in a sparse enumerated array compound literal
New Compiler Features
- OpenBSD support
- Objective-C Runtime Intrinsics
intrinsics.objc_send
intrinsics.find_selector
intrinsics.find_class
intrinsics.register_selector
(only required when creating Objective-C classes at runtime)intrinsics.register_class
(only required when creating Objective-C classes at runtime)
intrinsics.constant_utf16_cstring
Compiler Improvements
//+private file
support- Numerous bug fixes
- Removal of
context.user_data
- Prefer
context.user_ptr
- Prefer
New Packages
- Native Metal package:
- These directly call the Objective-C message sending runtime directly and does not use a wrapper
vendor:darwin/Metal
vendor:darwin/QuartzCore
vendor:darwin/Foundation
- DirectX packages
- Article: https://odin-lang.org/news/major-graphics-apis/
vendor:directx/d3d11
vendor:directx/d3d12
vendor:directx/d3d_compiler
vendor:directx/dxgi
core:container/topological_sort
Package Improvements
core:mem/virtual
Linux Support- Add
is_16_bit_from_memory
tovendor:stb/image
dev-2022-02
New Language Features
None
New Compiler Features
- Add
#no_type_assert
and#type_assert
to disable implicit type assertions withx.(T)
- Add
ODIN_ERROR_POS_STYLE
constant and-error-pos-style:<string>
option to allow for default or unix style error messages
Compiler Improvements
- Correct debug information logic for procedure parameters
- General improvements to
odin doc
support the new https://pkg.odin-lang.org/ - Correct
//+private
forodin doc
- Make
ODIN_ENDIAN
a constant enum value rather than a string - Rename architecture
386
toi386
- Improve entry code handling to support more platforms easily in the future
- Improve/simplify quaternion casting
New Packages
core:container/lru
- Rename
core:path
tocore:path/slashpath
Package Improvements
slice.stable_sort*
procedures- Add allocator parameter to
rand.perm
rand.exp_float64
strings.split_lines*
procedures
dev-2022-01
New Language Features
None
New Compiler Features
None
Compiler Improvements
- Correct
odin doc
default parameter valueinit_string
generation - Improve debug symbol retention with
-debug -o:minimal
- Disallow
@(static)
and@(thread_local)
withindefer
statements - Improvements for Darwin ARM64 support
- Improved float to quaternion conversion support
- Improved global
when
handling
New Packages
- Replace
core:container
with new packages core:container/bit_array
core:container/priority_queue
core:container/queue
core:container/small_array
Package Improvements
- Improvements to
core:math/big
- Improvements to
core:odin/parser
- Make
strconv
more robust - Fix typo in
core:json/encoding
fromunmarshall
tounmarshal
- Remove the extra hidden
0
terminator fromstrings.clone
andbytes.clone
which was there for very old legacy reasons, preferstrings.clone_to_cstring
when that behaviour is needed - Fix
strings.fields_proc
andstrings.index_any
- Fix
math.prod
- Add
hash.djbx33a
- Add
sort.map_entries_by_key
andsort.map_entries_by_value
dev-2021-12
New Language Features
- Allow casting from floats to complex numbers and quaternions
@(linkage=<string>)
for procedures and variables@(require)
for procedures#load_hash(<filepath>, <string-hash-kind>)
-target:js_wasm32
target (custom Web JavaScript runtime to run Odin executables)
New Compiler Features
- Add
ODIN_NO_CRT
global boolean constant - Add
ODIN_BUILD_MODE
global string constant - Allow compilation of assembly files on Windows through
nasm.exe
in conjunction with theforeign import
system (.asm
,.s
,.S
files) -extra-assembler-flags:<string>
-timings-export:<string>
Compiler Improvements
- Improve matrix related operations
- Correctly support
-default-to-nil-allocator
for all platforms -no-crt
improvements on Windows- General wasm32 improvements
- Internal compiler (not language) improvements to data structures
- Improve compilation passes on LLVM 12.0.1 and LLVM 13.0.0 (compiler still defaults to LLVM 11.1.0)
- Correct
x in ptr
logic - Numerous bug fixes
New Packages
vendor:raylib
version 4.0core:math/linalg/glsl
- GLSL-like mathematics types and operationscore:math/linalg/hlsl
- HLSL-like mathematics types and operations
Package Improvements
- Make
math
procedurescontextless
- Add
asinh
,acosh
,atanh
- Represent matrices in
fmt
as expected - Make runtime builtin matrix procedures
contextless
package runtime
linkage improvementslinalg.matrix4_look_at_from_fru
- Implement
math.ldexp
andmath.frexp
in native Odin - Add
log1p
,erf
,erfc
,ilogb
,logb
nextafter
,gamma
,lgamma
,signbit
tocore:math
- Add support for darwin to
core:c/libc
- Add numerous new
core:crypto
packages - Add
os.read_at_least
andos.read_full
utility procedures - Correct reading from a console on Windows
dev-2021-11
New Language Features
matrix
typematrix[Rows, Columns]Element_Type
- A
matrix
is a mathematical type built into Odin. It is a regular array of numbers, arranged in rows and columns - Multiplication between matrices and arrays
- Component-wise operations
- Submatrix casting square matrices
- Submatrix casting non-square matrices
- Column-major memory layout
- Limited to a maximum of 16 elements
- Supports integers, floats, and complex numbers (only)
- Optimized for SIMD vectorization
- Built-in procedures (Compiler Level)
transpose
outer_product
hadamard_product
matrix_flatten
conj
- Built-in procedures (Runtime Level)
determinant
adjugate
inverse
inverse_transpose
hermitian_adjoint
matrix_trace
matrix_minor
odin report
- Reporting of Platform Specific Information
wasi_wasm32
support- Improved WASM support in general
New Packages
core:crypto
vendor:ENet
Package Improvements
- Improvements to
vendor:OpenGL
- Set
VertexAttribPointer
related calls to useuintptr
instead ofrawptr
for the byte offset parameter - Convert all functions taking
GLboolean
tobool
- Set
- Updates to
core:sync/sync2
- Generic
Futex
interface for each platform Sema
implemented withFutex
- Generic
- Improvements to
core:mem/virtual
to make usage consistent - Minor improvements to the SDL vendor packages
core:encoding/json
- add alias forMJSON
asBitsquid
- Improvements to
vendor:microui
- Improvements to
vendor:raylib
- Add more OOM checks within the core library
- Unify
runtime.memory_equal
andruntime.string_eq
logic - Add
id
tothread.Thread
- Add
slice.swap_between
- Add experimental
big.Rat
Compiler Improvements
intrinsics.unaligned_store
intrinsics.unaligned_load
intrinsics.mem_zero_volatile
offset_of_by_string
- Heavily improve the LLVM struct type generation to improve ABI
- Simplify
map
logic and code generation - Disallow
or_return
withindefer
- Fix
strip-semicolon
on some machines which didn't truncate correctly - Allow parsing for
[^]T{}
to improve error messages - Support LLVM 11, LLVM 12, and LLVM 13 in the code
- Fix debug problems
- Improved
bit_set
semantics
dev-2021-10
New Language Features
- Semicolons are now fully optional (non-breaking change)
#load_or(path_string, default_byte_slice)
New Packages
vendor:raylib
- Including
vendor:raylib/easings.odin
- Including
vendor:microui
- Odin native source port
vendor:stb/image
- Includes:
stb_image.h
,stb_image_resize.odin
,stb_image_write.odin
- Includes:
vendor:stb/easy_font
vendor:stb/vorbis
vendor:stb/truetype
core:hash/xxhash
core:mem/virtual
(still experimental and work in progress)
Package Improvements
- Improvements and additions to
core:encoding/json
- Minor corrections to
vendor:sdl2
- Improvements to
vendor:vulkan
to use[^]
where appropriate - Improvements to
core:math/big
- Additions to
core:reflect
reflect.equal
,reflect.not_equal
reflect.any_base
,reflect.any_core
reflect.set_union_value
- Changes to
core:io
- Optional
n_read
/n_written
parameters (useful for building utility procedures) - Move
strings.write_quoted_*
toio.write_quoted_*
- Optional
- Numerous tests for the the png, gzip, zlib, et al packages
- Add
bits.log2
- Add
i128
andu128
parsers tocore:strconv
- Correct
append_soa
for#soa[dynamic][N]T
Compiler Improvements
- Update Windows to LLVM 12.0.1
odin strip-semicolon
utility tool to remove unnecessary semicolons-strict-style
-strict-style-init-only
intrinsics.prefetch_*
procedures- Fix slice indices endianness
- General dead code culling in the compiler
- Simplify parsing for directives
- Correct
f64
<->u128
/i128
code generation - Make
map
internals more robust when usingmem.nil_allocator()
- Fix
[^]u8
tocstring
conversion - Allow
[^]T
touintptr
conversion
dev-2021-09
New Language Features
or_return
atom 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_else
as 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
len
andcap
to returnuint
if a type isuint
to aid people wanting to use unsigned integers - Unify semantics of the built-in
swizzle
procedure with the selector expression semantics e.g..xyz
- Define where
#bounds_check
and#no_bounds_check
can 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
vendor
library collection vendor:sdl2
- Full bindings to the SDL2 library
- Ships with DLLs and Libs for Microsoft Windows
- Bundled with
gamecontrollerdb.txt
vendor:sdl2/image
vendor:sdl2/mixer
vendor:sdl2/net
vendor:sdl2/ttf
vendor:OpenGL
vendor:vulkan
vendor:glfw
vendor:portmidi
Compiler Improvements
- Unify multithreading logic through the compiler
- Remove numerous possible race conditions
- Disallow
using
on enum declarations in favour of implicit selector expressions:.A
- Simplify data structures within the compiler for better memory reuse
- Correct
DllMain
behaviour - 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_int
directive to replaceauto_cast
uses on parameters - Add
map_insert
which returns the pointer to the inserted value (assuming no resizes happen in the mean time)
dev-2021-08
New Language Features
or_else
built-in procedure for values which have an optional-ok value- Allow
x in ptr_to_map_or_bit_set
- Ability to add custom warnings to procedures with the attribute
@(warning=<string>)
Compiler Improvements
- Multithread the entire Semantic Checker stage of the compiler
- This will decrease
odin check
times - Can be disabled with either
-no-threaded-checker
(disables parsing in only the semantic checker) or-thread-count:1
(will also disable threading in parser)
- This will decrease
- Improve error handling for parsing errors
- Replace the old big int library with libTomMath
Packages
- Add
#no_bounds_check
to linalg procedures - Add
slice.sort_by_cmp
- Add
slice.min
andslice.max
- Add
strings.cut
- Deprecate
sort.slice
andsort.reverse_slice
- Add documentation for the overview of
package fmt
Bug Fixes
- Fix numerous swizzle related bugs
- Fix parametric Polymorphic struct with default parapoly parameter bug