https://kotlinlang.org logo
s

steenooo

01/20/2020, 1:12 PM
I believe the Jvm kotlin compiler can target 8, right? Are there any plans to target more "modern" versions anytime soon?
d

diesieben07

01/20/2020, 1:14 PM
Unless there are things that could be done more efficiently using newer bytecode versions there really isn't much need to do so.
s

steenooo

01/20/2020, 1:16 PM
I do believe that they added more instructions to more modern jvm versions which would allow it to be faster. Though I must admit that I don't have concrete examples for this.
s

Stephan Schroeder

01/20/2020, 1:29 PM
according to the release notes of Kotlin 1.3.30: “Specifying JVM bytecode targets 9 – 12 If you run the code under JVM versions 9, 10, 11, or 12, you can now set the corresponding
jvmTarget
. This setting will affect the version of the generated classfiles, and the resulting bytecode won’t run on any lower version of JVM. Note that so far newer versions don’t add any bytecode optimizations or features beyond the ones that exist in lower versions, but that is going to change in the future.” https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/
👍 1
r

Ray Eldath

01/20/2020, 2:30 PM
ah, I will guess this is because jetbrains is just too busy with other part like MPP and compiler plugin... IIRC there're quite a few bytecode optimization-related issues on YouTrack, one of them is about JEP 280. still, IIRC, this is mentioned in KotlinConf 2019 for still unsolved.
c

Czar

01/20/2020, 3:58 PM
There's a lot of benefits in targeting more modern java versions. I haven't done any exhaustive analysis myself, but recently I watched a great recording of a KotlinConf talk on future of Java vs current Kotlin, and some of possible optimizations to kotlin compiler were mentioned. I highly recommend the talk. Here's the link:

https://youtu.be/te3OU9fxC8U

Don't pay attention to the clickbaity title, it's in good humour 🙂
2
r

Ray Eldath

01/20/2020, 4:24 PM
yes!!! this is the talk I've mentioned. 😺 And, BTW, if only consider the language features themselves, I'll run for the opposite conclusion of the talk... I think the Java 19 or so is a catch-up, but seems every catch-up features is implemented better than the current Kotlin... like better bytecode optimization, pattern matching, etc. of course, one might say that Kotlin will evolved, and the comparison between today's Kotlin and Java in maybe 2 or 3 years later is not fair. certainly it is not fair, I just want to say that Java 19 is very appealing, if not more, comparing to current Kotlin.
c

Czar

01/20/2020, 6:53 PM
In fact that is exactly the argument speaker makes 🙂 But you really have to include kotlin multi-platform and coroutine stuff into the reasoning. Then conclusion is much more obvious.
r

Ray Eldath

01/21/2020, 3:21 AM
yeah. MMP and coroutine is definitely the really big deal. the former is maybe Java will never attain, and the latter... I've heard that Loom had just redesign their prototype (again...?) so maybe Java 30 or so. 😼
3 Views