Releases: odin-lang/Odin
Releases · odin-lang/Odin
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
notin
binary operator formap
andbit_set
types:x notin y
(equivalent to!(x in y)
)
- Endian specific integers
- e.g.
i32
,i32le
,i32be
- e.g.
- Reintroduction of
i128
andu128
- Labels for blocks and if statements (
break
only) - 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
#defined
built-in procedurewhen #defined(FOO) { ... }
- Improved
-vet
- Replace
foreign export
with@export
@private
@static
Experimental Features
odin query
-go-to-definitions
(OGTD file format)-global-definitions
(JSON file format)-compact
(compactify the JSON file)
intrinsics.vector
type
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 switch
for 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
package
system- Improved PDB support with code inspection
typeid
type (also a keyword)type
is not a keyword any moreopaque
type- Parameteric polymorphic union type:
union(T: typeid, N: int) {int, T, [N]T}
bit_set
type:bit_set[Some_Enum];
bit_set['A' .. 'Z'];
bit_set[0..8; u16];
cstring
type (useful for interfacing with C libraries)in
binary operator formap
andbit_set
types: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_cast
unary operator- Explicit
inline
andno_inline
on procedure calls deprecated
attributes- Built-in procedures:
#defined
#assert
compile time assertexpand_to_tuple
for (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
context
features:temp_allocator
logger
(Still in development)- Assigning directly to context parameters creates a new
context
- (
context
is 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
package
system)
LLVM Binaries for Windows
llvm-windows Allow enums for array lengths
Odin v0.8.1
Fixes
- Fix initialization value for variables
Odin v0.8.0
New Features
- Basic Debug Information Support
- PDB generation with
-debug
- PDB generation with
distinct
typesMy_Int :: distinct int;
My_Int != int
Foo_Bar :: int;
Foo_Bar == int
struct
,enum
,union
,proc
, andbit_field
types will always be distinct if named
- Sized booleans
b8
b16
b32
b64
- Removal of 128 bit integers
using in
using println in import "core:fmt.odin"
using a, b, c in foo;
enum #export
Foo :: enum #export {A, B, C}; a := A;
- Explicit procedure overloading
foo :: proc[bar, baz, asd, goop];
- Remove of implicit procedure overloading
- New build flags:
-no-bounds-check
-debug
- Improved minimal dependency build
Odin v0.7.1
Patch Changes
- Update version string
- Update command line usage text
New Features
- New importation system
import
using import
export
- Import collections
- `import "core:fmt.odin"
import "shared:glfw.odin"
-collection=foo=path/to/foo
- Improved
foreign
systemforeign import
foreign
blocksforeign export
blocksforeign import "system:kernel32.lib"
- Global variable dependency initialization ordering
- Attribute system
@(link_name="gb_foo") foo :: proc() {};
@(link_prefix="gb_") foo :: proc() {};
- Please see wiki for more
- Array Programming - arithmetic on fixed length arrays
a, b: [4]f32;
c := 2*(-a + b) / 3;
d := swizzle(c, 1, 0, 3, 2);
uintptr
- Type aliases
My_Int :: #alias int;
inline
andno_inline
prefix keywords for procedure literalsfoo :: inline proc() {}
- Procedure calling convention syntax
proc "c" ()
proc "std" ()
proc "contextless" ()
- Default arguments allowed after a variadic parameter
print :: proc(args: ...any, loc := #caller_location) {}
- Polymorphic array lengths
proc(a: [$N]$T)
Syntax Changes
switch
replacesmatch
context <- expr {}
replacespush_context expr {}
push_allocator
has been removed in favour of general procedures to generate contexts-build-mode=dll
replacesbuild-dll
Core library additions
mem.ptr_to_bytes
assert
andpanic
useprintf
style parameters
Odin v0.7.0
New Features
- New importation system
import
using import
export
- Import collections
- `import "core:fmt.odin"
import "shared:glfw.odin"
-collection=foo=path/to/foo
- Improved
foreign
systemforeign import
foreign
blocksforeign export
blocksforeign import "system:kernel32.lib"
- Global variable dependency initialization ordering
- Attribute system
@(link_name="gb_foo") foo :: proc() {};
@(link_prefix="gb_") foo :: proc() {};
- Please see wiki for more
- Array Programming - arithmetic on fixed length arrays
a, b: [4]f32;
c := 2*(-a + b) / 3;
d := swizzle(c, 1, 0, 3, 2);
uintptr
- Type aliases
My_Int :: #alias int;
inline
andno_inline
prefix keywords for procedure literalsfoo :: inline proc() {}
- Procedure calling convention syntax
proc "c" ()
proc "std" ()
proc "contextless" ()
- Default arguments allowed after a variadic parameter
print :: proc(args: ...any, loc := #caller_location) {}
- Polymorphic array lengths
proc(a: [$N]$T)
Syntax Changes
switch
replacesmatch
context <- expr {}
replacespush_context expr {}
push_allocator
has been removed in favour of general procedures to generate contexts-build-mode=dll
replacesbuild-dll
Core library additions
mem.ptr_to_bytes
assert
andpanic
useprintf
style parameters
Odin v0.6.2
Changes
Slightly modify the naming convention.
In general, Ada_Case for types and snake_case for values
Import Name: snake_case (but prefer single word)
Types: Ada_Case
Union Variants: Ada_Case
Enum Values: Ada_Case
Procedures: snake_case
Local Variables: snake_case
Constant Variables: SCREAMING_SNAKE_CASE
Odin v0.6.1a
Changes
- Minor fixes for *nix systems