Platform Support and Limitations

The shared runtime, compiler and standard libraries behave identically on every target. What differs is what the host can provide, and Luak reports those gaps the way Lua does, returning nil plus a message or raising an ordinary Lua error, rather than omitting functions silently.

Capability JVM Kotlin/Native JavaScript / Wasm-JS Wasm-WASI
Files (io.open, io.lines, os.remove, os.rename) Yes Yes, POSIX stdio Yes under Node; unavailable in a browser Yes, limited to directories the host pre-opens
Script lookup (require, dofile) Filesystem, then classpath Filesystem Filesystem under Node Pre-opened directories
os.getenv Environment, then system properties getenv process.env under Node WASI environ_get
io.popen, os.execute Yes No, no portable process API No No
package.loadlib Yes No No No
Weak tables (__mode) Yes Yes No, no weak references in the host No
os.date / os.time UTC UTC UTC UTC

Where a host grants no filesystem at all, io.open returns nil and a message and the rest of the library keeps working. io.popen behaves the same way outside luak-jvm.

Targets

Target Gradle target function Tested on
JavaScript IR js { nodejs() } Node.js
WebAssembly wasmJs { nodejs() } Node.js
WebAssembly (WASI) wasmWasi { nodejs() } Node.js's experimental node:wasi
Kotlin/Native linuxX64(), mingwX64(), macosX64(), macosArm64() Matching CI runners per target