4 ms·
It would be nice if more of this was folded into Java itself, rather than existing as a new language - as the author notes a lot of it is in Java 8.
by richardwhiuk 12y ago
It would be nice if more of this was folded into Java itself, rather than existing as a new language - as the author notes a lot of it is in Java 8.
- hhariri 12y agoJava 8 does introduce a few features that are available in Kotlin, but AFAIK Java 8 won't be available for Android for some time. In addition, Kotlin makes a lot of constructs more succinct, including but not limited class definitions. So it's not only about what it adds, but what it "takes away" too IMHO.
- higherpurpose 12y ago> AFAIK Java 8 won't be available for Android for some time Pretty sure it will never be available on Android. Best case scenario Google moves away from it. Worst case, it will add some new, similar features to Dalvik VM. But I doubt they are considering adopting Java 8.
- dtech 12y agoDo you have any basis for these claims? Java 8 contains many useful language improvements and Google has shown with Java 7 that it will adopt these (albeit incredibly slowly)
- frowaway001 12y agoIt has only adopted Java 7 features which are either syntactic sugar or library extensions. (E. g. everything where the Java class file version wouldn't have mattered anyway). Java 8 (and Java 9 and Java 10) are completely different, with huge, mandatory changes to the class file format and the virtual machine.
- rst 12y agoRemember the Google/Oracle lawsuits over the use of Java technology in Android? Bringing in JVM changes from newer Java releases risks giving Oracle grounds for another lawsuit (covering the patents and whatever copyrights may apply to the new features), and it's not likely Google wants to run that risk. (This is why the Java 7 features that they have adopted are the "syntactic sugar" that doesn't require JVM changes, and leaves the code running in the phones as-is.)
- curtis17 12y agoKotlin could be the Swift for Android if Jetbrains make it an explicit goal and gain developer mindshare. Also, Kotlin can compile down to JS and can thus target another Google platform - ChromeOS/Chrome - with the possibility of shared code.
- V-2 12y agoKotlin has stuff that's unlikely to appear in Java, such as reified generics - Java has already chosen type erasure generics instead. I wouldn't bet a penny that they ever change this approach if they didn't go with it from the start.
- udalov 12y agoIn fact Kotlin doesn't have reified generics. This idea was planned in the beginning and was reflected in the old docs but abandoned later. I believe there's no reference to reified generics on the new web site anymore.
- V-2 12y agoHuh, you're right! That's a pity
- pron 12y agoJava is getting reified generics via a really cool mechanism called classdynamic (which also enables efficient implementation of tuples). This is pretty much necessitated by value types. See project Valhalla: http://www.infoq.com/news/2014/07/Project-Valhalla http://www.infoq.com/news/2014/07/Project-Valhalla
- pswenson 12y agojava's impl of lambdas is much uglier and feels hackier than kotlin. java forces everything into a stream + checked exceptions are problematic. also java 8 doesn't have eatures like string interpolation, default params, etc.
- gruvector 12y agoIf you 'folded' Kotlin into Java what would you gain over just using Kotlin?
- richardwhiuk 12y agoInterop with existing code, access to a large developer, infrastructure and mindshare - especially in enterprise where take up of new languages is more considered?
- gruvector 12y agoIf you 'folded' Kotlin into Java what would you gain over just using Kotlin?