A few months ago I started working on a Kotlin/Was...
# webassembly
r
A few months ago I started working on a Kotlin/Wasm web framework with full support for compilation to Kotlin/JS target as well. I really thought this was a good idea because browser support for Kotlin/Wasm was very experimental at that time. I'm not so sure anymore and I'm asking for opinions. Do you think it's worth the effort (which is quite large due to many Kotlin JS/Wasm incompatibilities) to support both Kotlin/Wasm and Kotlin/JS?
There are three obvious advantages of JS target - legacy browser support, smaller bundle size and webpack HMR. At the same time, if you just want to have JS application there are so many other possibilities (both Kotlin and non-Kotlin). I'll be grateful for any comments and opinions.
a
Nowadays, I feel that this is the best option. It's not only about the legacy browsers, but also, there is a huge market of Safari browser (on iOS), that still doesn't support all the required features to make Kotlin/Wasm application work.
4
r
Why is Safari lagging behind? I thought Chrome and Safari engines are similar.
o
Safari uses WebKit under the hood, Chromium uses Blink(V8) (AFAIK) Chromium supports WasmGC in latest stable version Safari(WebKit) - not yet fully support WasmGC (any may be other proposals) You can find a little more information in thread: https://x.com/bashorov/status/1727006902079365419?s=20
s
Yep, Chrome uses a fork of Safari’s WebKit overall browser engine. But they have completely independent JS+Wasm engines: V8 and JavaScriptCore.
I admit that compatibility issue between Kotlin/JS and Kotlin/Wasm not at the top of our priority, and I can’t promise a solution in the near future. But it would be great help if folks reported these problems so that they are not overlooked in future development.
1
^ This mostly apply to things that Kotlin/Wasm can do, but is incompatible with K/JS. Compatibility the other way around sometimes hard due to the nature of compiling to Wasm.
s
Kotlin/Wasm is the future, so if you need something today for customers, hard to avoid Kotlin/JS, but if you prepare something ambitious middle/long term, I will focus on Kotlin/Wasm.
1