Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

bashor/kotlin-wasm-cm-experiments

Repository files navigation

The project is outdated

For the latest WebAssembly Component Model support in Kotlin, check out https://github.com/Kotlin/sample-wasi-http-kotlin/.


Experiments with compiling Kotlin to Wasm Component, linking it with an example component written in Rust, transpiling it to JS + Core Wasm using jco, and running the result in Node.js.

Install dependencies

Checkout skuzmich/cm-prototype branch of Kotlin somewhere and install it to mavenLocal:

cd path/to/kotlin
./gradlew install --parallel

Install recent Rust toolchain and add wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown

Install wasm-tools

cargo install wasm-tools

Install Node.js v22+ with WasmGC support, for example via NVM:

nvm install v22.2.0

Install jco and preview2-shim

npm install

Install the latest experimental wit-bindgen CLI with Kotlin support via cargo:

cargo install wit-bindgen-cli --git https://github.com/skuzmich/wit-bindgen --branch kotlin

Build and run

./run.sh

About

Experiments with running Kotlin/Wasm with Component Model

Resources

License

Stars

Watchers

Forks

Contributors

Languages