A small language, rebuilt without compromise
Lua has quietly run games, tools and embedded systems for three decades. Luak reimplements it from scratch on Kotlin Multiplatform: one engine for JVM, Native, JS and Wasm, behind a single embedding API.
import org.basaltmc.luak.lib.LuaPlatform
val globals = LuaPlatform.standardGlobals()
globals.load("print('hello, world')")!!.call()
local co = coroutine.create(function(a, b)
print("start", a, b)
local c = coroutine.yield(a + b)
print("resume", c)
end)
print(coroutine.resume(co, 1, 2))
print(coroutine.resume(co, 10))
What is Lua
Lua is a small, fast scripting language born in 1993 at PUC-Rio. It powers the scripting layer of countless games and game engines, embedded devices, network tools and configuration formats, prized for a tiny footprint, a simple C API, and a syntax that stays out of your way.
What is Luak
Luak is a Basalt project: Lua reimplemented from scratch on Kotlin Multiplatform. Not a fork, not a binding over the reference C interpreter, a fresh runtime that carries Lua's full feature set to every target Kotlin reaches, behind one embedding API.
Built for depth, not just a demo
What Luak actually gets you, target by target.
Always the current Lua
Tables, metatables, functions and coroutines, plus the full standard library: base, package, table, string, coroutine, math, utf8, io and os. Kept current with upstream Lua, not stuck on an old release like some runtimes.
One runtime, every target
JVM 17+, JS on Node, Wasm on Node (WasmJS and WASI), and Kotlin/Native for Linux x64, Windows x64, macOS x64 and macOS ARM64.
A real io library everywhere
io.open, io.lines, io.tmpfile, file handles, os.remove, os.rename: shared across every target, not bolted onto the JVM alone.
Deep JVM integration
luajava, javax.script, the luajc JIT compiler and CLI tooling, all available the moment you add luak-jvm.
Honest about the host
Where a target cannot provide a capability, a browser has no filesystem, Native has no portable process API, Luak reports it the way Lua does: nil plus a message, never a silent omission.
A small, auditable host surface
Everything platform-specific is confined to a dozen expect/actual functions. The value model, compiler and all nine standard libraries are shared Kotlin.
One runtime, every Kotlin target
Write embedding code once. Ship it wherever Kotlin Multiplatform reaches.
Documentation and guides
Everything you need to go from install to production.
Getting Started
Add the Gradle or Maven dependency and run your first script.
Standard Library
Base, package, string, table, math, coroutine, os, io and bit32, documented in full.
Embedding Guide
LuaPlatform.standardGlobals() on every target, plus luajava and javax.script on the JVM.
Platform Support and Limitations
What changes target to target: files, require, environment variables, weak tables.
Get started
Releases publish to our public Maven repository. No authentication needed.
repositories {
maven("https://repo.basaltmc.org/releases")
}
dependencies {
implementation("org.basaltmc:luak-jvm:26.5")
}
repositories {
maven("https://repo.basaltmc.org/releases")
}
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("org.basaltmc:luak-core:26.5")
}
}
}
}
<repository>
<id>basaltmc</id>
<url>https://repo.basaltmc.org/releases</url>
</repository>
<dependency>
<groupId>org.basaltmc</groupId>
<artifactId>luak-jvm</artifactId>
<version>26.5</version>
</dependency>