Hello :wave:, I have few confusion here.:blob-nerv...
# webassembly
a
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
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
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
It should. Current WASM is fast as well, only js interop is slow
👍 2
s
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
Thanks, it makes me curious to test it out😃
j
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
Wasm engines will use their battle-tested JavaScript GCs. They might not be as bad as you think.