Introduction to Nyx
Nyx is a modern, safe, and productive programming language that unifies web, mobile, and desktop development. Write one codebase and compile it to native binaries, WebAssembly, iOS, or Android — all from the same tools.
Named after Nyx, the primordial Greek goddess of the night — calm, powerful, and encompassing everything.
What's Broken in Today's Languages?
| Language | Pain Point |
|---|---|
| PHP | Inconsistent stdlib, poor concurrency, weak typing |
| Python | GIL kills parallelism, slow CPU performance, packaging nightmares |
| Lua | Tiny stdlib, no native async/await, ecosystem fragmentation |
| JavaScript | Framework churn, single-threaded, runtime dependency on Node/Deno |
| General | Different languages for web (JS), mobile (Swift/Kotlin), desktop (C#/Electron) |
Nyx's Core Design Philosophy
"One language, all platforms. Predictable performance, delightful ergonomics."
- True cross-platform by default — Compiles natively to machine code, WebAssembly, and mobile targets via LLVM/MLIR.
- Gradual, sound typing — Full type inference. Write fast scripts without types, then harden them later.
- Fearless concurrency & parallelism — Structured concurrency with compile-time data race prevention.
- Batteries-included but not bloated — Rich stdlib covering HTTP, GUI, databases, ML — all tree-shakeable.
- Deploy as a single binary — No interpreter, no virtualenv, no Docker needed.
Quick Example
// main.nyx
fn main() {
std.io.println("Hello from Nyx!")
}
Compile and run:
nyx build
nyx run
Key Features
- Gradual typing with full inference and no
anyescape hatches - No null —
Option<T>forces you to handle absence - Region-based memory management — No GC pauses, no manual free
- Structured concurrency — async/await + nursery pattern
- Skia-powered UI toolkit — Build native-feeling interfaces everywhere
- MLIR-based compiler — Multi-target code generation via LLVM