Ultra-portable · Embeddable · Statically typed

One package, 8 host languages.

Kio is a statically typed, embeddable programming language. Write a package once, then transpile it to the host language or load it dynamically into the host of your choice.

curl -fsSL https://jdevuyst.github.io/kio/install.sh | sh

Portable

One package compiles to 8 host languages. Kio emits code in the host's own language — no separate runtime to ship.

Hosted

Kio packages are components, not standalone programs. The host supplies the package's capabilities and decides which exposed entries to call.

Typed

Kio is statically typed, including its declared host interfaces. Host implementations must honor those interfaces.

Portability

Write it once. Host it anywhere.

A package declares its build targets, and Kio emits idiomatic code for each one. The same source runs inside JavaScript, Python, Rust, and more — compiled ahead of time and linked in, or loaded dynamically.

There is no ambient runtime and no hidden I/O. The host provides the numerics, strings, and effects your package uses, so what ships is just your logic.

hello.pkg.kio
package hello;

build {
  cache "out/.kio-cache/";

  target js {
    out "out/js/"
  };

  target rust {
    out "out/rust/"
  }
}

bridge {
  hello
}

The interface

A typed contract with the host.

A package names the host types and functions it needs, and the typed entries it exposes back. The host reads that contract, supplies the implementations, and calls the entries it wants.

Because the contract is statically typed, Kio checks your package against it at compile time.

The contract is versioned, too: kio sig records it and classifies every change as compatible or breaking before it ships.

hello.kio
module hello;

host type String role(str);

host fn print(str: String) -> .;

pub fn main() -> . { print("hello from Kio\n") }

The language

A small surface that composes.

A small core. Even control structures are library-defined.

Library-defined control

if! ok { yes() } else { no() }

Import elaborators like any other name. They generate typed code at compile time: reorder_prod!((a, b), B & A) reorders a product to match the requested type, and familiar control forms such as if! and match! are library-defined too.

Structural products & sums

A & B · A | B

Compose types directly with & and |, and pattern-match on them. Row-typed records and variants emerge from the same primitives.

UFCS

r.>f(x)

Call any function receiver-first: r.>f(x) is exactly f(r, x). Four variants: .> .>> .< .<<.

User-defined operators

op _ ? _ : __ { … }

Every operator is yours to define — from prefix, infix, postfix, and n-ary to bracketed variadic forms for lists and dicts.

Provable equivalence

equiv { … }

Assert that two expressions reduce to the same normal form — the compiler proves it, decidably and exhaustively, running nothing.

Library-defined sequencing

do! bind { … }

Each let x <- action; step sequences actions with the bind function you supply. do! is imported library code.

The core — guarantees, not vibes

A small core with strong guarantees.

Kio elaborates down to a compact, well-understood core. That is where the language's formal promises live.

Sound, decidable types

Type checking always terminates and catches type errors in Kio code before execution.

Strongly normalizing core

Kio elaborates to Kio', a small core based on polymorphic lambda calculus with higher-kinded types and rank-N polymorphism, where every well-typed program reduces to a normal form.

Open-world compilation

Adding declarations to module bodies never breaks or changes the meaning of existing dependent code.

The tooling — fast feedback

Tooling that keeps up with you.

Kio is built for a tight loop: a fast typechecker with clear diagnostics, quick builds, and editor support that catches mistakes before you run anything.

  • Fast buildsParallel compilation, cached across runs.
  • Clear diagnosticsPrecise errors with source context, right in your editor.
  • Editor toolingAn LSP, a tree-sitter grammar, and a VS Code extension.

The REPL — live

Try Kio in your browser.

Browse packages, inspect types, normalize expressions — it all runs in your browser, no server.

Host languages

Runs in 8 host languages.

Pick a host to see how Kio packages plug in.

Ready to dig in?

Install it in one line, or read up on it first.

curl -fsSL https://jdevuyst.github.io/kio/install.sh | sh