News for hackers. Stuff that matters.
Re:Kotlin, the Swift of Android by richardwhiuk on Monday September 01, 2014 @11:21AM (#8253269)
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.
Re:Kotlin, the Swift of Android by hhariri on Monday September 01, 2014 @11:35AM (#8253334)
Java 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.
Re:Kotlin, the Swift of Android by higherpurpose on Monday September 01, 2014 @12:06PM (#8253505)
> 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.

Re:Kotlin, the Swift of Android by dtech on Monday September 01, 2014 @01:17PM (#8253837)
Do 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)
Re:Kotlin, the Swift of Android by rst on Monday September 01, 2014 @06:07PM (#8254870)
Remember 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.)

Re:Kotlin, the Swift of Android by frowaway001 on Monday September 01, 2014 @01:28PM (#8253886)
It 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.

Re:Kotlin, the Swift of Android by curtis17 on Monday September 01, 2014 @01:37PM (#8253917)
Kotlin 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.

Re:Kotlin, the Swift of Android by V-2 on Monday September 01, 2014 @12:40PM (#8253683)
Kotlin 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.
Re:Kotlin, the Swift of Android by udalov on Monday September 01, 2014 @02:04PM (#8254020)
In 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.
Re:Kotlin, the Swift of Android by V-2 on Friday September 05, 2014 @03:24AM (#8272694)
Huh, you're right! That's a pity
Re:Kotlin, the Swift of Android by pron on Monday September 01, 2014 @02:37PM (#8254154)
Java 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
Re:Kotlin, the Swift of Android by gruvector on Monday September 01, 2014 @03:49PM (#8254418)
If you 'folded' Kotlin into Java what would you gain over just using Kotlin?
Re:Kotlin, the Swift of Android by richardwhiuk on Tuesday September 02, 2014 @08:42AM (#8257168)
Interop with existing code, access to a large developer, infrastructure and mindshare - especially in enterprise where take up of new languages is more considered?
Re:Kotlin, the Swift of Android by pswenson on Monday September 01, 2014 @12:53PM (#8253747)
java'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.