Statically typed Expression-oriented Self-hosted

Write it like a script, ship it as a binary.

Native for LLM agents, desktop and mobile apps out of the box, and a native binary measured against Go — on a language with generics, traits, pattern matching and multicore actors: errors as values, no null, no exceptions.

enum Tree { Leaf, Node(Tree, int, Tree) }

fn sum(t: Tree) -> int {
    match (t) {
        Tree.Leaf => 0,
        Tree.Node(l, v, r) => sum(l) + v + sum(r),
    }
}

fn main() {
    let t = Tree.Node(Tree.Node(Tree.Leaf, 1, Tree.Leaf), 2, Tree.Leaf);
    print(sum(t));    // 3
}

Install it in a minute

A single binary, no dependencies: the installer detects your platform (macOS, Linux and Windows, arm64 and x86_64), downloads the release and leaves ray in ~/.local/bin — or in %LOCALAPPDATA%\Programs\raylang\bin from PowerShell, already on your PATH.

1

Install the toolchain

macOS and Linux:

$curl -sSfL https://raylang.dev/install.sh | sh

Windows, from PowerShell:

>irm https://raylang.dev/install.ps1 | iex

Check it with ray version — one binary, everything included: compiler, VM, LSP, formatter and package manager.

2

Create and run your first project

$ray new hola && cd hola && ray run

ray new leaves a ray.toml + src/main.ray; ray dev recompiles and restarts on save.

Then, the handbook: install, the language in fifteen minutes, concurrency and the tools, and from there one guide per kind of app.

Native for LLM agents

raylang ships the two pieces a model needs to write correct raylang — and verify it on its own.

  • llms.txt — the distilled context: the delta against Rust, the canonical forms and the exact error messages, ready for your prompt or CLAUDE.md.
  • ray mcp — an MCP server embedded in the binary: the write → check → fix loop with the compiler's exact diagnostics and the model's code sandboxed (fuel + heap + deadline, in a subprocess).
  • llms.txt itself is served as a resource (raylang://llms.txt) — the client injects it before the first line. Full guide in docs/mcp.en.md.
  • And to write agents: the handbook builds one in raylang that talks to Claude and uses tools over MCP — LLMs and MCP.
mcp
$ claude mcp add raylang -- ray mcp

# tools
ray_check   exact, positioned diagnostics
ray_run     stdout + exit, sandboxed
ray_test    the @test runner
ray_fmt     canonical source
ray_doc     stdlib signature + doc

# resource
raylang://llms.txt

Desktop and mobile, out of the box

The same raylang source runs as a desktop app on macOS, Linux and Windows and as a mobile app on iPhone and Android — no external framework, no second language. The interface is HTML in the system webview (std/ui), the backend is your raylang web server, and the JS ↔ raylang bridge, native menus, file dialogs, audio and the assets baked into the binary ship with the toolchain.

macOSray bundle produces the .app with icon, application menu, About panel and ad-hoc signature (the distribution one is yours to add).
Linuxthe same command leaves the binary with its .desktop launcher; window and webview on GTK/WebKitGTK.
Windowsthe same command leaves the desktop .exe (no console on double-click, embedded icon and version) with its shortcut; window and webview on Win32/WebView2, audio through WASAPI.
iOSray bundle --ios generates the Xcode project with the program compiled to a static library; persistent signing for device and simulator.
Androidray bundle --android generates the Gradle project with the native .so, launcher icon and release signing; audio through AAudio.
ray bundle · .app / .desktop / .exe ray bundle --ios · Xcode project ray bundle --android · Gradle project

Step-by-step guide in the handbook: mobile app for iOS and Android, from ray new to the simulator, the emulator and hot reload on the phone.

In your editor

Official extensions on top of the raylang LSP: live diagnostics, completion, hover, go to definition, rename and formatting.

The Zed extension is submitted to the official gallery and awaiting approval: zed-industries/extensions #7361.

Try it in the browser

The full VM compiled to WebAssembly — the playground runs raylang in your browser, with no server and nothing to install.

Scope: it runs the whole language and the pure stdlib through import std/* (math, json, markdown, iterators, actors/channels…). The stdlib with I/O (fs, process, networking) compiles but returns Err at run time — the browser has no disk and no sockets. Registry packages (net, web, rpc, db…) and multi-file modules do not resolve here: for those, install ray and use ray add.

Open the playground full screen →

Measured, not promised

The native binary goes head to head with Go and rustc -O, and beats node in 9 of the 10 compute programs of the polyglot bench. The bars come from the repository's real table — re-measuring the bench regenerates this chart. The VM column is measured with a PGO build of the toolchain (make pgo); the published release is a plain build and runs 10–26% slower on pure compute in the VM — the native binary is unaffected. How to build it.

loopsum 29.9 ms

raylang1.00×
rustc -O1.00×
go1.00×
node9.01×

fibrec 19.5 ms

raylang1.00×
rustc -O0.81×
go0.89×
node2.10×

wordcount 40.3 ms

raylang1.00×
rustc -O1.55×
go1.18×
node3.22×

jsonserialize 32.1 ms

raylang1.00×
rustc -O0.88×
go0.90×
node2.35×

jsondeserialize 79.2 ms

raylang1.00×
rustc -O0.63×
go0.59×
node1.22×

logparse 23.9 ms

raylang1.00×
rustc -O1.36×
go1.00×
node2.17×

treealloc 19.6 ms

raylang1.00×
rustc -O1.47×
go1.56×
node1.12×

sortnums 20.6 ms

raylang1.00×
rustc -O1.18×
go3.85×
node22.68×

matrixmul 6.5 ms

raylang1.00×
rustc -O0.99×
go1.33×
node4.05×

regex 68.4 ms

raylang1.00×
rustc -O0.40×
go1.19×
node0.97×

Resultados (22 sep 2026 — M3 Pro, mediana de 10 corridas, 5 de calentamiento) · el mismo output en todas las variantes, verificado por checksum · barra más larga = más lento que el binario nativo de raylang (1×), truncada en 4×.

See the full benchmarks

≡

Three engines that agree

A bytecode VM to develop, a native binary to deploy and an interpreter as the oracle — byte-for-byte identical output, verified in CI.

»

Native binary

ray build --native transpiles to Rust and compiles an executable: 2.6–4× the VM on service workloads and 14–28× on pure compute.

⇄

Actor concurrency

An isolated heap per fiber + ownership transfer on send: real multicore without data races, on an M:N scheduler.

?

Errors as values

No null and no exceptions: Result/Option + ?, exhaustive pattern matching and generics with traits.

⌘

Complete tooling

ray brings projects, packages, tests, formatter, docs, REPL, an LSP for your editor and an MCP server for LLM agents.

◇

Deliberate dependencies

HTTP/1.1 and 2, JSON, TOML, DNS, WebSocket and the database clients are written in raylang; every Cargo crate enters justified and measured.

∞

Self-hosted

raylang lexes, parses, checks and runs raylang: the self-hosted compiler runs itself on top of the self-hosted engines.

/

Web framework

A production HTTP server with an Express-style framework, SSR with compiled, typed templates (.ray.html), WebSocket and streaming.

✓

Verifiable packages

ray.toml manifest + lockfile with SHA-256 hashes; the registry accepts Ed25519-signed versions and claimed names.

Built with raylang

An LLM coding agent, a desktop app, servers and tools — real dogfood, published in the organization.

The libraries too: the networking and formats stack (net — HTTP/1.1 and 2, DNS, WebSocket, TLS —, web, rpc, db — Postgres, Redis, SQLite) lives in packages/, written in raylang (TLS and SQLite come from the runtime's rustls/rusqlite), and community packages are published in the registry with hashes and signatures.

Manta, the raylang mascot

raylang flows without friction

One source, three engines: the same program runs the same — byte for byte — in development, in deployment and under the validation oracle.

ray run · bytecode VM ray build --native · machine binary --interp · the oracle