Releases: odin-lang/Odin
Releases · odin-lang/Odin
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
v0.11.0
New Features:
- Ranged fields for array compounds literals
foo := [?]int {
0 = 123,
5..9 = 54,
10..<16 = i*3 + (i-1)*2,
};inline forloops (only forinbased for loops)
inline for x, i in 1..<4 {
fmt.println(x, i);
}whereclauses for procedures, structs, and unions
foo :: proc(x: [$N]int) -> bool
where N > 2 {
fmt.println(#procedure, "was called with the parameter", x);
return true;
}- Proper System V AMD64 Support on Darwin and Linux
- Built-in Quaternions (Not just an April Fool's Joke any more)
quaternion128andquaternion256
- Struct field tags
Foo :: struct {
x: int `tag1`,
y: string `json:"y_field"`,
z: bool, // no tag
};- New and improved
package math - New
package math/linalg intrinsics.type_*package reflect(replacespackage types)union #no_nilmem.slice_data_cast#panic- Add
@forceforforeign import - Add minor suggestions to errors on casts and assignments
- Change
ODIN_OSstring for macos/osx "osx" to "darwin" to allow for other platforms - Add dummy packages purely for documentation of
builtinandintrinsics
Updates:
- Type inference improvements for call expressions and procedure group parameters
- Update
package odin_parseret al. require_resultsis now an attribute rather than a suffix tag for procedures- Improved multi-threaded parser
- Change the behaviour of
foreign importon darwin to be more consistent with other platforms fmt.print*_errhas been replaced withfmt.eprint*- Consistent
typeidsemantics across all assignments - Improvements to
package unicode/utf8
Bug fixes:
- Fix ranges in switch statements for strings
- Fix comparison for bit field values
- Fix double-pointer indexing bug
- Fix procedure group compiler assert with no matching arguments
- Fix procedure constant declarations value type assignment checking
- Fix disallow blank identifier polymorphic types
$_ - Fix unions with zero variants
- Fix bounds checking on slices for constant parameters
- Fix array comparisons
- Fix
~(1 << x)inference bug - Fix Using any in if statement
- Fix
#completeswitch with pointer case - Fix procedure group "best fit" algorithm for polymorphic procedures
- Fix double calling of LHS of logical binary expressions
- Fix stack overflow bug caused by polymorphic record with polymorphic parameters
- Fix polymorphic record parameter determination bug caused by polymorphic constants not be handled correctly
v0.10.0
- Implicit Selector Expressions
- Half-closed range
a..<b([a, b))- This is alongside the closed range
a..b([a, b])
- This is alongside the closed range
notinbinary operator formapandbit_settypes:x notin y(equivalent to!(x in y))
- Endian specific integers
- e.g.
i32,i32le,i32be
- e.g.
- Reintroduction of
i128andu128 - Labels for blocks and if statements (
breakonly) - Improved common parsing errors (e.g. C-style
->for selectors rather than Odin-style.) - Import name rules
- The import name for the package will try to be determined from the import path
- Context-based Logging system
#load- Load a file at compile time as a byte slice
- Procedure group syntax change to
proc{} - General core library improvements
- Odin Parser as part of the core library
import "core:odin/parser"et al.
- New build flag:
-define:foo=123 #definedbuilt-in procedurewhen #defined(FOO) { ... }
- Improved
-vet - Replace
foreign exportwith@export @private@static
Experimental Features
odin query-go-to-definitions(OGTD file format)-global-definitions(JSON file format)-compact(compactify the JSON file)
intrinsics.vectortype
Related Topics
- New Odin website: https://odin-lang.org
- New Odin documentation: https://odin-lang.org/docs/
Odin v0.9.1
Bug Fixes
- Debug fix
- Recursive loop bug for polymorphic types
#complete switchfor pointers to unions- Allow for single fields
struct #raw_union - Redefine how union tag size is calculated to match alignment of the union data
Odin v0.9.0
New Features
packagesystem- Improved PDB support with code inspection
typeidtype (also a keyword)typeis not a keyword any moreopaquetype- Parameteric polymorphic union type:
union(T: typeid, N: int) {int, T, [N]T}
bit_settype:bit_set[Some_Enum];bit_set['A' .. 'Z'];bit_set[0..8; u16];
cstringtype (useful for interfacing with C libraries)inbinary operator formapandbit_settypes:x in y
- Parametric polymorphic signature changes with polymorphic names:
new :: proc($T: typeid) -> ^T {}make_int_array :: proc($N: int) -> [N]int {}foo :: proc($N: $I, $T: typeid) {}
auto_castunary operator- Explicit
inlineandno_inlineon procedure calls deprecatedattributes- Built-in procedures:
#defined#assertcompile time assertexpand_to_tuplefor (fixed length) arraystypeid_of
"intrinsics"package:- Atomics
- Diverging procedures
proc() -> !(no return) using Foo :: enum {A, B, C}; f := A;Foo :: enum {A, B, C}; len(Foo)- New
contextfeatures:temp_allocatorlogger(Still in development)- Assigning directly to context parameters creates a new
context - (
contextis scope based)
- New compiler flags:
-lld(use LLD as the linker on Windows)
- Improved minimum dependency building
foreign import x {"foo.lib", "bar.lib"}
Removed Features
using in- Old import system (replaced with the
packagesystem)
LLVM Binaries for Windows
llvm-windows Allow enums for array lengths