Releases: odin-lang/Odin
Releases Β· odin-lang/Odin
dev-2023-07
New Language Features
- Allowing for Positional and Named Arguments in Procedure Calls details
#reverse for- Allow
for &e, i in arrayandfor k, &v in mapandswitch &v in ...- Will replace the old style of passing the iterable by pointer
- The
&evalue will still be of the same type but will be addressable (a reference to the actual value)- Variable Addressing Mode (L-Value in C-speak)
Compiler Improvements
intrinsics.type_mergeODIN_COMPILE_TIMESTAMP(unix timestamp in nanoseconds)- Default to
panicallocator for wasm targets - Numerous Fixes
New Packages
- New and Improved
io.Streaminterface - details core:math/cmplx- Font texture atlas builder port of fontstash was added to
vendor:fontstash - Vectorized rendering port of nanovg was added to
vendor:nanovg
Package Improvements
- Add
math.sincos - Update to Botan 3.0
- Use C calling convention within most Objective-C related procedures in
vendor:darwinpackages - Add loads of
@(require_results)to many procedures withincore - Make the vast majority of
mathprocedures"contextless" - Add
Mutextomem.Tracking_Allocator bindFramebufferwas added toWebGLpackage- Added
self_cleanupflag to properly auto-clean threads - Correct printing in
core:fmtforODIN_ERROR_POS_STYLE - General Fixes
dev-2023-05
New Language Features
Compiler Improvements
-max-error-count:<integer>- Minor fix to
intrinsics.alloca struct #no_copyto prevent trivial copying in certain cases- Experimental:
@(deferred_*_by_ptr=<proc>)attributes - Fix a race condition in
-use-separate-modulesdue to type determination in the backend - Make
!xbe an untyped boolean - When using
-debug, the compiler now defaults to-o:noneunless explicitly specified
New Packages
vendor:luavendor:lua/5.1vendor:lua/5.2vendor:lua/5.3vendor:lua/5.4
Package Improvements
- Numerous bug fixes
- Numerous improvements to documentation
- Improve JSON tokenizer
- Fix
appendwith zero sized types - Partially buffer all
fmt.fprint*related calls using abufio.Writer - Add
bit_array.unsafe_get/bit_array.unsafe_set - Minor fix to
core:text/edit
dev-2023-04
New Language Features
- Allow
case nilwithin a type switch statement
Compiler Improvements
- Add
-o:noneoptimization mode (useful for-debugbuilds) - General improvements to
-debugbuilds - Add
-no-thread-localflag - Fix minor memory leak in the compiler
- Improve SysV ABI for multiple return values and structs
- Add
@(extra_linker_flags=<string>)attribute forforeign import - Improvements to the documentation generation for handling comments
New Packages
vendor:raylibversion 4.5core:text/table- Table generation utility which can output to plaintext, markdown, and HTML
Package Improvements
- General improvements to
core:net - Improvements to
strconv.parse_f64_prefix - Simplification and improvement of
strings.split_multi_iterator - Make
core:imagepackages work onjsplatform by not requiringcore:os - Numerous package documentation
dev-2023-03
New Language Features
- BREAKING CHANGE: Brand New Default
context.temp_allocatorImplementation- New version is a growing arena based approach
- Old version used an unsafe ring buffer
- IMPORTANT
free_all(context.temp_allocator)must be called to clear the contents of the internal arena (unlike the previous ring buffer)- It is recommended that this is done per frame/cycle/etc
- New version is a growing arena based approach
expand_values()- Built-in procedure which expands a
structor fixed-length array into multiple values
- Built-in procedure which expands a
Foo :: struct {x: f32, y: i32}
f := Foo{1, 2}
a, b := expand_values(f)
assert(a == 1 && b == 2)- Allow comparisons between empty
struct{}andunion{} - Allow for assigning to fields through
usingin a compound literal
Foo :: struct {
using x: struct { // named `using` fields
y: int,
},
z: f32
using _: struct { // anonymous `using` fields
w: bool,
},
}
f := Foo{
y = 123, // equivalent to `x = {y = 123},`
z = 456,
w = true,
}- Verbose error messages by default with optional ANSI colouring too:
Compiler Improvements
@(fini)to complement its opposite@(init)- Fix to
byvalparameters on Darwin SysV ABI which in turn fixes#by_ptr - Rename to
runtime.Type_Info_Parametersfor procedures inputs and outputs - Fix issue that conflicts with constant parapoly procedure literals and
@(deferred_*) - Numerous improvements to error messages
New Packages
Package Improvements
- Introduction of
time.tsc_frequency() - Improvements to
core:mem/virtual'sArena- On
free_allfree all memory blocks except for the first one virtual.arena_destroywill free all memory blocks including the first one (assuming Growing or Static)
- On
- Add
#optional_allocator_errortomake_map - Numerous improvements to the
vendor:directxpackages
dev-2023-02
New Language Features
Compiler Improvements
Compile Time Speed Optimizations
- Multithreaded frontend by default
- Using the new and improved work stealing thread pool system
- Fix numerous race conditions
- Replace many instances of MPMC queues with MPSC queues
- Replace many instances of
BlockingMutexwithRwMutex - Replace many instances of
RecursiveMutexwithBlockingMutex
- Multithread backend when the experimental
-use-separate-modulesis used-use-separate-modulesturns each package into a separate translation unit (object file) and then links them all together. This allows LLVM be multithreaded at the translation unit stage (LLVM Module).-use-separate-moduleswill not produce as good code compared to without it because of the multiple translation units.
- Improvements to the hash table related structures (
StringMap,StringSet,PtrMap,PtrSet) - Big improvement to compile times due to the above improvements
General fixes
- Improved type inference for ternary if expressions
- Remove
auto_castfrom procedure parameters - Fix bug with built-in matrix transpose caused by misalignment of the value
- Fix valgrind assembly generation
- Allow
whenstatements withinforeignblocks at the file scope
New Packages
Package Improvements
core:mem/virtualArena_Tempimprovementsarena_temp_ignoreallowing for ignoring of a temporary section if necessary
- Numerous bug fixes
dev-2023-01
New Language Features
Compiler Improvements
- Improvements to multiple return values ABI for Odin calling conventions
- Improved internal thread pool implementation (ready for next month's release)
- Futex usage too
- Numerous bug and typo fixes
New Packages
core:text/match
Package Improvements
- Make
synccallscontextlesswhere possible - Add different variants for
sync.once_do - Make
os.get_last_errorcontextless - Numerous fixes to
core:fmt
dev-2022-12
New Language Features
- New
map: High performance, cache-friendly, open-addressed Robin Hood hashing hash map data structure with various optimizations for Odin- PR #2181
- Smaller internal data structure than previously (4 pointers down from 7 pointers)
- SOA based memory layout
- Up to 4x-6x faster insertion and lookup on average
- Entries are stored in non-contiguous cell-layout which means no element straddles across a cache line
- Only one allocation per map rather than two (previously hashes and entries)
- Only requires
alloc_non_zeroedandfreeinternally
- Only requires
- Robin Hood hashing
- Smaller header information (
runtime.Map_Info) for dynamic calls. - Allows for calling
delete_keywhilst iterating across the map
Compiler Improvements
- Add debug symbols for global constants for integers, booleans, enums, runes, and pointers
- Variables are namedspaced with
pkg::name, ornameif built-in (or the initial package for convenience)
- Variables are namedspaced with
- Improvements to debug information generation
-default-to-nil-allocatoralso enabled-no-dynamic-literals- Improvements to
intrinsics.ptr_subcode generation - Numerous bug fixes
New Packages
vendor:cgltf
Package Improvements
- Add
Allocator_Mode.Alloc_Non_Zeroed - DirectX packages to use
bit_setfor flags where possible instead of just anenum - Implement numerous
core:mathprocedures in native Odin - Add
math.pow10 - Add
strings.write_(f16|f32|f64) - Add
user_data: rawptrtofilepath.Walk_Proc
dev-2022-11
New Language Features
-
Compiler Improvements
- Make
raw_dataan intrinsic rather than a@(builtin)runtime procedure - Allow
transmuteto be constant for integers of the same internal endianness - Throw type checker error when scalar cast to non-square matrix
- Fix
#defined(I) - Build script: Detect
whichand complain if not found - Add early LLVM > 14 detection, as LLVM 15 and above are not (yet) supported
- Remove previously deprecated
-optflag - Improve SysV ABI LLVM IR generation for development purposes
- Use direct parameter value in
lb_find_identwhen possible - Optimize
#caller_locationand#locationto use read only data section where possible - Ad-hoc pass source code location directly by pointer without stack copy
- Clarify
odin helpfor-define - Add
-minimum-os-versionfor Darwin targets, e.g.-minimum-os-version:12.0.0 - Add
-target-featuresflag to force extra LLVM options - Add safety check for #2161
New Packages
-
Package Improvements
- Update Darwin release map for
core:sys/info - Unify
Static_ArenaandGrowing_ArenaintoArena - Many improvements to
core:mem/virtualin general - Add and correct various Windows, Darwin, glfw, objC and other bindings
- Allow for
N = -1inwstring_to_utf8 - Add
core:math/rand.choice - Heavily improve time handling on Windows for
time.now()andos.File_Info
dev-2022-10
New Language Features
cap(Enum), equivalent tomax(Enum)-min(Enum)+1ODIN_BUILD_PROJECT_NAMEconstant//+build-project-namebuild directiveintrinsics.type_convert_variants_to_pointers- Add
helgrindandvalgrindsupport
Compiler Improvements
- Greatly improve error messages
- Preparations for Compiler Explorer support
- Use
uintinstead ofintto improve bounds checking code generation - Replace
#optional_secondwith#optional_allocator_error - Remove extra pointer indirection
- Make
intrinsics.count_{ones,zeros,trailing_zeros,leading_zeros}work at compile time - Improve
map - Improve parapoly support for ^T to [^]$V and vice versa
- Various bugfixes
- Simplify win32 resource file linking
- Add Windows 32-bit build system error
- Add
helpcommand, so you can now useodin help buildin addition toodin build -help - Improve macOS version detection for
odin report
New Packages
- Add
vendor:zlib - Begin work on
core:debug/peto parse PE files - Add
core:sys/infoto query CPU, GPU, RAM, etc.
Package Improvements
- Add system:legacy_stdio_definitions.lib to
core:c - Allow reading/writing files larger than
max(i32)on Darwin - Allow skipping unused fields in
core:encoding/json - Add parsing of +/-Inf and NaN to
core:strconv - Add additional win32 imports and constants
- Fix typo in
map_insert - Fix
libc.aligned_alloc - Add
slice.enumerated_array - Add serial comms support to
core:sys/windows - Add complex support to
core:libc - Correct json unmarshal of
maps - Fix Darwin libs for
vendor:stb/image - Added support for ID3D11InfoQueue to
vendor:directx - Improve
core:mem/virtualhandling of out of memory on Windows - Simplify
core:ioby removing different unnecessary types and calls - Add the builtin procedures
abs,clamp,min,maxtocore:mathas aliases
dev-2022-09
New Language Features
#soapointer type to ad with refactory to#soadata types- e.g.
#soa ^#soa[]T
- e.g.
New Compiler Features
- Make
unreachable()a built-in compiler-level procedure - Allow for
foo() or_else unreachable()or other diverging procedures
Compiler Improvements
#loadcan now optionally import the loaded file data as a different type than[]u8#load(path)#load(path, []T)(whereTis a type that can be trivially loaded from memory (i.e. no pointers))#load(path, string)(shorthand forstring(#load(path)))
- Deprecate
#load_or(path, default)in favour of#load(path) or_else default - Allow chaining of
#load(path1) or_else #load(path2) - Pass size information to allocator to
delete, when possible, to improve tracking information - Improved detection of rc.exe
- Improvements to debug symbols for range intervals
- Fix Objective-C related
x->y()calls in Odin - Prepare for future LLVM versions
- Various bugfixes
New Packages
vendor:commonmark- Markdown Variant: https://commonmark.org/
Package Improvements
core:image/tgacan now load as well- Add
math.divmodandmath.floor_divmod - Pretty marshal output for
core:encoding/json - Add ID3D11Debug to
vendor:directx/d3d11package - Add wgl, raw input, and additional Windows imports
- Add more
core:container/queuehelpers andpeek_frontandpeek_back - Add
reflect.get_union_variant - Add
slice.sort_with_indicesfamily of procedures - Improvements to
sync.Futexsupport on windows - Add
core:sys/valgrindpackage for valgrind, memcheck, and callgrind - Various bugfixes
