3 ms·
Someone at some point (was it an intern or OSS contributor? I forgot, or maybe I'm misremembering) made a prototype Kotlin->Java J2CL code transpiler. Basically
by cromwellian 8y ago
Someone at some point (was it an intern or OSS contributor? I forgot, or maybe I'm misremembering) made a prototype Kotlin->Java J2CL code transpiler. Basically, you just need a Kotlin backend that generates Java source instead of Bytecode.
Kotlin hired the guy who wrote the TeaVM, so I think they are focusing on bytecode translation approaches to JS. We considered this for J2CL but ultimately decided to use JDT parsing from Source, because with bytecode you lose some information you have in the Java AST that requires reconstructing it.
Also, Kotlin's runtime is quite large, and if you were trying to compile Kotlin -> J2CL you'd want a customized runtime that relies on JsInterop and Elemental2 to get the smallest possible code size.