Nyx compiles to native code through LLVM, hosts its own compiler, and speaks a machine-readable dialect that AI agents can write, read and fix. Reliable by design — not by convention.
// A taste of Nyx — enums with data, exhaustive pattern matching, // compiled to a native binary via LLVM. enum Shape { Rect(int, int), Circle(int) } fn area(s: Shape) -> int { return match s { Shape.Rect(w, h) => w * h, Shape.Circle(r) => 3 * r * r } } fn main() { let shapes: Array<Shape> = [ Shape.Rect(3, 4), Shape.Circle(5), Shape.Rect(6, 2) ] var total: int = 0 var i: int = 0 while i < shapes.length() { total = total + area(shapes[i]) i = i + 1 } print("shapes: " + int_to_string(shapes.length())) print("total area: " + int_to_string(total)) }
$ nyx run -> building hero v0.1.0 compiling src/main.nx shapes: 3 total area: 99
The compiler is written in Nyx and compiles itself — recompiling yields byte-identical IR, verified every release. Output is native code via LLVM, at or above C on compute.
Machine-readable diagnostics (NYX_DIAG=json, stable codes, line:column, fix hints), auto-generated AGENTS.md / CAPABILITIES.md, and on-device LLM inference via std/llm.
A web framework, a Redis-compatible store, a reverse proxy, a terminal editor — all written in Nyx. Everything serving this site is one of them.
Every diagnostic is one line of JSON with a stable code, exact location, and a fix hint — in the parse and semantic phases, bilingual. No scraping stderr, no guessing.
$ NYX_DIAG=json nyx build {"phase":"semantic","code":"NYX1005","line":12,"col":18, "message":"argument 2 of 'indexOf' must be int, got String", "hint":"pass a byte offset, e.g. s.indexOf(needle, 0)"}
Each of these is a separate product, written entirely in Nyx, running in production behind this domain.
Install the toolchain, create a project, run it. No runtime to install on your servers — the compiler produces one static binary.
$ curl -sSf https://nyxlang.com/install.sh | sh
Linux (x86_64, ARM64) · requires Clang · verify: nyx --version → nyx 0.22.0
$ nyx init my-app $ cd my-app && nyx run my-app starting…
The Book covers the language end to end; By Example has 100 runnable recipes. The package manager, dependencies and full command reference live there.
Nyx is Apache 2.0. The compiler, runtime, standard library and every product above are on GitHub — read the code, file an issue, send a patch.