Skip to content

crowforkotlin/wasmline

Repository files navigation

中文文档 | English


WasmLine

🚀 WasmLine Support & Key Findings

WasmLine is designed to provide compatibility across several platforms: Windows, Ubuntu, MacOS, and Android. It is fundamentally built upon Kotlin Multiplatform, while also supporting the use of any programming language for developing Wasi-compliant plugins.

✨ Features Support (Future Exploration)

  • IOS (Requires research and testing, Using Kotlin Native)
  • Web

⚠️ Important Runtime Note (Kotlin/Wasi)

As of December 4, 2025, testing across several mainstream runtimes indicates a critical compatibility point for Kotlin/Wasi:

Currently, only Kotlin 2.3.0-RC offers reliable support. All other runtimes either throw errors or do not fully support the latest Wasm features required.

📚 Relevant Resources

Detailed findings, including Wasmtime configuration for Android and specific Kotlin-Wasi support notes, are documented in the following resources:


🖼️ Architecture & Visuals

Kotlin Support Status

Kotlin Support

Architecture Overview

Architecture

🛠️ Pre-Build Setup

Initialization

To initialize the necessary platform libraries, execute the following script:

sh ./scripts/init.sh

✨ Samples

Running Samples

To run the sample applications on the supported platforms:

sh ./scripts/samples/run.sh

Sample Demos

Android Macos

⚙️ AOT Compilation (compile cwasm)

  • Use the following configuration with wasmtime compile to perform Ahead-Of-Time (AOT) compilation for an Android target (aarch64-linux-android), enabling key features like Garbage Collection (gc=y) and Function References:

  • Kotlin requires support for specific features. The settings for simd, relaxed-simd, and memory guards are necessary conditions added after continuous testing on Android.

wasmtime compile plugin.wasm -o plugin.cwasm \
    --target aarch64-linux-android \
    -W gc=y \
    -W function-references=y \
    -W exceptions=y \
    -W simd=n \
    -W relaxed-simd=n \
    -O static-memory-guard-size=0 \
    -O dynamic-memory-guard-size=0 \
    -O signals-based-traps=n \
    -O opt-level=2 \
    -C cranelift-debug-verifier=no