NATIVE · SELF-HOSTING · LEGIBLE TO AI

A language for robust, native software.

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.

Get started curl -sSf nyxlang.com/install.sh | sh
src/main.nx
// 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
Why Nyx

Three things it does well

✦ native

Self-hosting & fast

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.

✦ ai-first

Legible to agents

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.

✦ complete

A whole ecosystem

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.

AI-first, concretely

Errors a model can act on

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)"}
Build it in Nyx

One language, a full stack

Each of these is a separate product, written entirely in Nyx, running in production behind this domain.

nyx-serve
Web framework — routes, JSON, WebSockets, templates, multipart, sessions. One static binary.
nyx-kv
Redis-compatible key-value store — 64 commands, Pub/Sub, resize-stable SCAN, TLS, multi-tenant.
nyx-proxy
HTTPS reverse proxy — TLS with SNI, health checks, LRU cache, Prometheus /metrics, rate limiting.
nyx-edit
Terminal text editor in one Nyx file — live resize, UTF-8, mouse, 1000-level undo, flicker-free.

Try Nyx in the browser playground →

Get started

Zero to running in 30 seconds

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…
Read the Nyx Book Nyx by Example

The Book covers the language end to end; By Example has 100 runnable recipes. The package manager, dependencies and full command reference live there.

Open source

Built in the open

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.

Source on GitHub Changelog