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.
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-unknownInstall wasm-tools
cargo install wasm-toolsInstall Node.js v22+ with WasmGC support, for example via NVM:
nvm install v22.2.0Install jco and preview2-shim
npm installInstall 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./run.sh