https://kotlinlang.org logo
#webassembly
Title
# webassembly
c

christophsturm

12/08/2023, 9:41 AM
what are the current advantages of using kotlin/wasm over kotlin/js for a browser app?
👀 1
a

Artem Kobzar

12/08/2023, 10:44 AM
It depends on your case. If talk in general. First, it is for the computational performance improvements (You can check the performance comparisons here). For example, if you are using Compose for Web, using K/Wasm instead of K/JS could multiply the speed of your application drawing. Bundle size is also a metric that you could care about, and the wasm binary could be much lighter than a JS bundle, so your users could start interacting with your application sooner. Also, we are trying to make K/Wasm types stricter than K/JS, which means a safer (from bugs) development environment (You can check the overview here). This is my point of view, and I think @bashor could also add several points.
1
c

christophsturm

12/08/2023, 11:33 AM
does wasm also need a bundler? one disadvantage for me that kotlin/js had was always that it uses webpack and that the js was not really tree shakeable. are these problems obsolete with wasm, or would it still make sense to try to replace webpack with for example vite?
a

Artem Kobzar

12/08/2023, 11:39 AM
So, the question is tricky. No, there is no need for a bundler. But we still use it in our Gradle plugin, because we reuse a lot of things from the K/JS Gradle Plugin. But we are working on removing it for wasm (or at least making it optional) and also, we have big plans in Kotlin/JS to make it bundler-agnostic (so, you will have the ability to use it without bundler at all or to choose your favorite one)
👍 3
👍🏾 1
c

christophsturm

12/08/2023, 11:52 AM
thats great to hear, are there youtrack issues tracking this?
10 Views