Kale Compiler
Reference PythonKale & LLVM Native Compiler
The official Kale compiler transforms high-level syntax into pristine, highly-optimized LLVM IR. Features stack array literals, struct-by-value passing, IEEE 754 float arithmetic (f32/f64), dynamic library linking (-l/-L), and direct AOT binary emission via Clang/LLD.

Zero-Overhead Foreign Function Interface
Kale links directly against native C dynamic libraries with no runtime marshaling wrapper. Functions declared with extern symbols resolve directly through the platform loader (kernel32, user32, opengl32, glfw3, sqlite3).

// Stack array literals, float math, and external linking
import "packages/std/io/file.kl" as file;
struct Vector3 {
x: f32,
y: f32,
z: f32,
}
fn length(v: Vector3) -> f32 {
let sum: f32 = (v.x * v.x) + (v.y * v.y) + (v.z * v.z);
return sqrtf(sum);
}
fn main() -> int32 {
let vertices: [f32; 4] = [0.0, 1.0, 0.5, -0.5];
let pos: Vector3 = Vector3 { x: 1.5, y: 2.5, z: 3.0 };
return 0;
}Deterministic command-line invocations to build, link native dynamic dependencies, and run automated regression tests:
python -m kale.cli build main.kl -o bin/app.exepython -m kale.cli emit-ir main.kl -o bin/app.llpython -m pytest tests/test_compiler.pyGPG Key 1B917D4779A6102E • Continuous integration with automated symbol verification.
Zero-overhead type translation with direct mapping to LLVM primitive types, pointer types, and memory layout.
Supports seamless FFI binding with -l and -L flags linking against Windows Win32, GLFW3, OpenGL, and SQLite3.
Enables zero-heap allocation patterns and ergonomic data transfer for graphics and systems programming.