Skip to content

dev-2024-02

Compare
Choose a tag to compare
@gingerBill gingerBill released this 01 Feb 16:56
· 1073 commits to master since this release

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)