Skip to content

Releases: onyx-lang/onyx

Onyx Nightly Release 20241216

16 Dec 00:05
Compare
Choose a tag to compare
Pre-release

This is a nightly release of the Onyx toolchain. Use with caution.

Release 0.1.13

09 Nov 05:26
Compare
Choose a tag to compare

Additions:

  • Unwrap operator, x!.
    • Similar to try operator (x?), but panics if value is not present.
  • "Field update" syntax. A shorthand to change a field of a structure.
    • .{ ..old_value, field = new_value }
  • onyx watch now works on MacOS.
  • onyx run-watch to automatically re-run the program on changes.
  • #wasm_section directive to add custom sections to the WASM binary.
  • Custom commands per project
    • Installed in a .onyx directory
  • onyx pkg build can now run shell commands and multi-stage builds.
  • Stalled compiler hook to allow for code injection when the compiler stalls.
  • Slice.map
  • Slice.map_inplace
  • Slice.fold1
  • Slice.get_opt
  • Iterator.from
  • iter.group_by
  • core.alloc.debug
  • core.os.args
  • core.crypto.hmac
  • core.crypto.keys
  • core.encoding.json.Value.as_entry_array
  • core.encoding.base64 { encode_url, decode_url }
  • core.encoding.xml

Removals:

Changes:

  • Capture/closure syntax is now (params) use (captures) ....
    • (x: i32) use (variable) -> str { ... }
    • (x) use (variable) => { ... }
  • && and || now short-circuit.
  • Fixed-sized arrays ([N] T) are now passed by value.
  • The size of tag field for unions is now dependent on the number of variants.
  • Parsing structs no longer sometimes needs #type.
  • Renamed core.alloc.memdebug to core.alloc.memwatch.

Bugfixes:

  • Many, many random bugs.

Release: 0.1.12

20 May 01:59
53d068b
Compare
Choose a tag to compare

Additions:

  • Ability to pipe into a method call.
    • x |> y->z() === y->z(x)
  • Ability to pipe into a try operator.
    • x |> y()? === y(x)?`
  • Ability to use _ where #auto is used.
    • This will be come the default soon and #auto will be removed.
  • return #from_proc to return all the way from the procedure.
  • Variant of new that accepts an r-value and places it in the heap.
  • Builtin panic procedure that is equivalent to assert(false, ...)
  • Format parameter "a" that unpacks an any and formats its internal value.
  • --generate-name-section CLI flag

Removals:

  • Optional.try as it is incompatible with new semantics of ?.

Changes:

  • str.as_str is now preferred over string.as_str
  • str.compare is now preferred over string.compare
  • str.to_cstr_on_stack is now preferred over string.to_cstr_on_stack
  • str.join is now preferred over string.join
  • Implementation of ? for Optional and Result to return from the enclosing procedure.
  • JavaScript file generated by -r js is no longer an ES6 module.

Bugfixes:

  • Fixed WASI compilation due to syntax issue.
  • Fixed WASI platform __file_open implementation for wasmtime.
  • Weird edge case when using multiple placeholder arguments in a quick procedure.

Release 0.1.11

22 Apr 03:13
Compare
Choose a tag to compare

Additions:

  • Ability specify where piped arguments are placed using _.
    • x |> foo(y, _) == foo(y, x)
  • Alternative syntax for case #default .... You can now just write case _ ....
  • Alternative syntax for binding documentation using ///.
  • Experimental compiler extensions feature, currently used to create procedural macros.
  • core.misc.any_deep_copy
  • Ability to explicitly specify tag value for tagged unions.
    • Variant as value: type, i.e. Foo as 3: i32

Removals:

  • Deprecated the use of #default in case statements. Use _ instead.
  • Removed iter.take_one. Use iter.next instead.

Changes:
There are several breaking changes in this release related to core library APIs.

  • Iterator.next now returns ? T instead of (T, bool)
  • io.Stream uses Result(T, Error) for return types instead of (Error, T)
  • switch over a range is no longer inclusive by default, since ..= exists now.
  • Enabled optional semicolons by default.
    • //+optional-semicolons is no longer necessary.

There are also several non-breaking changes.

  • The internal memory layout is different. See pull request #133 for details.

Release 0.1.10

31 Mar 00:21
Compare
Choose a tag to compare

Additions:

  • JavaScript interop
    • core.js package for JS FFI.
    • #js directive to build a JavaScript file during compilation.
  • Implicit injections
    • #inject is no longer required in some cases
  • Named return values
  • Official builds for Linux AARCH64
  • Slice and Array structures for placing methods on slices and dynamic arrays.
  • Range type improvements
    • range64 type
    • ..= operator that is a range, with an inclusive upper end.
  • New alternate error format that may become the default in the future.
    • Use --error-format v2 or set environment variable ONYX_ERROR_FORMAT to be v2.
  • Auto-disposing locals (experimental)
    • use x := ...
  • Core library functions
    • New process spawning API with builder pattern (os.command)
    • sync.MutexGuard
    • sync.Channel
    • hash.sha1
    • net.dial
    • net.resolve
    • integer constants i8.MIN, i64.MAX, etc.

Removals:

  • os.with_file

Changes:

  • Revamped CLI
    • Shorthand commands (r for run, b for build, etc.)
    • Improved appearance
    • Better help pages
    • Note: flags must now appear before all files
  • Better error messages for common issues
  • Array should be preferred over core.array
  • Slice should be preferred over core.slice
  • str should be preferred over core.string

Bugfixes:

  • Fixed compiler crash when trying to iterate over something that is not iterable.
  • Fixed wrong implementation of futexes on MacOS.
  • Fixed implementation of platform.__time()

Contributors:

Release 0.1.9

20 Feb 01:01
Compare
Choose a tag to compare

This release has some interesting new features and general usability improvements. It does have a couple rather LARGE syntax changes that will affect nearly every program written in Onyx. The two major syntax changes:

For loops:
    for x in array             instead of        for x: array

Cases with captures:
    case Value as capture      instead of        case capture: Value 

Interfaces:
    X :: interface (T: type_expr) {
        t as T;
    }

    instead of

    X :: interface (t: $T) { ... }

These syntax changes help improve readability and makes the language more friendly to newcomers. These changes also introduce two new keywords into the language that could see use in other places in the future. This is a small improvement to make, but it is better to make it now while a (relatively) small amount of Onyx code has been written.

Additions:

  • OVM-Wasm support on MacOS (thanks to @judah-caruso).
    • This enables debugging support when on MacOS.
    • Available from installer.
  • .* as a postfix alternative to *.
  • where clauses can contain arbitrary boolean expressions (thanks to @judah-caruso).
  • Small arrays (4 or fewer elements) have special accessors for their components.
  • Tree-shaking is performed prior to code generation, reducing binary size drastically in some cases.
  • Operation overloads for +, - and * for small arrays.
  • where defer as a cleaner alternative to where #bottom_test
  • core.intrinsics.wasm.memory_equal
  • core.iter.counter
  • core.iter.sum
  • core.iter.fold1
  • make(List(T))
  • core.list.from_array
  • core.list.pop_begin_opt
  • core.list.pop_end_opt
  • core.list.empty
  • core.conv.parse
  • core.conv.parse_with_allocator
  • core.encoding.json.encode_string_opt
  • core.encoding.json.as_any overload

Removals:

  • Compiler test cases are no longer shipped with toolchain.

Changes:

  • Due to tree shaking, the methods member of Type_Info_Struct and Type_Info_Union is not populated by default anymore.
    • Use the --generate-method-info CLI flag to add this information back in.
  • Due to as being a keyword now, cptr.as was renamed to cptr.as_unsafe.

Bugfixes:

  • Error reporting in many cases saw a lot of improvements.
    • Especially with polymorphic procedures, l-values, and code blocks.
  • Implementation of core.array.remove.

Contributors:

Release 0.1.8

29 Nov 02:12
Compare
Choose a tag to compare

This is an exciting release! Read more on the Onyx news page!

Additions:

  • MacOS compatibility
    • Using Wasmer runtime, MacOS on ARM and AMD64 are supported.
  • Memory debugger
    • A custom allocator that intercepts allocations and frees and reports them
      to a client for visualizations and debugging.
  • New installation script
    • sh <(curl https://get.onyxlang.io -sSfL)
    • Works on Linux and MacOS
  • KDL document parsing support
    • Used as the new format for the package manager.
    • See https://kdl.dev for details
  • os.chdir for changing the current directory
    • Supported on WASIX and Onyx runtime
  • os.getcwd for getting the current directory
    • Supported on WASIX and Onyx runtime
  • Basic build configurations into package manager.
    • Configure sources files, runtime, target file,
      included files, and CLI arguments
    • Multiple configurations per project.
    • Build with 'onyx package build <config_name>'

Removals:

Changes:

  • Simplified using union variants of type void.
    • Now instead of .{ Foo = .{} }, use .Foo instead.
  • Renamed --no-std flag to --no-core, since Onyx does not call its standard
    library "std", the name did not make any sense.
  • net.make_ipv4_address now has a reasonable definition using a string for the IP,
    instead of an integer.

Bugfixes:

  • Formatting of days and months were incorrect time.strftime.
  • Infinite loop in TCP server when a client disconnects.

Release 0.1.7

27 Oct 15:05
b1d15e3
Compare
Choose a tag to compare

Release v0.1.7

October 27th, 2023

Additions:

  • Support for WASIX, a new, extended standard to WASI, popularized by Wasmer.
    • Define WASIX in runtime.vars to enable it. (-DWASIX on the CLI)
    • Adds support for networking, futexes, and TTY control in WASI.
  • switch expressions.
    • switch can appear at the expression level, and uses case X => value to
      specify cases.
  • cbindgen now supports passing functions as arguments.
    • Internally uses dyncallback
    • Only for OVM-wasm and Linux, for now.
  • Scoped values in interfaces. X :: ... is allowed in an interface now.
  • #inject works on interfaces.
  • Polling to the io.Stream functionality.
    • Used to query when data is read/write-able from a stream, for supported streams.
    • io.stream_poll
  • misc.any_unwrap to unwrap an any containing an optional.
  • json.decode_with_result
  • json.decode_into
  • slice.group_by

Removals:

Changes:

  • Complete overhaul of networking in the core library.
    • Backwards compatiblity was not strictly maintained, but common functions did
      not change, like socket_send and socket_recv.
  • When debugging, / 0 or % 0 will trigger an exception to debug the error.

Bugfixes:

  • alloc.atomic package was broken when sync package was missing.
  • X.foo would not work if X was a pointer to a union.
  • Captures by pointer would break if the value was a primitive whose address wasn't
    taken anywhere else.
  • Symbol name reported by documentation generation was incorrect for some methods.

Beta 0.1.6

24 Sep 22:10
a7e923f
Compare
Choose a tag to compare

Additions:

  • Tagging global variables.
    • Just like procedure and structure tags.
    • Use runtime.info.tagged_globals and runtime.info.get_globals_with_tag()
  • logf for formatted logging.
    • This is only present if conv.format is present.
  • Ability to debug GC allocator by defining runtime.vars.Enable_GC_Debug.
  • Ability to set allocator on Map.
  • string.to_cstr_on_stack
  • Date.day_of_week()

Removals:

Changes:

  • misc.any_to_map now returns ? Map(str, any).
  • Build scripts on Linux no longer internally use sudo, requiring the script to be run with sudo instead.
    • This makes it possible to easily build Onyx into a container image.
  • Parse errors with an unexpected symbol now say the symbol's name instead of TOKEN_TYPE_SYMBOL.

Bugfixes:

  • alloc.arena.clear would not leave the arena in a proper state for further allocations.
  • array.filter was implemented incorrectly.
  • runtime.platform.__get_env was implemented incorrectly on Onyx runtime.
  • Result.is_ok and Result.is_err were implemented with incorrect return types.
  • Timestamp.from_date was implemented incorrectly.
  • Date.add_months was implemented incorrectly.
  • alloc.atomic was left untested.
  • Reader.read_bytes was implemented incorrectly.
  • string.last_index_of was implemented incorrectly.

Beta 0.1.5

19 Jul 02:09
dae440e
Compare
Choose a tag to compare

Additions:

  • Added ability to control the size of the tag type for tagged unions.
    • union #tag_type u8
  • Infrastructure to have custom sub-commands.
    • Any *.wasm file in $ONYX_PATH/tools is available to run with onyx <cmd>
  • __futex_wait and __futex_wake to platform layer.
    • This allows for non-busy-waiting on mutexes and semaphores.
    • Currently implemented for Onyx and JS platforms; WASI is impossible, but WASIX will come soon.
  • --skip-native flag to onyx pkg sync to skip compiling native libraries.
  • Ability to tag methods on structures.
  • tty_get and tty_set functions in core.os
    • Allows for controlling raw and echoed input
    • Currently only for onyx runtime and on Linux only.
  • -Dno_entrypoint for programs that do not have a main function.

Removals:

  • Wait_Notify_Available global in runtime package.
    • This is no longer needed as futexes are preferred instead of wait/notify.

Changes:

Bugfixes:

  • Fixed bug in json.encode that caused arrays of structures to not be outputted correctly.
  • Fixed bug in onyx pkg that caused onyx pkg new to not work as intended.