Kotlin v0 kernel

Compile to native

A closed Double/Boolean kernel compiled to native via the shared ZTIR + LLVM spine — no kotlinc, Gradle, or JVM on the compile path.

182×

faster than Gradle

140×

smaller binary

Numbers

Real, reproducible benchmarks. Run them yourself.

Kotlin: zlow native + zig cc vs. ./gradlew linkReleaseExecutable

zlow
177 ms
gradle
32,223 ms
100 ms1 s10 s
Square-root scale, interleaved rounds — 177 ms and 32.2 s share no readable linear axis.

Kotlin/Native 2.1.20, Gradle 8.13, cold daemon. 53/53 fixtures agree with pinned Kotlin/Native (8 kernels compared by computed value, 45 out-of-profile constructs refused by name) — tools/compare-kotlin-native.sh.

kernel-app — release build output
zlow-kernel (zig cc -O2 -s)
3.6 KB
gradle-native-kernel-bench.kexe
497.0 KB
Same kernel source, both tools’ own release config: zig cc -O2 -s vs. Kotlin/Native’s linkReleaseExecutableLinuxX64 — both stripped (0 debug sections), both compute the same value.

API

Every command below is real: run it against the repo yourself.

zlow native . # zlow.json in the current dir
zlow native src/main.kt --emit-llvm out.ll

zlow.json: { "language": "kotlin", "entry": "src/main.kt" }. Accepted: Double/Boolean top-level fun,val/var, if/while, arithmetic, calls between functions in the unit. Everything else is a named refusal.

zig build

No silent wrongness: a construct zlow cannot honour is a named, located error with nothing written — never output that merely looks right. Full accepted-subset and refusal table: native-profile-v0.md.