Skip to content

Releases: odin-lang/Odin

dev-2022-02

02 Feb 00:11
Compare
Choose a tag to compare

New Language Features

None

New Compiler Features

  • Add #no_type_assert and #type_assert to disable implicit type assertions with x.(T)
  • Add ODIN_ERROR_POS_STYLE constant and -error-pos-style:<string> option to allow for default or unix style error messages

Compiler Improvements

  • Correct debug information logic for procedure parameters
  • General improvements to odin doc support the new https://pkg.odin-lang.org/
  • Correct //+private for odin doc
  • Make ODIN_ENDIAN a constant enum value rather than a string
  • Rename architecture 386 to i386
  • Improve entry code handling to support more platforms easily in the future
  • Improve/simplify quaternion casting

New Packages

  • core:container/lru
  • Rename core:path to core:path/slashpath

Package Improvements

  • slice.stable_sort* procedures
  • Add allocator parameter to rand.perm
  • rand.exp_float64
  • strings.split_lines* procedures

dev-2022-01

02 Jan 23:36
Compare
Choose a tag to compare

New Language Features

None

New Compiler Features

None

Compiler Improvements

  • Correct odin doc default parameter value init_string generation
  • Improve debug symbol retention with -debug -o:minimal
  • Disallow @(static) and @(thread_local) within defer statements
  • Improvements for Darwin ARM64 support
  • Improved float to quaternion conversion support
  • Improved global when handling

New Packages

  • Replace core:container with new packages
  • core:container/bit_array
  • core:container/priority_queue
  • core:container/queue
  • core:container/small_array

Package Improvements

  • Improvements to core:math/big
  • Improvements to core:odin/parser
  • Make strconv more robust
  • Fix typo in core:json/encoding from unmarshall to unmarshal
  • Remove the extra hidden 0 terminator from strings.clone and bytes.clone which was there for very old legacy reasons, prefer strings.clone_to_cstring when that behaviour is needed
  • Fix strings.fields_proc and strings.index_any
  • Fix math.prod
  • Add hash.djbx33a
  • Add sort.map_entries_by_key and sort.map_entries_by_value

dev-2021-12

01 Dec 22:05
9f0a30e
Compare
Choose a tag to compare

New Language Features

  • Allow casting from floats to complex numbers and quaternions
  • @(linkage=<string>) for procedures and variables
  • @(require) for procedures
  • #load_hash(<filepath>, <string-hash-kind>)
  • -target:js_wasm32 target (custom Web JavaScript runtime to run Odin executables)

New Compiler Features

  • Add ODIN_NO_CRT global boolean constant
  • Add ODIN_BUILD_MODE global string constant
  • Allow compilation of assembly files on Windows through nasm.exe in conjunction with the foreign import system (.asm, .s, .S files)
  • -extra-assembler-flags:<string>
  • -timings-export:<string>

Compiler Improvements

  • Improve matrix related operations
  • Correctly support -default-to-nil-allocator for all platforms
  • -no-crt improvements on Windows
  • General wasm32 improvements
  • Internal compiler (not language) improvements to data structures
  • Improve compilation passes on LLVM 12.0.1 and LLVM 13.0.0 (compiler still defaults to LLVM 11.1.0)
  • Correct x in ptr logic
  • Numerous bug fixes

New Packages

  • vendor:raylib version 4.0
  • core:math/linalg/glsl - GLSL-like mathematics types and operations
  • core:math/linalg/hlsl - HLSL-like mathematics types and operations

Package Improvements

  • Make math procedures contextless
  • Add asinh , acosh, atanh
  • Represent matrices in fmt as expected
  • Make runtime builtin matrix procedures contextless
  • package runtime linkage improvements
  • linalg.matrix4_look_at_from_fru
  • Implement math.ldexp and math.frexp in native Odin
  • Add log1p, erf, erfc, ilogb, logb nextafter, gamma, lgamma, signbitto core:math
  • Add support for darwin to core:c/libc
  • Add numerous new core:crypto packages
  • Add os.read_at_least and os.read_full utility procedures
  • Correct reading from a console on Windows

dev-2021-11

03 Nov 00:07
Compare
Choose a tag to compare

New Language Features

  • matrix type
    • matrix[Rows, Columns]Element_Type
    • A matrix is a mathematical type built into Odin. It is a regular array of numbers, arranged in rows and columns
    • Multiplication between matrices and arrays
    • Component-wise operations
    • Submatrix casting square matrices
    • Submatrix casting non-square matrices
    • Column-major memory layout
    • Limited to a maximum of 16 elements
    • Supports integers, floats, and complex numbers (only)
    • Optimized for SIMD vectorization
    • Built-in procedures (Compiler Level)
      • transpose
      • outer_product
      • hadamard_product
      • matrix_flatten
      • conj
    • Built-in procedures (Runtime Level)
      • determinant
      • adjugate
      • inverse
      • inverse_transpose
      • hermitian_adjoint
      • matrix_trace
      • matrix_minor
  • odin report
    • Reporting of Platform Specific Information
  • wasi_wasm32 support
  • Improved WASM support in general

New Packages

  • core:crypto
  • vendor:ENet

Package Improvements

  • Improvements to vendor:OpenGL
    • Set VertexAttribPointer related calls to use uintptr instead of rawptr for the byte offset parameter
    • Convert all functions taking GLboolean to bool
  • Updates to core:sync/sync2
    • Generic Futex interface for each platform
    • Sema implemented with Futex
  • Improvements to core:mem/virtual to make usage consistent
  • Minor improvements to the SDL vendor packages
  • core:encoding/json - add alias for MJSON as Bitsquid
  • Improvements to vendor:microui
  • Improvements to vendor:raylib
  • Add more OOM checks within the core library
  • Unify runtime.memory_equal and runtime.string_eq logic
  • Add id to thread.Thread
  • Add slice.swap_between
  • Add experimental big.Rat

Compiler Improvements

  • intrinsics.unaligned_store
  • intrinsics.unaligned_load
  • intrinsics.mem_zero_volatile
  • offset_of_by_string
  • Heavily improve the LLVM struct type generation to improve ABI
  • Simplify map logic and code generation
  • Disallow or_return within defer
  • Fix strip-semicolon on some machines which didn't truncate correctly
  • Allow parsing for [^]T{} to improve error messages
  • Support LLVM 11, LLVM 12, and LLVM 13 in the code
  • Fix debug problems
  • Improved bit_set semantics

dev-2021-10

01 Oct 14:19
Compare
Choose a tag to compare

New Language Features

New Packages

  • vendor:raylib
    • Including vendor:raylib/easings.odin
  • vendor:microui
    • Odin native source port
  • vendor:stb/image
    • Includes: stb_image.h, stb_image_resize.odin, stb_image_write.odin
  • vendor:stb/easy_font
  • vendor:stb/vorbis
  • vendor:stb/truetype
  • core:hash/xxhash
  • core:mem/virtual (still experimental and work in progress)

Package Improvements

  • Improvements and additions to core:encoding/json
    • Support json.unmarshal
      • Writing to []byte, strings.Builder, and io.Writer
    • Support three different dialects of JSON: JSON (strict), JSON5, MSJON (Bitsquid flavour)
  • Minor corrections to vendor:sdl2
  • Improvements to vendor:vulkan to use [^] where appropriate
  • Improvements to core:math/big
  • Additions to core:reflect
    • reflect.equal, reflect.not_equal
    • reflect.any_base, reflect.any_core
    • reflect.set_union_value
  • Changes to core:io
    • Optional n_read/n_written parameters (useful for building utility procedures)
    • Move strings.write_quoted_* to io.write_quoted_*
  • Numerous tests for the the png, gzip, zlib, et al packages
  • Add bits.log2
  • Add i128 and u128 parsers to core:strconv
  • Correct append_soa for #soa[dynamic][N]T

Compiler Improvements

  • Update Windows to LLVM 12.0.1
  • odin strip-semicolon utility tool to remove unnecessary semicolons
  • -strict-style
  • -strict-style-init-only
  • intrinsics.prefetch_* procedures
  • Fix slice indices endianness
  • General dead code culling in the compiler
  • Simplify parsing for directives
  • Correct f64 <-> u128/i128 code generation
  • Make map internals more robust when using mem.nil_allocator()
  • Fix [^]u8 to cstring conversion
  • Allow [^]T to uintptr conversion

dev-2021-09

01 Sep 12:15
Compare
Choose a tag to compare

New Language Features

  • or_return atom expression (suffix)
    • extremely useful for early returning with multiple return values
    • x, err = foo(); if err != nil { return } can now becomes x = foo() or_return;
  • or_else as 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 len and cap to return uint if a type is uint to aid people wanting to use unsigned integers
  • Unify semantics of the built-in swizzle procedure with the selector expression semantics e.g. .xyz
  • Define where #bounds_check and #no_bounds_check can 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

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 vendor library collection
  • vendor:sdl2
    • Full bindings to the SDL2 library
    • Ships with DLLs and Libs for Microsoft Windows
    • Bundled with gamecontrollerdb.txt
  • vendor:sdl2/image
  • vendor:sdl2/mixer
  • vendor:sdl2/net
  • vendor:sdl2/ttf
  • vendor:OpenGL
  • vendor:vulkan
  • vendor:glfw
  • vendor:portmidi

Compiler Improvements

  • Unify multithreading logic through the compiler
  • Remove numerous possible race conditions
  • Disallow using on enum declarations in favour of implicit selector expressions: .A
  • Simplify data structures within the compiler for better memory reuse
  • Correct DllMain behaviour
  • 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_int directive to replace auto_cast uses on parameters
  • Add map_insert which returns the pointer to the inserted value (assuming no resizes happen in the mean time)

dev-2021-08

02 Aug 21:32
Compare
Choose a tag to compare

New Language Features

  • or_else built-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 check times
    • 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)
  • Improve error handling for parsing errors
  • Replace the old big int library with libTomMath

Packages

  • Add #no_bounds_check to linalg procedures
  • Add slice.sort_by_cmp
  • Add slice.min and slice.max
  • Add strings.cut
  • Deprecate sort.slice and sort.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

01 Jul 13:02
Compare
Choose a tag to compare

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
  • 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_union types
  • 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 switch statements (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.crc32
    • hash.adler32

Bug Fixes

  • Fix filepath bug leak
  • Improve linalg.transpose return type behaviour
  • Fix 128-bit integer to float cast by explicitly calling the procedure (was an LLVM bug)
  • Fix -lld on Windows
  • FIx double evaluation buf with selector call expressions x->y(z)->w(a)
  • Fix semicolon insertion rule for ---

dev-2021-06

01 Jun 11:05
Compare
Choose a tag to compare

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 : y and x if cond else y logic
  • Improve type inference system to allow &{} alongside &T{} in some cases
  • Change for in x..y behaviour 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-modules support (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_zip and soa_unzip to demo

Fixes

  • Numerous bug fixes

dev-2021-05 New Backend Release

01 May 17:49
Compare
Choose a tag to compare

Compiler Changes

  • Removal of the old backend which manually produced .ll files and passed them to the LLVM binaries directly
    • Removes need for llc and opt binaries
  • LLVM C API based backed as the main backend for all platforms and targets
    • Removes need for -llvm-api
  • Full debug symbols support for Windows (*nix is still experimental)
  • M1 ARM64/AARCH64 Support -target:darwin_arm64
  • -strict-style style as default
  • New Versioning System dev-yyyy-mm:sha
  • New flags
    • -build-mode modes:
      • llvm-ir
      • assembly
    • -o:<string> flag as an alternative to -opt:<integer>
      • Accepted values: mininal, size, speed
    • -vet-extra for extra vet checks (many usually false positives)
    • -microarch:<string>
    • -disallow-do
    • -default-to-nil-allocator
  • ODIN_ROOT environment variable to be able to change the root directory for the Odin root path
  • odin test
    • build ands runs procedures with the attribute @(test) in the initial package
  • odin doc
    • generate documentation from a .odin file, or directory of .odin files
    • -doc-format Generates documentation as the .odin-doc format (useful for external tooling)
  • Improvements to -vet
  • Many bug fixes

Language Changes

  • Ability to iterate on #soa types with a for-in loop
  • soa_zip (generate #soa type from slices)
  • soa_unzip (generate slices from #soa type)
  • make_soa and delete_soa
  • Allocator procedure signature change to support return a []byte and Allocator_Error code
  • Removal of intrinsics.x86_mmx
  • Remove #opaque types
  • Remove bit_field types
    • Prefer bits.bitfield_extract and bits.bitfield_insert procedures located in core:math/bits
  • Replace inline and no_inline with #force_inline and #force_no_inline, respectively
  • Improved #optional_ok logic
  • New procedure attributes:
    • @(disabled=<boolean>)
    • @(cold)
    • @(optimization_mode=<string>)
  • f16, f16le, f16be types
  • Removal of "pure" calling convention
  • Addition of "naked" calling convention (removes prologue and epilogue)
  • min(T)/max(T) support where T is a float
  • Make any struct comparable as long as all of its fields are comparable
  • Make any comparable type a valid map key type
  • //+build ignore tag
    • Useful for examples within a package

Core Library Changes

New Packages

  • core:bufio
  • core:bytes
  • core:c/frontend/tokenizer
  • core:c/frontend/preprocessor
  • core:compress
  • core:compress/gzip
  • core:compress/zlib
  • core:image
  • core:image/png
  • core:io
  • core:math/fixed
  • core:path (URI-like paths)
  • core:path/filepath (OS paths)
  • core:slice
  • core:sort
  • core:text/scanner

Experimental Packages

  • core:sync/sync2 (will replace core:sync when finished)

New Additions to package intrinsics

  • volatile_load
  • volatile_store
  • debug_trap
  • trap
  • alloca
  • cpu_relax
  • read_cycle_counter
  • count_ones
  • count_zeros
  • count_trailing_zeros
  • count_leading_zeros
  • reverse_bits
  • byte_swap
  • overflow_add
  • overflow_sub
  • overflow_mul
  • expect
  • type_has_field
  • type_proc_parameter_count
  • type_proc_return_count
  • type_proc_parameter_type
  • type_proc_return_type
  • type_polymorphic_record_parameter_count
  • type_polymorphic_record_parameter_value
  • type_field_index_of
  • type_equal_proc
  • type_hasher_proc