Hacker News new | ask | show | jobs
by thu2111 2328 days ago
Virtual threads (Loom) are also not anything affecting bytecode generation, so Kotlin will work with them out of the box.

Really, I don't get this claim Kotlin will lack Java features. Most big Java upgrades these days are at the VM level. Kotlin gets those mostly for free, once they choose to upgrade to newer bytecode features (which they are slow at doing admittedly, but that's because they're in the middle of a compiler rewrite).

1 comments

No it won't, because Kotlin also needs to target other platforms, and exposing JVM APIs or new bytecodes needs to have to have that into consideration.

It also means that Kotlin on Android cannot just consume any random Java library, only those that are compatible with Android Java flavour of the month.

Kotlin does expose JVM specific stuff though. Like the entire class library. You have to specifically opt in to the multiplatform subset to avoid that. It's not like they whitelist APIs. The only time they need to do anything to add new Java features is when the bytecode patterns change.