https://kotlinlang.org logo
Title
p

Paul Woitaschek

04/03/2023, 3:06 PM
What exactly is this new wasm in kotlin 1.8.20? We had that onWasmReady as part of jb-compose. Is that a different wasm?
o

Oleksandr Karpovich [JB]

04/03/2023, 3:15 PM
Currently when you use "onWasmReady" only skiko (skia + kotlin bindings) part is wasm. With 1.8.20 k/wasm, we'll be able to compile Compose to wasm too. Currently (with k/js) it's compiled to js.
p

Paul Woitaschek

04/03/2023, 3:20 PM
And why do I want that?
b

Big Chungus

04/03/2023, 6:22 PM
To get usual wasm benefits like streamed compilation, concise binary payload and predictable performance
p

Paul Woitaschek

04/03/2023, 6:24 PM
I have a hard time picturing what that means for developer and user experience. Is it preferred over js and if so why? I'm missing a larger picture: when do I want kotlin js and when wasm?
b

Big Chungus

04/03/2023, 6:26 PM
To me personally anything is preferable over js... But for most it will be the abscence of js kinks that es built in over the years
Also as wasm matures, you'll be able to use cpp, rust, dart, etc. wasm modules in your kwasm projects and vice versa
h

hfhbd

04/03/2023, 9:41 PM
JS needs to be compiled during runtime, so you need to provide (minimized) js source code. wasm is precompiled and the browser (or another runtime) needs to execute the binary only.