Skip to content

Releases: odin-lang/Odin

dev-2024-02

01 Feb 16:56
Compare
Choose a tag to compare

As part of the Journey to Odin 1.0, we are cleaning up the packages that Odin provides and making explicit delineations for what is needed. A new library collection has been added: base.

This means that there are now 3 official library collections as part of the official compiler:

  • base - packages which are required by the language itself, defined by the language specification, and all compilers must implement (implementations may different, but interface must be the same)
    • All platforms (including freestanding) will be supported in this library collection
  • core - packages which are core to most programming development and supported by most platforms.
    • Most platforms will be supported in this library collection
  • vendor - third-party packages with first-party support which are useful for numerous projects (graphics APIs, audio, window management, specialized networking, etc).
    • Many platforms will be supported in this library collection

Packages which have been moved to the new base library collection:

  • core:builtin -> base:builtin (previous is still valid as an alias)
  • core:intrinsics -> base:intrinsics (previous is still valid as an alias)
  • core:runtime -> base:runtime (previous is still valid as an alias)

New Language Features

  • builtin.quaternion call must name the elements with x y z w or real imag jmag kmag rather than be positional
  • struct #field_align(N)
    • It sets the minimum alignment for the fields within a struct. This cannot be used with #packed, but can be used with #align(N).
    • If #align(N) is less than #field_align(N), then a warning will be printed.
  • Removal of incl and excl built-in procedures. Prefer:
    • s += {.A,} for incl(&s, .A)
    • s -= {.A,} for excl(&s, .A)

Compiler Improvements

  • @(entry_point_only) attribute to mark a procedure which can only be called within main (the entry point procedure)
  • Move builtin matrix procedures to intrinsics
    • They can be either accessed from base:intrinsics or core:math/linalg etc packages
  • Fix calling conventions for the core:simd/x86 calling conventions
  • Expand -subsystem option on Windows
  • -default-to-panic-allocator
  • Numerous typo fixes

New Packages

Package Improvements

  • Use "system" calling convention everywhere "stdcall" was previous used
    • This allows cross platform use of packages which were originally Windows only but not any more
  • core:mem/virtual
    • virtual.map_file
  • core:dynlib
    • dynlib.initialize_symbols
    • dynlib.last_error
  • core:c/libc
    • libc.to_stream
  • core:math/fixed improvements
  • Fix vendor:raylib IsGestureDetected binding
  • Fixes for wasm targets
  • Remove any cyclic dependencies that base:runtime previously depended on (e.g. core:os)

dev-2024-01

05 Jan 13:24
5961d4b
Compare
Choose a tag to compare

New Language Features

Compiler Improvements

  • -obfuscate-source-code-locations flag to hash location strings
  • MacOS:
    • -no-crt now works
    • Fix the duplicate -lSystem linker warning
    • Default to SDK version for -minimum-os-version to avoid linker warnings
  • #load now works with absolute paths
  • Fix a bug that caused running tests twice
  • General compiler crash fixes

New Packages

Package Improvements

  • Fixes:
    • Default temp_allocator/arena edge cases
    • Dynamic array assign_at_elems bug
  • core:sys/linux: syscall additions
  • core:sys/windows: HIDPI, Error codes enum
  • vendor:raylib: update to version 5
  • core:slice: reduce_reverse, filter_reverse, repeat, unique, unique_proc
  • core:log: Allocator print formatted (kb, mb etc.) bytes
  • core:fmt: Make %g the default for floats
  • core:encoding/json: basic union unmarshalling

dev-2023-12

05 Dec 16:24
31b1aef
Compare
Choose a tag to compare

New Language Features

Compiler Improvements

  • -microarch:<string>
  • Default to static map look ups on Windows (still default to dynamic on other systems)
  • Lower map's minimum capacity to 8 from 64
  • Numerous Bug Fixes
  • Add new intrinsics for union_tag_* related stuff
  • Fix &x[i] of ^#soa types

New Packages

  • vendor:x11/xlib

Package Improvements

  • core:crypto

dev-2023-11

01 Nov 18:46
Compare
Choose a tag to compare

New Language Features

Compiler Improvements

  • LLVM 17 support for all platforms
  • Numerous code generation improvements with LLVM 17
  • -no-crt improvements to all platforms

New Packages

Package Improvements

  • Numerous improvements to core:sys/linux

dev-2023-10

02 Oct 20:26
Compare
Choose a tag to compare

New Language Features

  • or_break
  • or_continue
  • #relative [^]T (relative multi-pointers)
    • Replaced #relative []T (relative slices)
    • This data type might be removed in the future

Compiler Improvements

  • LLVM 17.0.1 for Windows
    • Linux and Darwin support coming very soon
  • -sanitize:<string> (can be applied together)
    • -sanitize:address (Windows, Linux, Darwin)
    • -sanitize:memory (Linux)
    • -sanitize:thread (Linux, Darwin)
  • raw_data(^matrix[R, C]T) -> [^]T
  • Remove for in and switch in in favour of for _ in and switch _ in
  • Disallow aliasing of any and typeid
  • ODIN_PLATFORM_SUBTARGET global constant
  • General Fixes

New Packages

Package Improvements

  • General Fixes

dev-2023-08

02 Aug 15:18
9453b23
Compare
Choose a tag to compare

New Language Features

Compiler Improvements

  • Separate vetting command line flags
    • -vet-unused
    • -vet-shadowing
    • -vet-using-stmt
    • -vet-using-param
    • -vet-style
    • -vet-semicolon
    • -vet is equivalent to -vet-unused -vet-shadowing -vet-using-stmt
  • //+vet file tags
    • //+vet enables -vet for that file
    • //+vet using-stmt to enable -vet-using-stmt for that file
    • //+vet !using-stmt disables -vet-using-stmt if it is enabled in some way (e.g. -vet)
    • //+vet semicolon !using-stmt enables -vet-semicolon but disables -using-stmt
  • Minor improvements to type inference for procedure groups
  • Numerous bug fixes

New Packages

Package Improvements

  • General Fixes
  • General Documentation Improvements

dev-2023-07

08 Jul 10:20
Compare
Choose a tag to compare

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

03 May 14:18
Compare
Choose a tag to compare

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

03 Apr 20:36
Compare
Choose a tag to compare

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

03 Mar 11:56
Compare
Choose a tag to compare

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