Nax Logo

Nax ...

A general-purpose system programming language and compiler, designed to build high-performance, safe, and reliable cross-platform software in a concise and elegant way.

import http
import http.client
import co
fn serve():void! {
var app = http.server()
app.get('/hello', fn(http.request_t req, ref<http.response_t> res):void! {
res.send('hello nax')
})
app.listen(8888)
}
fn main() {
go serve()
co.sleep(100)
var resp = client.new().get('http://127.0.0.1:8888/hello').send()
println(resp.status, resp.text())
}
01

Why Nax?

Lightweight & Concise & Natural

Lightweight, concise, consistent syntax design, easy to master and quickly get started

Safe & Reliable

Strong typing, static analysis and compilation, memory safety, typed error handling, easily write safe and reliable software

High Performance

High-performance GC implementation, high-performance shared stack coroutine implementation, libuv-based network IO, runtime implemented in pure C

Hybrid Run Modes

GC and coroutine scheduling in .n files, manual memory management in .x files, calls between the two

02

Benchmarks

Compared with Go, Rust and Node.js in the same environment. Nax is marked in red, and every value axis starts at zero.

100 million C function calls (sqrt)
~73ms
Go ~2,178 ms
Peak memory of 1 million coroutines
~969MB
Go ~2,580 MB
HTTP server
~104,000req/s
Go ~90,000, Node.js ~66,000

HTTP server (req/s)

HTTP server (req/s) (requests per second, higher is better)
LanguageResult
Nax~104,000
Go~90,000
Node.js~66,000

1 million coroutines: creation time

1 million coroutines: creation time (milliseconds, lower is better)
LanguageResult
Nax~559 ms
Go~1,035 ms

1 million coroutines: peak memory

1 million coroutines: peak memory (MB, lower is better)
LanguageResult
Nax~969 MB
Go~2,580 MB

100 million C function calls (sqrt)

100 million C function calls (sqrt) (milliseconds, lower is better)
LanguageResult
Nax~73 ms
Go~2,178 ms

Fibonacci(45)

Fibonacci(45) (seconds, lower is better)
LanguageResult
Rust~1.7 s
Nax~2.4 s
Go~2.4 s
Node.js~6.0 s

Computing π, 1 billion iterations

Computing π, 1 billion iterations (milliseconds, lower is better)
LanguageResult
Nax~512 ms
Go~512 ms
Rust~552 ms
Node.js~850 ms

Environment: Nax v0.7.2, Go 1.25.5, Rust 1.92.0, Node.js v25.2.0, Linux virtual machine (aarch64, Apple M4, 9 cores, 8 GB).The full data and the methods are in the benchmark repository.

03

Features

Built-in Concurrency

Built-in concurrency primitives go, future, channel and select, on shared stack coroutines that switch millions of times per second

gofuturechannelselect

Native Toolchain

Compiles straight to machine code of the target platform without LLVM, with its own assembler and ELF, Mach-O and COFF/PE linkers, and supports cross-compilation

linux_amd64linux_arm64linux_riscv64darwin_amd64darwin_arm64windows_amd64

Zero-Overhead C FFI

Call C standard library functions without any performance loss, and link static libraries built by any language

import libc
fn main() {
f64 r = libc.sqrt(144.0)
println(r) // 12.000000
}

Type System and Tooling

A complete type system with generics, enum, tagged union, interface, nullable(?) and errable(!). The npkg package manager, editor LSP support, nax fmt, and tests written directly in source files

genericsenumtagged unioninterfacenullable(?)errable(!)npkglspnax fmttest
04

Perfect For

01

Server Applications

API, command line, MCP services, network middleware

02

Systems Programming

Operating systems, IoT, container systems

03

Game Development

Game engines and game development

04

Explore Possibilities

Databases, programming education, GUI, computer science ...

Projects Built with Nax