Skip to content

Kio documentation

Learn Kio here — tutorials to get started, topic guides for specific tasks, case studies of complete packages, and host guides for embedding Kio in a runtime. For the precise contracts, see specs/.

Tutorials

New to Kio? Start here — these read top to bottom.

  • The Kio language — a guided tour: packages, modules, functions, types, tuples and labels, sums and pattern matching, polymorphism, elaborator calls, and structural glue.
  • Getting started with the tooling — one full lap of the dev loop on a tiny package: kio init, fmt, check, test, build, and sealing the contract surface with kio sig.
  • Filling a shared match! result — start with an explicit target, diagnose disagreeing clauses, and then infer the same common result in either clause order.

For exact command-line behavior, see specs/cli.md.

Guides

Once you know the basics, choose the task below. Ordinary source starts with the language guides; compiler pseudo-modules are a reference for elaborator authors, not the starting point for products and sums.

Writing the language

Packages and libraries

  • Package files and bridges — host contracts, targets, dependencies, materialization, rehosting, and retyping.
  • Using libraries — the local/Git workflow, re-rooted imports, and the reusable repository libraries.
  • Dynamic loading — emitting, loading, contract-matching, instantiating, and calling a Kio' package at runtime.

Testing, documentation, and debugging

Compiler-facing material

  • Defining elaborators — the checked-term ABI, reflection, captures, diagnostics, and total compile-time recursion.
  • Builtin modules — generated exhaustive reference for __intrinsics__ and __comptime__.
  • The open-world story — what open-world compilation means for imports, inference, and elaborator design.

Tooling

Case studies

End-to-end read-throughs of the runnable proof-of-concept packages under test-data/poc/. Everything a page shows is real code from the package itself — checked and run on every CI run, never simplified for the page. Read one when you want the whole picture of how a body of Kio fits together, not just the slice a topic guide isolates.

Host integrations

How to embed a Kio package in each supported host.

  • JavaScript — building with the js backend and calling into the package from JS.
  • TypeScript — building with the ts backend (the JS .js plus a generated .d.ts typed skin) and calling into the package from TypeScript.
  • Python — building with the python backend and calling into the package from Python.
  • Java — building with the java backend and calling into the package from Java.
  • Rust — building with the rust backend and calling into the package from Rust.
  • Go — building with the go backend and calling into the package from Go.
  • Swift — building with the swift backend and calling into the package from Swift.
  • Haskell — building with the haskell backend and calling into the package from Haskell.

Snippets

Kio code snippets in these files are written in Kiodoc — GitHub-flavored Markdown plus a small set of fence-attribute directives. kio doc check validates the snippets, kio doc fmt --check gates their canonical formatting in CI, and kio doc build renders this tree, together with each module's /// doc-comments, into a per-module documentation site.