v0.1.0-alpha  ·  Open Source  ·  Systems Language

Control everything. Compromise nothing.

C++ can #include a .kro file. Kairo can call any C++ library with zero bindings. The boundary doesn't exist.

STAGE(1) WRITTEN IN KAIRO IN PROGRESS | STAGE(0) WRITTEN IN C++
dot_product.kairo kairo
import std::Parallel
import std::Error::DimensionError
import std::Interfaces::Numeric

fn <T impl Numeric> dot(a: [T], b: [T]) -> T {
    if a.length() != b.length() {
        panic DimensionError("dot requires equal lengths")
    }

    var result = Parallel::reduce(
        policy:  Parallel::Policy::SIMD,
        range:   0..(a.length()),
        init:    0 as T,
        step:    fn (i: usize)   -> T = a[i] * b[i],
        combine: fn (x: T, y: T) -> T = x + y
    )

    return result ?? 0
}

test "dot product of two vectors" {
    var a, b = [1, 2, 3, 4, 5], [6, 7, 8, 9, 10]
    var result = dot(a, b)
    assert result == 130, f"excepted 130, got {result}"
}
0+
GitHub Stars
0+
Weekly Downloads
0
Contributors
0
Forks

See it in action.
Clean syntax.
No magic.

hello.kro kro
import std  // import only what you need, nothing more

// No main() required top-level code runs immediately
// or is callable when imported as a module.
const name  = "Kairo"
var   count = 0

for i in 0..5 {
    std::print(f"Hello, {name}! Count is {count}.")
    count++
}

std::print(f"Ran {count} times.")

See it in action.
Clean syntax.
No magic.

Readable from day one

  • Type inference Write var count = 0 the compiler knows it's an integer. Annotate when you want to, not because you have to.
  • String interpolation f"" strings let you embed expressions directly. No concatenation, no format specifiers.
  • Top-level code Skip the main() boilerplate. Code at the top level runs on execution and can still be imported as a module.

Get Kairo in
seconds.

One command gets you the compiler, formatter, LSP, and package manager. No separate installs, no configuration.

Alpha Written in C++, being rewritten in Kairo. APIs may change.
Full Install Guide
Quick install
$ curl -fsSL https://kairolang.org/install.sh | bash
From source
$ git clone https://github.com/kairolang/kairo-lang.git && cd kairo-lang && xmake build -j8
SYS::READY -- KAIRO v0.1.0-alpha -- KSF OPEN SOURCE

The source
is open.

Compiler, standard library, and toolchain are on GitHub. Apache 2.0 with runtime exception.