- 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 on semaphores.
+ - 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.
Removals:
--- /dev/null
+use core {*}
+use runtime
+
+#inject runtime.vars.Onyx_Enable_Operator_Methods :: true
+
+main :: () {
+ Point :: struct {
+ x, y: i32;
+
+ __eq :: (p1, p2: Point) => {
+ return p1.x == p2.x && p1.y == p2.y;
+ }
+ }
+
+ p := Point.{1, 2};
+
+ if p == Point.{1, 2} {
+ println("If works!");
+ }
+
+ switch p {
+ case .{0, 0} ---
+ case .{1, 2} do println("Working!");
+ }
+}