A Kotlin Multiplatform plugin framework powered by Wasmtime, enabling WebAssembly (WASI) plugin loading, packaging, and execution across Android, iOS, Desktop (macOS / Windows / Linux), and, in the future, Web.
Plugins can be developed in any language that compiles to WASI — Kotlin, Rust, C/C++, Go, AssemblyScript, and more.
| Platform | Architecture | Runtime | Status |
|---|---|---|---|
| Android | arm64-v8a | Wasmtime (JNI) | ✅ Supported |
| iOS | arm64 | Wasmtime (C Interop) | ✅ Supported |
| macOS | arm64 | Wasmtime (JNI/Zig) | ✅ Supported |
| Linux | x86_64 | Wasmtime (JNI/Zig) | ✅ Supported |
| Windows | x86_64 | Wasmtime (JNI/Zig) | ✅ Supported |
| Web | wasm32-wasi | Kotlin/Wasi | 🚧 Planned |
Wasmline architecture overview
wasmline-multiplatform/
├── wasmline/ # Core runtime — WASM module loading & execution
├── wasmline-loader/ # Crypto & manifest — Ed25519/ECDSA-P256 signing, manifest serialization
├── wasmline-cli/ # CLI toolchain — build, compile, manifest, download, key generation
├── wasmline-android/ # Android native bindings (CMake / JNI C++)
├── wasmline-kotlin-plugin/# Kotlin compiler plugin — IR-oriented typed glue generation
├── wasmline-gradle-plugin/# Gradle integration for the Kotlin plugin and tooling
├── wasmline-sample/ # Sample applications (plugin, Android, Desktop, Multiplatform Compose)
└── wasmline-build-logic/ # Shared Gradle convention plugins
Dependency flow: wasmline-cli → wasmline-loader → wasmline (core)
- Kotlin Multiplatform with custom source set hierarchy
- Wasmtime 41.0.1 as the underlying WASM runtime
- kotlinx.serialization for JSON and Protobuf payloads
- Ed25519 / ECDSA-P256 for manifest signing and verification
- Clikt for the CLI experience
- AOT compilation —
.wasm→.cwasm/.pwasm - Kotlin compiler plugin (IR phase one) for generated
Definition / Proxy / Adapterglue
- Java 21 or later for general builds; use JBR 21 for Gradle tasks covered by
./.github/skills/wasmline/scripts/skill_preflight.sh(especially Compose Desktop / desktop samples) - Zig 0.15.1 (for native library builds)
- a locally prepared Wasmtime toolchain when building AOT artifacts
Initialize the required platform assets (pick one — all three are equivalent):
sh ./scripts/init.sh # Bash (requires curl + tar/unzip)
python3 ./scripts/init.py # Python 3.9+ (no third-party deps)
node ./scripts/init.mjs # Node.js 18+ (no third-party deps)All Gradle commands run from the wasmline-multiplatform/ directory:
Before running Gradle, verify the current shell with:
bash ./.github/skills/wasmline/scripts/skill_preflight.shcd wasmline-multiplatform
# Build everything
./gradlew build
# Run loader tests (manifest, crypto, verification, etc.)
./gradlew :wasmline-loader:jvmTest
# Run CLI tests
./gradlew :wasmline-cli:test
# Compile the WASM plugin sample
./gradlew :wasmline-sample:plugin:compileProductionLibraryKotlinWasmWasiOptimize
# Run compiler-plugin IR box tests
./gradlew :wasmline-kotlin-plugin:test --tests 'crow.wasmline.kotlin.runners.JvmBoxTestGenerated'Outputs JNI native libraries for the host platform:
cd wasmline-multiplatform/wasmline
zig build --release=small -p src/jvmMain/resources
zig build -p src/jvmMain/resourcesWasmline provides a CLI for the full plugin build pipeline. All commands run through Gradle:
cd wasmline-multiplatform
./gradlew :wasmline-cli:run --args="<command> [options]"| Command | Description |
|---|---|
download |
Download Wasmtime releases for target platforms |
generate-key-pair |
Generate signing key pairs |
compile |
Compile .wasm to AOT artifacts (.cwasm / .pwasm) |
manifest |
Generate a signed manifest (.wlm) from compile output |
build |
Full pipeline: compile → manifest → zip packaging |
cd wasmline-multiplatform
# 1. Download Wasmtime
./gradlew :wasmline-cli:run --args="download -v v41.0.1"
# 2. Generate signing keys
./gradlew :wasmline-cli:run --args="generate-key-pair --save"
# 3. Build plugin (compile → sign → package)
./gradlew :wasmline-cli:run --args="build -i plugin.wasm -wt build/wasmline/wasmtime/wasmtime-v41.0.1-aarch64-macos --key build/wasmline/keys/ed25519_private.key"build/wasmline/
├── output/{name}-{version}/
│ ├── manifest.wlm # Signed manifest (Protobuf)
│ ├── {name}-pulley64.pwasm # Pulley portable bytecode
│ ├── {name}-aarch64-android.cwasm
│ ├── {name}-aarch64-macos.cwasm
│ ├── {name}-aarch64-ios.cwasm
│ ├── {name}-x86_64-linux.cwasm
│ ├── {name}-x86_64-windows.cwasm
│ └── debug/
│ ├── compile-result.json
│ └── manifest.json # Human-readable manifest
├── dist/
│ └── {name}-{version}.zip # Distributable package
└── keys/
├── ed25519_private.key
└── ed25519_public.key
See wasmline-multiplatform/wasmline-cli for command-level documentation.
Android sample
Compose Desktop (macOS)
Sample code lives in wasmline-multiplatform/wasmline-sample, including:
- a WASI plugin sample
- Android host sample
- desktop sample
- multiplatform shared sample
Kotlin/Wasi runtime support status
Wasmline currently expects Kotlin 2.3.20-Beta1 or later for reliable Kotlin/Wasi support. Earlier versions or different runtimes may fail or miss required Wasm features such as GC, function references, and exception handling.
If you are working on Wasmline itself, the most useful entry points are:
wasmline-core— native Wasmtime bridgewasmline-multiplatform/wasmline— runtime SPI and public APIwasmline-multiplatform/wasmline-kotlin-plugin— Kotlin compiler pluginwasmline-multiplatform/wasmline-kotlin-plugin/testData/box/README_en.md— IR box testData guide.github/skills/wasmline/SKILL.md— repository workflow, preflight, and module routing guide.github/plans/ir-planv2.md— current IR / runtime / platform V2 plan and implementation notes
- wasm-kotlin-exploration — Wasm + Kotlin research and test cases
- Wasmtime on Android (JNI) — Embedding Wasmtime on Android via JNI
- Wasm vs. Wasi Deep Dive — Differences between Wasm and Wasi, and their lifecycles
See LICENSE for details.



