Releases: odin-lang/Odin
Releases · odin-lang/Odin
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_fontvendor:stb/vorbisvendor:stb/truetypecore:hash/xxhashcore: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:vulkanto use[^]where appropriate - Improvements to
core:math/big - Additions to
core:reflectreflect.equal,reflect.not_equalreflect.any_base,reflect.any_corereflect.set_union_value
- Changes to
core:io- Optional
n_read/n_writtenparameters (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
i128andu128parsers tocore:strconv - Correct
append_soafor#soa[dynamic][N]T
Compiler Improvements
- Update Windows to LLVM 12.0.1
odin strip-semicolonutility tool to remove unnecessary semicolons-strict-style-strict-style-init-onlyintrinsics.prefetch_*procedures- Fix slice indices endianness
- General dead code culling in the compiler
- Simplify parsing for directives
- Correct
f64<->u128/i128code generation - Make
mapinternals more robust when usingmem.nil_allocator() - Fix
[^]u8tocstringconversion - Allow
[^]Ttouintptrconversion
dev-2021-09
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)
dev-2021-08
New Language Features
or_elsebuilt-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 checktimes - 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_checkto linalg procedures - Add
slice.sort_by_cmp - Add
slice.minandslice.max - Add
strings.cut - Deprecate
sort.sliceandsort.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
dev-2021-07
New Language Features
- Swizzling syntax for arrays len <= 4 (GLSL-like behaviour)
- e.g.
v.xyz,v.zyx,v.xxx - e.g.
v.rgb,v.bgr,v.rrr
- e.g.
- Optional Ok Pointer addressing mode:
ptr, ok := &m[v];ptr, ok := &v.(T);
- Disallow
defers in a scope which terminates with a diverging procedure-> ! - Compound literals for
struct #raw_uniontypes - Allow alternative syntax for
offset_of:offset_of(Struct_Type, field)(current syntax)offset_of(value.field)(new alternative syntax)
Compiler Improvements
- Performance optimizations for
switchstatements (normal and type) - Performance optimizations for array programming
Packages
- Remove
context.thread_id - Improve documentation for the Odin binary doc-format spec
- Improvements to
reflect - Add
intrinsics.type_is_endian_platform - Add
bufio.Scanner - Add
bufio.Lookahead_Reader - Many improvements to
png - Many improvements to
gzip - Many improvements to
zlib - Huge performance improvements to hashing procedures:
hash.crc32hash.adler32
Bug Fixes
- Fix
filepathbug leak - Improve linalg.transpose return type behaviour
- Fix 128-bit integer to float cast by explicitly calling the procedure (was an LLVM bug)
- Fix
-lldon Windows - FIx double evaluation buf with selector call expressions
x->y(z)->w(a) - Fix semicolon insertion rule for
---
dev-2021-06
New Language Features
- Allow unions to be comparable if all the variants are comparable
- Comparable unions allowed as map keys
- Improve implicit selector expression inference rules with unions
- Unified
cond ? x : yandx if cond else ylogic - Improve type inference system to allow
&{}alongside&T{}in some cases - Change
for in x..ybehaviour to prevent the possibility of overflowing on maximum integer size and causing an infinite loop - Allow
..=alongside..as a "full range" operator (..=will probably replace..for ranges) - Remove
@(static)for global variables - Add
@(link_section=<string>)for global variables - Add intrinsics:
mem_zero,mem_copy,mem_copy_non_overlapping,sqrt,ptr_offset,ptr_sub
Compiler Improvements
- Tokenize
++and--as tokens but disallow them in the parser, and give better error messages for they are used as operators/statements - Add
-verbose-errors - Improved parsing error messages
- EXPERIMENTAL
-use-separate-modulessupport (useful for speeding up code generation in development builds) - Correct SysV ABI edge cases
- Array arithmetic code generation improvements for small arrays
Packages
- package core:odin/printer
- package core:odin/format
- package core:odin/doc-format
- package core:math improvements for
f16 - package core:image/png fixes
- Added
test.fail_now - Add
soa_zipandsoa_unzipto demo
Fixes
- Numerous bug fixes
dev-2021-05 New Backend Release
Compiler Changes
- Removal of the old backend which manually produced
.llfiles and passed them to the LLVM binaries directly- Removes need for
llcandoptbinaries
- Removes need for
- LLVM C API based backed as the main backend for all platforms and targets
- Removes need for
-llvm-api
- Removes need for
- Full debug symbols support for Windows (*nix is still experimental)
- M1 ARM64/AARCH64 Support
-target:darwin_arm64 -strict-stylestyle as default- New Versioning System
dev-yyyy-mm:sha - New flags
-build-modemodes:llvm-irassembly
-o:<string>flag as an alternative to-opt:<integer>- Accepted values:
mininal,size,speed
- Accepted values:
-vet-extrafor extra vet checks (many usually false positives)-microarch:<string>-disallow-do-default-to-nil-allocator
ODIN_ROOTenvironment variable to be able to change the root directory for the Odin root pathodin test- build ands runs procedures with the attribute
@(test)in the initial package
- build ands runs procedures with the attribute
odin doc- generate documentation from a .odin file, or directory of .odin files
-doc-formatGenerates documentation as the .odin-doc format (useful for external tooling)
- Improvements to
-vet - Many bug fixes
Language Changes
- Ability to iterate on
#soatypes with afor-inloop soa_zip(generate #soa type from slices)soa_unzip(generate slices from #soa type)make_soaanddelete_soa- Allocator procedure signature change to support return a
[]byteandAllocator_Errorcode - Removal of
intrinsics.x86_mmx - Remove
#opaquetypes - Remove
bit_fieldtypes- Prefer
bits.bitfield_extractandbits.bitfield_insertprocedures located incore:math/bits
- Prefer
- Replace
inlineandno_inlinewith#force_inlineand#force_no_inline, respectively - Improved
#optional_oklogic - New procedure attributes:
@(disabled=<boolean>)@(cold)@(optimization_mode=<string>)
f16,f16le,f16betypes- Removal of "pure" calling convention
- Addition of "naked" calling convention (removes prologue and epilogue)
min(T)/max(T)support whereTis a float- Make any
structcomparable as long as all of its fields are comparable - Make any comparable type a valid
mapkey type //+build ignoretag- Useful for examples within a
package
- Useful for examples within a
Core Library Changes
New Packages
core:bufiocore:bytescore:c/frontend/tokenizercore:c/frontend/preprocessorcore:compresscore:compress/gzipcore:compress/zlibcore:imagecore:image/pngcore:iocore:math/fixedcore:path(URI-like paths)core:path/filepath(OS paths)core:slicecore:sortcore:text/scanner
Experimental Packages
core:sync/sync2(will replacecore:syncwhen finished)
New Additions to package intrinsics
volatile_loadvolatile_storedebug_traptrapallocacpu_relaxread_cycle_countercount_onescount_zeroscount_trailing_zeroscount_leading_zerosreverse_bitsbyte_swapoverflow_addoverflow_suboverflow_mulexpecttype_has_fieldtype_proc_parameter_counttype_proc_return_counttype_proc_parameter_typetype_proc_return_typetype_polymorphic_record_parameter_counttype_polymorphic_record_parameter_valuetype_field_index_oftype_equal_proctype_hasher_proc
pre-dev-2021-04 Pre Old Backend Removal Release
Transitionary release for two things:
- Replacing the Old Backend with the New Backend Transition Period #891
- New Odin Versioning System for Pre Version 1.0 #887
Notes
Please use this release if you are still relying on the old backend for your projects.
Release notes will be published in the release in which the old backend is removed.
v0.13.0
New Features
- LLVM C API integration for Windows through
-llvm-api - Experimental Support for
-llvm-apifor Linux and MacOS union #maybedirective- Built-in
Maybetype, e.g.Maybe(int)orMaybe(^T) - Selector Call Expressions
x->y(123) == x.y(x, 123)(useful for COM APIs) - Allow
.?to unwrap any union depending on the inferred context - Remove
using import not_inreplacednotin- Relative pointers
#relative(i16) ^Foo - Relative slices
#relative (i16) []Foo - Add
"pure"procedure types - Add new ternary expressions:
x if cond else yand `x when cond else y - Support by-reference semantics for
for value_ref, i in &some_arrayandfor key, value_ref in &some_map - Allow map indices to be references
&m[key]and return a valid pointer if exists otherwisenil - Allow referencing a compound literal
&Foo{} - Slice literals will use stack memory within a procedure and global memory in a global scope
- Add
-subsystemflag for Windows - Allow shadowing for
-vetwith immutable parameters @(force)/@(require)attributes forforeign import(they are equivalent)- Endian specific floats, i.e.
f32lef64be #optional_okfor procedures- Improved
odin <command> help -ignore-vs-search- Support
--flagas redundancy for-flag - Add
-extra-linker-flags:<string> - Add
#configto replace#defined - Restrict
#definedwithin procedure bodies to remove possible race conditions - Remove the need for
type_of,size_of,align_of, andoffset_ofto be keywords (now regular identifiers) - Strip
\rfrom raw string literals - Experimental Support for WASM
- Add
-target:<string>with fuzzy checking
Library Improvements
- Improve package os
- Add
package unicodewith basic letter querying - Add
utf8.string_to_runesandutf8.runes_to_string - Add more intrinsics (
cpu_relax,alloca,type_*, etc) - Add
#constto enforce constant procedure parameters to variable parameters - Add
package sys/windowswhich will replacepackage sys/win32in the future - Add more helpers to
package reflect - Remove
context.stdout/stderr - Add
package container - Add more hashes
- More
package syncfeatures - More
package threadfeatures - New
mem.Allocator_ModesQuery_FeaturesandQuery_Info
Bug Fixes
- Numerous core library bug fixes
- Fix
deferrelated bugs - Fix
__dynamic_array_reserveedge cases with zero sized types - Improve System V ABI
- Fix name mangling for
@(private)entities - Fix
time.now()being one day out on leap years after the leap month
v0.12.0
New Features
- Indexed and ranged fields for array compound literals:
[?]int {0 = 123, 5..9 = 54, 10..<16 = 72}
- Constant compound literals declarations
FOO :: [5]int{1, 2, 3, 4, 5};
#partial switch- Implement the previous
#complete switchas the default behaviour
- Implement the previous
- Enumerated Arrays:
[Enum_Type]Value#partial [Enum_Type]Value
- SOA Arrays, Slices, and Dynamic Arrays
#soa[N]T#soa[]T#soa[dynamic]T
- New
#simdtype syntax#simd[N]T
- Add
@(private="file")and@(private="package") - Make
stringtype elements immutable, akin tochar const *in C - Allow
#no_bounds_checkon an expression - Deprecate
using import - Full System V ABI support
- Remove requirement for vcvarsall.bat for Windows. Windows SDK and Binaries are found automatically
- Add
-helpwhich prints information about the compiler flags - Add
x y z wfields to quaternion types - Add
r g b afields to array typeslen(array) <= 4alongsidex y z wfields
Library Improvements
- Improve
package math - Add
package math/linalg - Improve runtime/default_allocators.odin
- Make default
context.temp_allocatorthread safe - Add
strings.unsafe_string_to_cstring - Add
strings.ptr_from_string - Support
package threadon unix
Bug Fixes
- Fix string reversal
- Fix linux build
- Fix System V bitcast/transmute bug
- Fix os.write on darwin
- Fix transmute of
uintptrto/fromproc - Fix
fmt.string_to_enum_value - Fix mem.Arena
- Fix using on array in struct
- Fix -no-crt on Windows
- Fix loadsatypos
v0.11.1
New Features
- multivalued procedure calls allows in
for into allow a pseudo-iterator @thread_localfor variables in procedure- SOA Struct support
intrinsics.soa_struct - 128-bit random procedures added to
package math/rand intrinsics.type_is_unsigned-show-more-timings(More in-depth timings)
Bug Fixes
- Fix
linalg,muland addlinalg.Matrix1xN - Fix
linalg.cross3typo - Fix typeid comparison bug
- Add extra messages for pointer address errors
- Use
runtime.mem_copyinpackage mem //+buildsystem- Fix inline
forbug for #468 - Fix "Polymorphic parameter declared in return type doesn't compile #464" by giving a conversion error (code wasn't handling polymorphic result types as intended)
- Fix Slice passed incorrectly in LLVM IR to procedure called via procedure pointer #465
- Fix
big_int_orandbig_int_xor