Menu

Kotlin.
On unfamiliar ground.
Familiar Kotlin. Native Solana programs.
An experimental compiler with output you can inspect.
Code you know.
Output you can inspect.
Start with familiar Kotlin. Koral checks a supported subset, emits inspectable C, and builds a native SBF program with Clang and the Agave SDK. The current preview supports Counter and limited owned ULong state. Use the local CLI to build and verify behavior.
Inspect the Kotlin source
package example
import dev.koral.api.*
@Account("counter")
data class Counter(val count: ULong)
@Instruction
fun increment(state: Counter, by: ULong): Counter =
Counter(checkedAdd(state.count, by))
Download typed-counter.kt ↗Compare recorded execution
One Counter.
Three implementations.
Recorded local compute units. Same inputs, addresses, and final 49-byte state. Lower CU uses less computation.
| Instruction | Native Rust | Pinocchio | Koral |
|---|---|---|---|
| initialize | 4,601 | 3,186 | 3,366 |
| increment | 857 | 113 | 107 |
One initialization and 20 increments. Agave 3.1.10 / platform-tools 1.52. Koral initialization currently trails Pinocchio. Counter measurements do not establish DEX performance; CU and account storage deposits are separate.
Download measurement snapshot ↗From source
to native.
A 15-second introduction to Koral.
Familiar source. Inspectable output.
Experimental Kotlin compiler · Recorded source example · Local execution
Build and run locally
Requires a development checkout, JDK 17, Node 22.12+, and an installed Agave SBF SDK. Browser compilation will be connected later.
./gradlew test :cli:installDist
export KORAL_SBF_SDK=/path/to/sbf
cli/build/install/koral/bin/koral build \
examples/typed-counter.kt --out build/counter
npm ci --prefix cli/build/install/koral/testing
cli/build/install/koral/bin/koral test \
build/counter/counter.soExplore Koral