https://kotlinlang.org logo
#getting-started
Title
# getting-started
e

Emery Tanghanwaye

09/07/2020, 5:17 AM
Hey all, just wondering, why is kotlin stuck on Java 8? Why doesn't it start targeting newer versions?
e

ephemient

09/07/2020, 8:10 AM
as far as the Java bytecode is concerned, there isn't actually much new. most of the new features have been in the Java language and API
the only new useful feature might be nestmates. https://youtrack.jetbrains.com/issue/KT-27182
Kotlin isn't even using invokedynamic from Java 8 yet, it would be useful for lambdas (https://youtrack.jetbrains.com/issue/KT-26060) and string concatenation (https://youtrack.jetbrains.com/issue/KT-21147)
the `@JvmDefault`/`-Xjvm-default` stuff is still getting settled (https://youtrack.jetbrains.com/issue/KT-25491, also a Java 8 feature)
project valhalla is much bigger than any of the above, but it isn't landed yet
I definitely do not speak for the K team, I'm just a user. but I do not see any strong reason to target newer Java versions yet.
m

Michael de Kaste

09/08/2020, 11:15 AM
Sometimes I do miss a standard library function that does not exist in Java 8 yet, but they could definitely target a newer version somewhere in the future
e

ephemient

09/08/2020, 2:17 PM
there's nothing stopping you from calling new Java APIs though? if you want to use the new
<http://java.net|java.net>.http
(for example), just go ahead and use it, no Kotlin support needed. that has nothing to do with the target version
m

Matteo Mirk

09/08/2020, 3:00 PM
yeah many people are still confusing che bytecode specification with the JDK…
m

Michael de Kaste

09/08/2020, 3:33 PM
That is true; I keep them conflated because sites like codewars only specify kotlin version, which use the java 8 api. For personal project I do use newer java versions
3 Views