3 ms·
Great, I have an expert here! So how does Kotlin bridge the differences between Java and JS? Can I write portable code that manipulates arrays? Does Kotlin u
by dgreensp 13y ago
Great, I have an expert here! So how does Kotlin bridge the differences between Java and JS? Can I write portable code that manipulates arrays? Does Kotlin use JavaScript's number semantics when it targets JavaScript, or does it emulate Java's?
I'm starting to suspect Kotlin is a unified syntax but doesn't actually have any unified semantics, or considers all heap objects to be "foreign" and owned by either Java or JS.
I was expecting to hear one of a few reasonable approaches to making code portable across Java and JS. For example, Kotlin has its own concept of an array which happens be backed by an ArrayList in Java land. Or, classes like ArrayList are emulated in JS by a runtime library.