sdeleuze
02/22/2019, 9:55 AMSvyatoslav Kuzmich [JB]
02/22/2019, 11:24 AMI heard that Kotlin/JS team is working on an IR, is there some kind of generic Kotlin IR effort or is it specific to Kotlin/JS?Its a general effort to transition all backends to Kotlin IR. It would enable more code reuse across backends, common library format and common compiler plugin API. Moreover, new Kotlin/JS backend on top of this IR is almost done, stay tuned.
sdeleuze
02/22/2019, 11:24 AMSvyatoslav Kuzmich [JB]
02/22/2019, 12:05 PMCould we imagine some kind of Kotlin/Native IR not tide to LLVM that could be used to generate Binaryen IR when targeting WASM?When IR comes out of frontend it is almost backend agnostic for “pure” Kotlin code. Down the road it is lowered somewhat differently for each backend to enable simple Kotlin IR to JVM Bytecode, JS AST or LLVM IR conversions. Almost everything interop related is handled differently. In order to have direct WebAssembly generation one would want to add/delete/tweak some of these later lowering passes to get adequate IR abstraction level for WebAssembly code. I’m not sure how much should be changed in K/N but it would vary greatly depending on number of post-MVP WebAssembly features enabled.
sdeleuze
02/22/2019, 12:09 PMSvyatoslav Kuzmich [JB]
02/22/2019, 12:24 PMsdeleuze
02/22/2019, 12:25 PM