From: Brendan Hansen Date: Wed, 19 Jul 2023 02:06:17 +0000 (-0500) Subject: added beta 0.1.5 article X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=776e6752b00ee200793e8fb382a0fee6d7078f9a;p=onyxlang.io.git added beta 0.1.5 article --- diff --git a/www/news-articles/index.json b/www/news-articles/index.json index bec20b7..a12f56e 100644 --- a/www/news-articles/index.json +++ b/www/news-articles/index.json @@ -1,4 +1,10 @@ [ + { + "name": "Beta Release 0.1.5", + "path": "release-0.1.5", + "date": "18th July 2023", + "description": "Onyx's beta 0.1.5 release" + }, { "name": "Beta Release 0.1.4", "path": "release-0.1.4", diff --git a/www/news-articles/release-0.1.5.html b/www/news-articles/release-0.1.5.html new file mode 100644 index 0000000..bc60578 --- /dev/null +++ b/www/news-articles/release-0.1.5.html @@ -0,0 +1,76 @@ +

Beta Release 0.1.5

+ +

+This release brings additions to Onyx's platform layer, allowing for missing things like futexes and TTY control. +

+ +

Futexes

+ +

+A fast-userspace mutex (or futex) is mechanism that allows any memory address to be used as a resource that can be waited on and woken up. +Most users will not have to use futexes in their own programs, but they significantly benefit the standard synchronization library. +They allow for mutexes, semaphores and condition variables to not rely on spin-looping to wait. +

+ +

+Before futexes, the following kind of program would have had an expensive spin-loop that would have negated the efficiency trying to be gained. +Now, both threads barely use any CPU time. +

+ +
use core {*}
+
+counter: sync.Semaphore;
+
+main :: () {
+    sync.semaphore_init(&counter, 0);
+
+    // Spawn a thread that infinitely waits for a semaphore to be signaled.
+    t: thread.Thread;
+    thread.spawn(&t, cast(&i32, null), _ => {
+        while true {
+            sync.semaphore_wait(&counter);
+            println("Got a signal!");
+        }
+    });
+
+    // Every second, signal the semaphore.
+    while true {
+        os.sleep(1000);
+        sync.semaphore_post(&counter);
+    }
+}
+
+ +

+Futexes are available in the onyx and js platform layers. +The wasi platform layer currently does not support futexes of any kind. +However, a new WASI standard, WASIX, does support futexes. +

+ +

Full Changelog

+
+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 `
+- `__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.
+