Odin Versions Save

Odin Programming Language

dev-2023-07

10 months ago

New Language Features

  • Allowing for Positional and Named Arguments in Procedure Calls details
  • #reverse for
  • Allow for &e, i in array and for k, &v in map and switch &v in ...
    • Will replace the old style of passing the iterable by pointer
    • The &e value 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_merge
  • ODIN_COMPILE_TIMESTAMP (unix timestamp in nanoseconds)
  • Default to panic allocator for wasm targets
  • Numerous Fixes

New Packages

  • New and Improved io.Stream interface - 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:darwin packages
  • Add loads of @(require_results) to many procedures within core
  • Make the vast majority of math procedures "contextless"
  • Add Mutex to mem.Tracking_Allocator
  • bindFramebuffer was added to WebGL package
  • Added self_cleanup flag to properly auto-clean threads
  • Correct printing in core:fmt for ODIN_ERROR_POS_STYLE
  • General Fixes

dev-2023-05

1 year ago

New Language Features

Compiler Improvements

  • -max-error-count:<integer>
  • Minor fix to intrinsics.alloca
  • struct #no_copy to prevent trivial copying in certain cases
  • Experimental: @(deferred_*_by_ptr=<proc>) attributes
  • Fix a race condition in -use-separate-modules due to type determination in the backend
  • Make !x be an untyped boolean
  • When using -debug, the compiler now defaults to -o:none unless explicitly specified

New Packages

  • vendor:lua
    • vendor:lua/5.1
    • vendor:lua/5.2
    • vendor:lua/5.3
    • vendor:lua/5.4

Package Improvements

  • Numerous bug fixes
  • Numerous improvements to documentation
  • Improve JSON tokenizer
  • Fix append with zero sized types
  • Partially buffer all fmt.fprint* related calls using a bufio.Writer
  • Add bit_array.unsafe_get/bit_array.unsafe_set
  • Minor fix to core:text/edit

dev-2023-04

1 year ago

New Language Features

  • Allow case nil within a type switch statement

Compiler Improvements

  • Add -o:none optimization mode (useful for -debug builds)
  • General improvements to -debug builds
  • Add -no-thread-local flag
  • Fix minor memory leak in the compiler
  • Improve SysV ABI for multiple return values and structs
  • Add @(extra_linker_flags=<string>) attribute for foreign import
  • Improvements to the documentation generation for handling comments

New Packages

  • vendor:raylib version 4.5
  • core: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:image packages work on js platform by not requiring core:os
  • Numerous package documentation

dev-2023-03

1 year ago

New Language Features

  • BREAKING CHANGE: Brand New Default context.temp_allocator Implementation
    • 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
  • expand_values()
    • Built-in procedure which expands a struct or fixed-length array into multiple values
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{} and union{}
  • Allow for assigning to fields through using in 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:
    • Previous behaviour is available with -terse-errors
    • Automatic detection of ANSI colours is currently only supported for Windows
    • set ODIN_TERMINAL=ansi to force ANSI colouring
    • Line printing with indication of the error location below image

Compiler Improvements

  • @(fini) to complement its opposite @(init)
  • Fix to byval parameters on Darwin SysV ABI which in turn fixes #by_ptr
  • Rename to runtime.Type_Info_Parameters for 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's Arena
    • On free_all free all memory blocks except for the first one
    • virtual.arena_destroy will free all memory blocks including the first one (assuming Growing or Static)
  • Add #optional_allocator_error to make_map
  • Numerous improvements to the vendor:directx packages

dev-2023-02

1 year ago

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 BlockingMutex with RwMutex
    • Replace many instances of RecursiveMutex with BlockingMutex
  • Multithread backend when the experimental -use-separate-modules is used
    • -use-separate-modules turns 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-modules will 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_cast from procedure parameters
  • Fix bug with built-in matrix transpose caused by misalignment of the value
  • Fix valgrind assembly generation
  • Allow when statements within foreign blocks at the file scope

New Packages

Package Improvements

  • core:mem/virtual Arena_Temp improvements
    • arena_temp_ignore allowing for ignoring of a temporary section if necessary
  • Numerous bug fixes

dev-2023-01

1 year ago

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 sync calls contextless where possible
  • Add different variants for sync.once_do
  • Make os.get_last_error contextless
  • Numerous fixes to core:fmt

dev-2022-12

1 year ago

New Language Features

  • New map: High performance, cache-friendly, open-addressed Robin Hood hashing hash map data structure with various optimizations for Odin
    • PR https://github.com/odin-lang/Odin/pull/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_zeroed and free internally
    • Robin Hood hashing
    • Smaller header information (runtime.Map_Info) for dynamic calls.
    • Allows for calling delete_key whilst 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, or name if built-in (or the initial package for convenience)
  • Improvements to debug information generation
  • -default-to-nil-allocator also enabled -no-dynamic-literals
  • Improvements to intrinsics.ptr_sub code generation
  • Numerous bug fixes

New Packages

  • vendor:cgltf

Package Improvements

  • Add Allocator_Mode.Alloc_Non_Zeroed
  • DirectX packages to use bit_set for flags where possible instead of just an enum
  • Implement numerous core:math procedures in native Odin
  • Add math.pow10
  • Add strings.write_(f16|f32|f64)
  • Add user_data: rawptr to filepath.Walk_Proc

dev-2022-11

1 year ago

New Language Features

-

Compiler Improvements

  • Make raw_data an intrinsic rather than a @(builtin) runtime procedure
  • Allow transmute to 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 which and complain if not found
  • Add early LLVM > 14 detection, as LLVM 15 and above are not (yet) supported
  • Remove previously deprecated -opt flag
  • Improve SysV ABI LLVM IR generation for development purposes
  • Use direct parameter value in lb_find_ident when possible
  • Optimize #caller_location and #location to use read only data section where possible
  • Ad-hoc pass source code location directly by pointer without stack copy
  • Clarify odin help for -define
  • Add -minimum-os-version for Darwin targets, e.g. -minimum-os-version:12.0.0
  • Add -target-features flag to force extra LLVM options
  • Add safety check for #2161

New Packages

-

Package Improvements

  • Update Darwin release map for core:sys/info
  • Unify Static_Arena and Growing_Arena into Arena
  • Many improvements to core:mem/virtual in general
  • Add and correct various Windows, Darwin, glfw, objC and other bindings
  • Allow for N = -1 in wstring_to_utf8
  • Add core:math/rand.choice
  • Heavily improve time handling on Windows for time.now() and os.File_Info

dev-2022-10

1 year ago

New Language Features

  • cap(Enum), equivalent to max(Enum)-min(Enum)+1
  • ODIN_BUILD_PROJECT_NAME constant
  • //+build-project-name build directive
  • intrinsics.type_convert_variants_to_pointers
  • Add helgrind and valgrind support

Compiler Improvements

  • Greatly improve error messages
  • Preparations for Compiler Explorer support
  • Use uint instead of int to improve bounds checking code generation
  • Replace #optional_second with #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 help command, so you can now use odin help build in addition to odin build -help
  • Improve macOS version detection for odin report

New Packages

  • Add vendor:zlib
  • Begin work on core:debug/pe to parse PE files
  • Add core:sys/info to 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/virtual handling of out of memory on Windows
  • Simplify core:io by removing different unnecessary types and calls
  • Add the builtin procedures abs, clamp, min, max to core:math as aliases

dev-2022-09

1 year ago

New Language Features

  • #soa pointer type to ad with refactory to #soa data types
    • e.g. #soa ^#soa[]T

New Compiler Features

  • Make unreachable() a built-in compiler-level procedure
  • Allow for foo() or_else unreachable() or other diverging procedures

Compiler Improvements

  • #load can now optionally import the loaded file data as a different type than []u8
    • #load(path)
    • #load(path, []T) (where T is a type that can be trivially loaded from memory (i.e. no pointers))
    • #load(path, string) (shorthand for string(#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

Package Improvements

  • core:image/tga can now load as well
  • Add math.divmod and math.floor_divmod
  • Pretty marshal output for core:encoding/json
  • Add ID3D11Debug to vendor:directx/d3d11 package
  • Add wgl, raw input, and additional Windows imports
  • Add more core:container/queue helpers and peek_front and peek_back
  • Add reflect.get_union_variant
  • Add slice.sort_with_indices family of procedures
  • Improvements to sync.Futex support on windows
  • Add core:sys/valgrind package for valgrind, memcheck, and callgrind
  • Various bugfixes