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

4ntoine

01/24/2019, 4:28 AM
Hey, guys. Thank you for all your hard work for Kotlin! I have a question. We're choosing technical solution to migrate from JS to "something that generates WebAssembly" and we're measuring dis-/advantages between Rust and Kotlin in terms of WebAssembly. Could you please answer why you haven't reused LLVM-backend (codegen) written for Rust to generate WebAssembly? Is it correct that you haven't reused it? What's your feelings (or measurements) of generated WebAssembly "quality" by Kotlin compared to Rust one? (I know it's uncertain criterions for "quality" term but i think you know what i mean).
b

bashor

01/24/2019, 10:34 AM
Hi! Currently, Kotlin/Naive compiler generates wasm using LLVM backend as well as Rust. (And it’s not written for Rust or by Rust team, it’s just yet another backend for LLVM). So, I think in term of generated code they should be very close. But you can observe some differences in things related to bundled runtime. Also, (honestly) I think interop with environment world from wasm right now is better in Rust.
👍 2
Don’t hesitate to make such detailed investigation and share it with the community! 😉
u

4ntoine

01/24/2019, 2:44 PM
@bashor Thank you
4 Views