Category:Onyx (wasm)

From Rosetta Code
This page is a stub. It needs more information! You can help Rosetta Code by filling it in!
Onyx (wasm)
This programming language may be used to instruct a computer to perform a task.
Official website
See Also:

Listed below are all of the tasks on Rosetta Code which have been solved using Onyx (wasm).

Onyx is a WebAssembly-first language (`app.wasm`). WebAssembly can be used inside of a browser but is also growing in popularity outside of the browser, in part due to projects like Wasmer, Wasmtime, and WasmEdge. These "controlled environments" could be game engines, where WASM is used as a "script" system; cloud functions, where WASM is used to respond to requests; plug-in systems for editors or tools.

Onyx uses a modernized C-like syntax, similar to Jai or Odin. Onyx is an imperative and procedural language in which statements are evaluated in the order they are written in, but does allow for functional-inspired syntax using the pipe operator.

For example:

use core { printf, iter }

main :: () {
    for i in 1 .. 10 {
        fact := factorial(i);
        printf("{}! = {}\n", i, fact);

factorial :: (n: i32) -> i32 {
    return iter.as_iter(1 .. n)
        |> iter.fold(1, (x, y) => x * y);

Pages in category "Onyx (wasm)"

The following 6 pages are in this category, out of 6 total.