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

Ananiya

12/04/2020, 11:07 AM
Hello 👋, I have few confusion here.blob nervous 1. Is the new kotlin/wasm (not via llvm) tends to be the fastest of all even when compared to jvm or slow ? 2. Are any plans to add new build system which runs on wasm or use gradle? blob smile
b

Big Chungus

12/04/2020, 11:17 AM
wasm and jvm does not have anything in common (and won't). Different tools for different purposes. New wasm kotlin will be integrated to the existing gradle toolchain as the other targets. This will end up expanding main targets for kotlin to [JVM, ANDROID, JS, NATIVE, WASM]. Since it's still backed by cli compiler, you'll be able to just use that instead of gradle to build your projects directly if you wish
a

Ananiya

12/04/2020, 11:25 AM
wasm and jvm does not have anything in common (and won't). Different tools for different purposes.
New wasm kotlin will be integrated to the existing gradle toolchain as the other targets. This will end up expanding main targets for kotlin to [JVM, ANDROID, JS, NATIVE, WASM]. Since it's still backed by cli compiler, you'll be able to just use that instead of gradle to build your projects directly if you Thanks. Yeah 😃, they won't have same thing either I mean do wasm will be fast of all
b

Big Chungus

12/04/2020, 11:50 AM
It should. Current WASM is fast as well, only js interop is slow
👍 2
s

Svyatoslav Kuzmich [JB]

12/04/2020, 3:25 PM
Hello. The point of WebAssembly is to be faster than JavaScript when compiling other languages. Kotlin/Wasm has a potential to be fast, even as fast as JVM. New prototype is currently the slowest one because we haven’t integrated any optimizer yet, and Wasm engines themselves do less optimizations compared to JVM or JS.
a

Ananiya

12/04/2020, 3:33 PM
Thanks, it makes me curious to test it out😃
j

Jilles van Gurp

12/22/2020, 10:08 AM
Short term it will definitely be slower as it is going to have a simple garbage collection and only very basic optimizations. Long term, it might catch up but I doubt it will ever be significantly faster. Both are basically byte code runtimes. Both use heavy optimizations & GCs. WASM currently seems to work well for languages that don't need GC (Rust, C++); GC is likely to be short term not that great. Depending on what you do with Kotlin, that may or may not be an issue.
s

Svyatoslav Kuzmich [JB]

12/22/2020, 1:41 PM
Wasm engines will use their battle-tested JavaScript GCs. They might not be as bad as you think.