Repository navigation
Changes:
- Major compiler refactoring that allows for:
- The compiler being a C library
- The compiler being accessible from the language itself (
package core.onyx) for-macros- and much more in the future
- Calling convention was changed to match existing C WASM ABIs
- Compound return values are returned by pointer in the first argument
#file_contentsfollows the same rules as#load; always relative to the current file- Widespread removal of old
package.functionfunctions in favor ofpackage.Type.method
Additions:
- Compiler can be used as a C library using provided
include/onyx.handlib/libonyx.so - for-loops are implemented as a macro (
__for_expansioninbuiltin.onyx)- This allows you to write for-loops over custom data types.
#object "library.wasm"links a WASM object file or archive produced by Clang/GCCif optional as valuesyntax for easily extracting the value from aSomeoptional.while optional as valuesyntax for easily iterating over iterables.
- Polymorphic return types, i.e.
() -> $R { ... }. Resolves return type from callee.Frominterface andFrom.fromuses this for explicit automatic conversions.
#solidifycan now pick an overload by argument types#solidify overloaded_function(i32)
- Macros now accept
anyand..anyarguments #unquotenow has more control over unquoted code#scope(Code)to set parent scope#injectto add custom bindings visible in unquoted body
Codeblocks now have generated fields to introspect informationblock.capture_countfor number of capturesblock.capture_type_Nwhere N is a 1-index psuedo-array of given types[a: i32] {}would havecapture_type_1equal toi32
- WASI Preview 2 and WASM Component Model support
onyx wit-bindgenfor generating WIT bindings
Removals:
#load_allis deprecated in favor of#load- Widespread removal of old
package.functionfunctions in favor ofpackage.Type.method
Bugfixes:
- Compound assignment (
+=,-=, etc) only evaluate the left hand side once. - Procedure types properly associate (
(i32) -> (i32) -> i32) typeof Struct.{}.xandStruct.{}.xwork.[10, 20, 30][0]works