# webassembly

Robert Jaros

11/29/2023, 8:47 AM
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.

Artem Kobzar

11/29/2023, 9:11 AM
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.

Robert Jaros

11/29/2023, 9:32 AM
Why is Safari lagging behind? I thought Chrome and Safari engines are similar.

Oleg Yukhnevich

11/29/2023, 10:05 AM
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:

Svyatoslav Kuzmich [JB]

11/29/2023, 11:13 AM
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.
^ 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.


11/29/2023, 5:40 PM
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.