Simple code.
Native executables.
Caju is a simple, statically typed language that compiles straight to x86-64 machine code, producing native executables for Linux and Windows, and to WebAssembly. The compiler is written in Caju and compiles itself, and it ships with a test runner and a package manager.
curl -fsSL https://raw.githubusercontent.com/cajulang/cajulang/main/install.sh | shfn greet(name: str) -> str { return "Hello, " + name + "!"} print(greet("world"))Simple to write, native to run
A lean syntax with optional types. The compiler produces a small static binary, with no runtime to install.
See it in code
Two short programs, with the output they print. There are more on the examples page.
Errors are values
The function returns the result and an error, with no hidden exceptions.
fn divide(a: int, b: int) -> (int, error) { if b == 0 { return 0, errors.New("division by zero") } return a / b, nil} for _, d := range []int{5, 0} { q, err := divide(10, d) if err != nil { print("error:", err) continue } print("10 /", d, "=", q)}Structs, methods and interfaces
A type satisfies an interface just by having its methods, with nothing to declare.
interface Shape { area() -> num } struct Rect { w: num, h: num }struct Circle { r: num } fn (r: Rect) area() -> num { return r.w * r.h }fn (c: Circle) area() -> num { return 3.14159 * c.r * c.r } shapes := []Shape{Rect{2, 3}, Circle{1}}for _, s := range shapes { print(s.area()) }Side by side with Go, Rust and Python
The same algorithms, with the same order of operations, in each language. Caju beats or ties Go on every challenge, stays close to Rust and is far ahead of Python.
Measured in November 2026 on an AMD Ryzen 7 5700G: best of up to 3 runs, including process startup. Caju 0.3.0, Go 1.27.3, Rust 1.99.1 (opt-level=3), Python 3.12.3. Full programs and results in bench/compare.
HTTP server: Caju + web against Go
The same JSON API written with web, the Caju web framework, with Gin, and with Go's standard net/http. On the same CPUs, Caju serves 1.5 to 2.2 times as many requests per second.
Requests per second with keep-alive (higher is better). The server is pinned to its CPUs and the load generator runs on the others; Ryzen 7 5700G, WSL2. GET /users returns a list of 50 structs; POST /users reads JSON into a struct. The framework: github.com/cajulang/web · Method and all rounds in bench/http
Packages straight from GitHub
caju pkg ships with the language. There is no central server: a package is a GitHub repository with a caju.toml, and its name is what you import.
- DeclareDependencies live in
caju.toml, each with the minimum version the project needs. - ResolveWhen two packages ask for different versions, the highest of the minimums wins. The choice only changes if someone asks for a higher version.
- Lock
caju.lockrecords the version, commit and SHA-256 hash of each package's files. - VerifyBefore compiling,
caju buildandcaju runcheck the hashes. A modified file stops the build.
From code to executable
- Install
curl -fsSL https://raw.githubusercontent.com/cajulang/cajulang/main/install.sh | shLinux x86-64. On Windows, use WSL. - Run
caju run hello.cajuCompiles in memory and runs. - Build the executable
caju build -o hello hello.caju caju build --target windows hello.cajuA binary for Linux and an .exe for Windows.
Compile your first Caju program
In progress in the native compiler: goroutines, channels and select, plus the native features still missing on Windows.