Preferences

Apparently that isn't the case.

Additionally it is stuck on Java 8 view of the world, otherwise those .class files won't be usable on Android toolchain thanks Google.


Looks like it supports generating class files up to java 16 https://kotlinlang.org/docs/compiler-reference.html#jvm-targ...
Yeah, but it can't make use of JVM bytecodes without DEX counterparts, nor JVM abilities unknown to ART.
Incorrect, the Kotlin compiler allows you to specify the target JVM level, it can generate JVM 1.6 bytecode (for android) up to 16.

I know for a fact it uses different bytecode features if the level is >= 1.8, not sure how smart it is above that.

It can only generate bytecode features that ART understands, and D8 is able to convert into DEX, thus is the price of Android marriage.

Going forward while for Java code there is no worry about using SIMD, JNI replacement, value types, Kotlin code will need to make use of KMM for code that is supposed to target both JVM and Android.

Are you so dense that you cannot understand that the Kotlin compiler can do gasp different things depending on different settings?

It can do stuff android doesn't support if you set the bytecode target level to > 1.8

It's like using modern Javascript features but providing a polyfill for older browsers.

Which produces libraries that are worthless to be consumed from Android without recompiling.

Also stuff like value classes will have different semantics in memory consumption and performance across targets.

Maybe some learning required?

Those are bytecode level related. You can't consume Java 16 libraries on Android either. It's not related to Kotlin at all.

You are either being deliberately obtuse or you genuinely have difficulty to understand that Java version, bytecode version, Kotlin compiler output and what bytecode Android supports are totally independent concepts.

Enjoy #KotlinFirst, I am out of this thread.

It is going to be fun to port back stuff to Java.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal