Kairo is a modern systems programming language. The raw power of C++. The ergonomics of modern design. Zero compromises on performance.
import std::Parallel;
fn <T: Numeric> dot(a: [T], b: [T]) -> T! {
if a.len() != b.len() {
return error("Length mismatch");
}
return Parallel::zip(a, b)
.map(|(x, y)| x * y)
.sum();
}
fn main() {
let a = [1.0, 2.0, 3.0];
let b = [4.0, 5.0, 6.0];
let result = dot(a, b)!;
print(f"Dot product: {result}");
} Join the small but growing community of systems programmers who refuse to compromise on performance or ergonomics.