Open-source project
onyx-lang/onyx avatar
onyx-lang/onyx

Onyx compiles only to WebAssembly, and the examples read like the manual

✨ The compiler and developer toolchain for Onyx

692 stars28 forksCBSD-2-Clause

At a glance

What is it?
onyx-lang/onyx is a BSD-2-Clause C implementation of a general purpose, procedural and pragmatic language whose only compilation target is WebAssembly through a custom backend, with an interpreter, a runtime and a numbered set of example programs that cover the language feature by feature. The project ships nightly builds and is explicit that it is still under active development and that Windows support is rougher than Linux and macOS.
Who is it for?
Adopt Onyx if you are shipping something into a browser and want a language whose only target is WebAssembly, so there is no native backend to maintain and no cross compilation to reason about, and if you are willing to work with a compiler that is still in the 0.1 range with beta tags.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 15 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 24, 2026, and from our analysis. They are not legal advice.

Editorial analysis

One target, and it is WebAssembly

Onyx is described as a general purpose, efficient, procedural and pragmatic programming language for application development, and the sentence that defines it is the next one: Onyx compiles solely to WebAssembly through a custom backend, and the README attributes its fast build times to that single target. That is an unusual constraint for a general purpose language, and it cuts both ways. The benefit is that there is exactly one code path to maintain and one runtime to reason about, so the compiler has one job and the build is quick. The cost is that anything requiring a native binary, a desktop application or a platform specific system call is out of scope for the compiler as it stands, and the language is not in a position to change that without changing its nature. The repository is written in C, which is the usual choice for a compiler and a WebAssembly backend, and the project publishes to onyxlang.io, with documentation, an installation guide and an online playground at try.onyxlang.io.

The README example shows pipes carrying the whole program

The single code sample in the README is worth reading closely, because it is the language's public face. It declares a struct with an age and a name, then builds a list of thirty random people through a pipeline of iterator operations, where the pipe operator threads the value forward:

odin
use core {*}

Person :: struct { age: i32; name: str }

main :: () {
    // Generate a list of 30 random people
    people := Iterator.from(0 .. 30)
        |> Iterator.map(_ => Person.{
            random.between(1, 10)
            random.string(10, alpha_numeric=true)
        })
        |> Iterator.collect()

    // Sort them by age
    Slice.sort(people, (a, b) => a.age - b.age)

The rest of the program groups the people by age and prints the groups, iterating over the grouped pairs. The syntax choices are visible in the sample: the double colon for declarations, the brace initialiser inside the constructor call, the throwaway identifier for an ignored argument, and the use core {*} line that pulls in the standard library. The comments in the sample are also a compact feature list, since the pipeline is what makes the code read as a sequence of transformations rather than a sequence of statements.

The numbered examples are a feature by feature tour

The examples directory is the closest thing the repository has to a tutorial, and it is organised as a numbered progression. It starts with 01_hello_world.onyx and 02_variables.onyx, moves through 03_basics.onyx, 04_fixed_arrays.onyx, 05_slices.onyx, 06_dynamic_arrays.onyx, 07_structs.onyx, 08_enums.onyx, 09_for_loops.onyx, 10_switch_statements.onyx, 11_map.onyx and 12_varargs.onyx, and then covers the parts of the language where the design is most distinctive: 13_use_keyword.onyx, 14_overloaded_procs.onyx, 15_polymorphic_procs.onyx, 16_pipe_operator.onyx, 17_operator_overload.onyx, 18_macros.onyx, 19_do_blocks.onyx, 20_auto_return.onyx, 21_quick_functions.onyx and 22_interfaces.onyx, with a 50_misc.onyx at the end for everything else. The README also points at the Onyx Book, which it calls the official source of language syntax and semantics documentation, alongside the online documentation and the playground. Taken together, a newcomer has three routes in, a book, a documentation site and a set of runnable programs, which is a good sign for a language this young.

A compiler, an interpreter and a runtime in one tree

The top level of the repository shows the three parts of the project. There is a compiler directory, an interpreter directory and a runtime directory, alongside shared code, the core library, a tests directory, an examples directory, a scripts directory and a docs directory. The presence of an interpreter alongside the compiler is the interesting part, because it means the language can be run without a WebAssembly build step, which is what makes quick iteration possible and what makes the example programs easy to try. The build is driven by shell scripts at the top level, build.sh, build.bat and settings.sh, and there is a bin directory for the resulting executables, plus a .githooks directory for the git hook setup. The Windows batch file alongside the Unix shell scripts is a hint about the platform split the project itself acknowledges. Tests live in their own directory rather than beside the code, which is a pattern that suits a compiler with a large test corpus.

Nightly builds are the real release channel

The release history is where the maturity of the project shows. The most recent tagged build is a nightly release, Onyx Nightly Release 20260221, published on 2026-02-21, and before that come v0.1.13-beta from 2024-11-09 and v0.1.12-beta from 2024-05-20. So the version line has been in the 0.1 range with beta tags for a while, and the nightlies are the channel that actually moves. Anyone pinning a version should be aware of what they are pinning. The repository is not archived and the last push was on 2026-10-09, so the work continues between releases, and the CHANGELOG file at the top level is where the movement is recorded. The licence is BSD-2-Clause, which is a permissive licence with the attribution clause, and the project also ships a CODE_OF_CONDUCT.md and a CONTRIBUTING.md, so it is set up as a community project rather than a single person's script.

Windows exists, but the project says where it hurts

The disclaimer at the end of the README is short and specific. Onyx is still under active development, and some features are subject to change. And Onyx is primarily developed for Linux and MacOS, with Windows support existing but the development experience there not as refined as on Linux and macOS. That is a useful thing for a project to say plainly. For an adopter it means two things. If you develop on Linux or macOS, the tooling, the scripts and the community support are aimed at you. If your team is on Windows, the language is usable but you should expect to spend time on the environment, which is exactly the cost the project is warning about. The installation guide is published for all three systems, so the compiler is available everywhere, and the playground lets you try the language from a browser without setting anything up at all.

Where Onyx is the wrong tool

The clearest case against is a product that needs to ship as more than one kind of binary. A language that targets only WebAssembly forces a choice: either the whole product is a web application, or the parts that must run natively are written in something else, and then you maintain two languages, two type systems and two sets of tests for one product. The second case is a team that needs a stable specification today. A compiler in the 0.1 range with beta tags and a disclaimer that features are subject to change is a fine thing to experiment with and a poor thing to base a long lived codebase on, because the migration cost arrives later and the language is where you have the least appetite for churn. The alternative approach, and the one most established languages take, is to keep a native backend alongside a WebAssembly one so the same source can produce a desktop build and a web build, and to treat the language specification as something that only changes slowly.

Editorial conclusion

Adopt Onyx if you are shipping something into a browser and want a language whose only target is WebAssembly, so there is no native backend to maintain and no cross compilation to reason about, and if you are willing to work with a compiler that is still in the 0.1 range with beta tags. Do not adopt it if you need a native executable, a mobile target or a stable language specification, because WebAssembly is the only destination and the project states that some features are subject to change. Before you commit, try the playground to see whether the syntax fits your taste, read the book for the semantics, and check the CHANGELOG and the nightly release notes to see how quickly the language is still moving.

Frequently asked questions

What does the Onyx compiler target?

Onyx compiles solely to WebAssembly through a custom backend, which the README credits with very fast build times. There is no native backend, so a program written in Onyx is a WebAssembly program, and the repository also ships an interpreter for running code without a WebAssembly build step.

How do I install Onyx and try it out?

The installation guide is published on the project site for Linux, MacOS and Windows, and the build is driven by the scripts at the top of the repository, build.sh, build.bat and settings.sh. There is also an online playground at try.onyxlang.io for trying the language without installing anything.

Where is the official Onyx documentation?

The README points at the Onyx Book as the official source of language syntax and semantics documentation, alongside the documentation site at onyxlang.io/docs covering language semantics, syntax, the core and third-party packages, and a separate installation guide.

Is Onyx ready for production use?

The README states that Onyx is still under active development and that some features are subject to change, and it says the project is primarily developed for Linux and MacOS with a less refined development experience on Windows. The newest tagged build is a nightly release from 2026-02-21, with the last beta release being v0.1.13.

What language features does Onyx support?

The examples directory walks through them in order, covering variables, arrays, slices, structs, enums, loops, switch statements, maps, varargs, the use keyword, overloaded and polymorphic procedures, the pipe operator, operator overloading, macros, do blocks, auto return, quick functions and interfaces. The README example also shows iterator pipelines, sorting and grouping by key.

Official sources

  1. License: BSD-2-Clause
  2. onyx-lang/onyx on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/onyx-lang-onyx.svg)](https://hysenlabs.com/projects/onyx-lang-onyx)

Was this useful?