Research language · incomplete
Tensors that already know their shape.
Kina is a research language for typed tensor programs. The bootstrap compiler is OCaml; it checks dtype, shape, and placement with Z3 and emits textual MLIR. A Rust runtime and a Lean 4 track sit beside it. The language is not finished: you can compile tensor graphs, including a tiny causal-attention forward pass, but you cannot yet train or serve a language model in Kina.
let logits = fn(
token_ids: tensor<I64, [1, 4], @host>,
token_embedding: tensor<F32, [8, 4], @host>,
wq: tensor<F32, [4, 4], @host>
) -> tensor<F32, [1, 4, 4], @host> {
let x = token_embedding.gather(token_ids) in
let q = x @ wq.broadcast([1, 4, 4]) in
q
}Map
Start from what is wired
Specs are contracts. These pages say what the tree actually does.
Status
What the compiler, runtime, and site actually do today.
Learn
Companions beside the spec. They are tutorials, not the language contract.
Specification
Phase 0 calculus and later-phase contracts. Spec complete ≠ implemented.
Compiler API
Module map for the OCaml bootstrap. odoc HTML is generated locally.
Programs
Featured compiler examples
These are accepted .kina files with MLIR goldens. They are not a standard library or a trained model.