Live data from Hacker News

The potential of Kotlin/WASM

seb.deleuze.fr

41–46 of 46 posts

Re: The potential of Kotlin/WASM

#42

Hello world is 1.5 MB but compiled surprisingly fast: less than a second (with grade running, couldn't test konanc -target wasm yet?) That's much better compilation time than kotlin/native:wasm Wasm types are currently inaccessible in JS and you can't feed js objects into wasm, hopefully that will change...

Hello world with production artifact and Binaryen optimization produces a 128K Wasm file for now for https://github.com/vmware-labs/wasm-languages/tree/main/kotl..., but the Kotlin/Wasm team has not tracked those data points recently so there are likely footprint regressions to fix. The size should be even smaller. They are going to have a look and also to enable Binaryen by default for production artifacts.

Re: The potential of Kotlin/WASM

#43
post #5

> But WebAssembly becomes even more interesting when you take another perspective. What if Compose for Web, the multiplatform incarnation of Jetpack Compose used on Android, would leverage Kotlin/Wasm instead of Kotlin/JS to perform pixel-perfect Canvas based rendering? It would not really be very web like. It'd be more like Flash or a Java Applet. User extensions would all be broken. This is a new thing coming peopl…

This is indeed a very important point, and I care deeply about that.

For Compose for Web, there has been I think a lot of debate to decide if the Web rendering should be Canvas or DOM based. At least for now, it seems the official support is focusing on Canvas rendering for pixel-perfect rendering, and it already works with Koltin/Wasm, see https://twitter.com/bashorov/status/1625437131706363904. This choice is probably driven by Kotlin current mobile app main use case.

But via community-driven project like https://github.com/varabyte/kobweb or https://github.com/mpetuska/kmdc, Compose for Web can also be a good Web citizen and perform DOM based rendering.

Re: The potential of Kotlin/WASM

#44

I don't know if anyone else had the idea yet, but I would love to use Kotlin with Svelte on the frontend.

I would love to see a Svelte-like frontend framework natively designed for Kotlin/Wasm, not necessarily another Kotlin to JavaScript binding that feels like a second class citizen.

Re: The potential of Kotlin/WASM

#46
post #42

Hello world is 1.5 MB but compiled surprisingly fast: less than a second (with grade running, couldn't test konanc -target wasm yet?) That's much better compilation time than kotlin/native:wasm Wasm types are currently inaccessible in JS and you can't feed js objects into wasm, hopefully that will change...

Hello world with production artifact and Binaryen optimization produces a 128K Wasm file for now for https://github.com/vmware-labs/wasm-languages/tree/main/kotl... , but the Kotlin/Wasm team has not tracked those data points recently so there are likely footprint regressions to fix. The size should be even smaller. They are going to have a look and also to enable Binaryen by default for production artifacts.

nice + thanks
Post reply on HN