Skip to content

Releases: odin-lang/Odin

dev-2022-12

06 Dec 22:54
Compare
Choose a tag to compare

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_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

01 Nov 21:13
382bd87
Compare
Choose a tag to compare

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

02 Oct 19:40
Compare
Choose a tag to compare

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

01 Sep 22:21
74458ab
Compare
Choose a tag to compare

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

dev-2022-08

02 Aug 11:33
73beed0
Compare
Choose a tag to compare

New Language Features

None

New Compiler Features

  • #by_ptr procedure attribute to enforce a parameter to be passed by pointer internally

Compiler Improvements

  • Improved build scripts for *nix systems
  • Improved error message when doing ^x instead of &x for addressable variables
  • Improved debug symbol generation
  • Fix and improve x->y() behaviour to minimize duplicate evaluation
  • Disallow proc do stmt and only allow proc() { stmt }
    • This removed an ambiguity with parsing
  • Fix minor issue with a lack of a trailing comma in parsing structs without -vet
  • Numerous bug fixes

New Packages

None

Package Improvements

  • Improvements to strings.Buffer related procedures
  • Update vendor:raylib to support macos-arm64
  • Minor improvements to mathematical procedures
  • Minor clean up of the WASI API
  • Simplify logic of append of zero sized elements

dev-2022-07

02 Jul 10:00
Compare
Choose a tag to compare

New Language Features

  • Add builtin shrink for dynamic maps and arrays

New Compiler Features

Compiler Improvements

  • Fix odin test runner.
  • Use memmove if possible when emitting store over a certain size

New Packages

  • core:slice/heap - A max heap implementation

Package Improvements

  • Tighter allocation of Arena allocator
  • Remove simd_rem; Disallow simd_dev for integers
  • Remove strings dependency from core:sys/windows
  • Additional Win32 bindings
  • Add new verbs and qualifiers to core:fmt
  • Support utf-16 printing with []u16 and [^]u16
  • Add strings.prefix_length and slice.prefix_length
  • Add runtime.dll_forward_reason for Windows

dev-2022-06

01 Jun 20:39
Compare
Choose a tag to compare

New Language Features

  • Generic #simd type and intrinsics

    • Supports array programming semantics (operators)
    • New generic intrinsics
    • Platform specific intrinsics for the x86 family:
      • sse, sse2, sse41, sse42, ssse3
      • cmpxchg16b, fxsr, lzcnt, pclmulqdq, popcnt, sha
    • PR #1807
  • Merge functionality of #maybe with standard union functionality

    • Maybe :: union($T: typeid) {T} No need for #maybe any more
  • Deprecation of a..b range syntax to prefer a..=b

New Compiler Features

  • New intrinsics:

    • non_temporal_load
    • non_temporal_store
    • fused_mul_add
  • Generic #simd intrinsics:

    • simd_add
    • simd_sub
    • simd_mul
    • simd_div
    • simd_shl
    • simd_shr
    • simd_shl_masked
    • simd_shr_masked
    • simd_add_sat
    • simd_sub_sat
    • simd_and
    • simd_or
    • simd_xor
    • simd_and_not
    • simd_neg
    • simd_abs
    • simd_min
    • simd_max
    • simd_clamp
    • simd_lanes_eq
    • simd_lanes_ne
    • simd_lanes_lt
    • simd_lanes_le
    • simd_lanes_gt
    • simd_lanes_ge
    • simd_extract
    • simd_replace
    • simd_reduce_add_ordered
    • simd_reduce_mul_ordered
    • simd_reduce_min
    • simd_reduce_max
    • simd_reduce_and
    • simd_reduce_or
    • simd_reduce_xor
    • simd_shuffle
    • simd_select
    • simd_ceil
    • simd_floor
    • simd_trunc
    • simd_nearest
    • simd_to_bits
    • simd_lanes_reverse
    • simd_lanes_rotate_left
    • simd_lanes_rotate_right
  • Platform specific intrinsics:

    • x86_cpuid
    • x86_xgetbv
  • @(priority_index=<int>) for foreign import

    • Force certain things to be linked before others
    • Required for the deterministic link order of foreign imports

Compiler Improvements

  • Allow transmute on constant expressions
  • Heavily improved support for js_wasm32 target
    • Basic DOM UI procedures
    • Event system including listeners
    • Page Allocator
  • Compiler flag error message improvements
  • Improved ternary-if type inference
  • Improved -vet shadowing with ternary-if expressions
  • Allow import _ "foo" to allow for @(init) procedures without producing an import name
  • Correct @(require_results) on parapoly procedures

New Packages

  • core:simd
  • core:simd/x86
  • core:encoding/endian
  • vendor:ggpo
  • vendor:openexr

Package Improvements

  • Unify raw_data in core:mem with core:runtime
    • Make raw_data return [^]T types
  • core:image generic interface improvements
    • image.which
    • Generic loader
  • Add #optional_ok to dynlib.symbol_address
  • Add mem.DEFAULT_PAGE_SIZE
  • Add rand.init_as_system to allow for system-level based random number generation
  • Numerous minor fixes to core: packages
  • Interface cleans up to numerous packages keeping platform specific code private

dev-2022-05

01 May 18:31
df233ae
Compare
Choose a tag to compare

New Language Features

None

New Compiler Features

  • New intrinsics:
    • intrinsics.type_is_multi_pointer
    • intrinsics.type_field_type

Compiler Improvements

  • Numerous bug fixes
  • Refactored filename handling
  • Error message if the output is a directory
  • Packages are assumed to be directory-based unless -file is supplied

New Packages

  • New builtin container_of
  • core:compress/shoco A short string (de)compressor
  • core:container/intrusive/list An intrusive linked list
  • core:encoding/varint LEB128 encode and decode
  • core:encoding/xml An XML parser
  • core:image/netpbm A reader/writer for the NetPBM image formats
  • core:image/qoi A reader/writer for the QOI image format
  • core:image/tga A writer for a common subset of the TGA format
  • core:text/i18n An easy way to translate your software using GetText or Qt Linguist translations

Package Improvements

  • Additional D3D and win32 bindings and constants
  • Unified Sema and Atomic_Sema behaviour
  • Fix quaternion implementation #1644
  • Updated Vulkan generator and package
  • Fixed static arena assertion fail #1740
  • core:container/lru Reduce allocations, fixes
  • core:encoding/json Unmarshal fixes
  • core:hash/xxhash Fixes
  • core:path/filepath Add file stem and long-extension procedures
  • core:slice More helpers
  • core:strings Add Levenshtein distance
  • core:sync Improvements
  • core:thread New thread pool implementation
  • vendor:metal and vendor:darwin numerous additions and fixes
  • Quicksort minor fix

dev-2022-04

04 Apr 20:57
Compare
Choose a tag to compare

New Language Features

  • None

New Compiler Features

  • Rework of the entire atomic intrinsics (similar to C11 in design)
    • Atomic_Memory_Order enum
    • atomic_type_is_lock_free
    • atomic_thread_fence
    • atomic_signal_fence
    • atomic_store
    • atomic_store_explicit
    • atomic_load
    • atomic_load_explicit
    • atomic_add
    • atomic_add_explicit
    • atomic_sub
    • atomic_sub_explicit
    • atomic_and
    • atomic_and_explicit
    • atomic_nand
    • atomic_nand_explicit
    • atomic_or
    • atomic_or_explicit
    • atomic_xor
    • atomic_xor_explicit
    • atomic_exchange
    • atomic_exchange_explicit
    • atomic_compare_exchange_strong
    • atomic_compare_exchange_strong_explicit
    • atomic_compare_exchange_weak
    • atomic_compare_exchange_weak_explicit
  • union #shared_nil
    • This adds a feature to union which requires all the variants to have a nil value and on assign to the union, checks whether that value is nil or not. If the value is nil, the union will be nil (thus sharing the nil value)
  • Improved build script for the compiler
  • Numerous bug fixes

Compiler Improvements

  • Improve -help messages for define/config

New Packages

  • Completely redesigned core:sync
    • Designed from the ground up with making the zero value useful (no need to initialize nor destroy values)
    • Utilizes the abilities of modern OSes with native futex support
    • Primitives:
      • Mutex
      • RW_Mutex
      • Recursive_Mutex
      • Cond
      • Sema
      • Futex
    • Extended:
      • Wait_Group
      • Barrier
      • Auto_Reset_Event
      • Ticket_Mutex
      • Benaphore
      • Recursive_Benaphore
      • Once
  • core:math/ease

Package Improvements

  • Update Thread Pool in core:thread
  • More additions to core:sys/windows
  • Remove #caller_location from certain calls in core:container/small_array
  • vendor:stb/easy_font fixes/improvements
  • Update mem.nil_allocator to match the same implementation in runtime
  • Numerous improvements and additions to core:strings
  • Add nil check on ast.walk in core:odin/ast
  • Numerous bug fixes

dev-2022-03

01 Mar 16:42
Compare
Choose a tag to compare

New Language Features

  • [Enum]Type{...} checks for missing enumerated fields in a compound literal by default
    • Opt-out with #partial [Enum]Type{...}
  • #sparse[Enum]Type for non-contiguous enum fields used in an enumerated array type
    • #partial #sparse[Enum]Type{...} can be combined to allow for missing fields in a sparse enumerated array compound literal

New Compiler Features

  • OpenBSD support
  • Objective-C Runtime Intrinsics
    • intrinsics.objc_send
    • intrinsics.find_selector
    • intrinsics.find_class
    • intrinsics.register_selector (only required when creating Objective-C classes at runtime)
    • intrinsics.register_class (only required when creating Objective-C classes at runtime)
  • intrinsics.constant_utf16_cstring

Compiler Improvements

  • //+private file support
  • Numerous bug fixes
  • Removal of context.user_data
    • Prefer context.user_ptr

New Packages

Package Improvements

  • core:mem/virtual Linux Support
  • Add is_16_bit_from_memory to vendor:stb/image