"To get started with Kotlin, download the Android Studio 3.0 preview, open one of your existing Java files, and then choose “Convert Java File to Kotlin File” in the Code menu." You do not have to install a preview version of Android Studio, you can install the kotlin plugin in whatever version of AS you're using now. The change in AS 3.0 is simply that it will ship the plugin by default.
Android now supports Kotlin
171–180 of 225 posts
Re: Android now supports Kotlin
#172Kotlin 1.1 supports coroutines what IHMO makes concurrency in a GUI much nicer. For example, it has C# like async/await methods; but more flexible...
Re: Android now supports Kotlin
#173Funny, I was messing around with Kotlin for the first time last night. So far, the language seems well-structured and I really like that one gets all of Java's ecosystem without actually having to write java. (Also, "override fun" just sounds hilarious. Bwaha!) Throw in TornadoFX and Gluon Scene Builder (formerly of Oracle) and you're spinning up high-quality cross-platform GUIs faster than Atom, with a visual editor…
I call Kotlin Android's Swift.
Re: Android now supports Kotlin
#174Earlier quoted context omitted.
Not sure what you're rambling about. Java is still and always will be the core language of the JVM. It isn't going anywhere and the Java team (comprising mostly ex-Sun people) continues to push the language forward under Oracle's fantastic stewardship. The issue is that Java is required to be more stable than other languages since it powers so many production, enterprise system and hence will be slower to innovate. I…
I think the Oracle/Google lawsuit drove the decision to adopt Kotlin. Now Google is going to work with JetBrains to develop Kotlin and is going to fork the GPL JVM probably by not including things like the controversial project Jigsaw that IBM voted down. Meanwhile, Oracle is stuck with Java, just like they're stuck with OpenOffice, Hudson, etc.
Re: Android now supports Kotlin
#175I wonder if Android will ever support Go? Seems Google would want to do this.
Re: Android now supports Kotlin
#176Well this looks like going to push Kotlin in big league. I remember scala enthusiasts made big noise in last few years to have scala as officially supported language. But Google seems to prefer a closer relationship with Jetbrains.
I don't see what it has to do with relationships. Convince us why Scala would've been a better choice?
Developer reasons: Scala is a much more elegant language. Failure reporting in Kotlin completely sucks (in some ways it's worse than Java since they've removed checked exceptions and not offered any substitute - they make a lot of fuss about handling null/options but all that completely breaks down as soon as you want to actually report a reason why something failed). Typeclasses with automatic derivation are really nice. In a big application I might like to be able to do FRP stuff or async pipelines; not only does Kotlin not have an equivalent to fs2 but it's impossible to write one in the language. Every time a new thing comes along Kotlin adds it into the language as a new, different feature because they're allergic to offering general features you could use to implement things yourself (e.g. async/await).
Re: Android now supports Kotlin
#177Earlier quoted context omitted.
The newest version of Scala (2.12) requires a JVM with Java 8 feature compatibility which makes it unusable on Android devices. Google would literally be stuck supporting an obsolete version of a language that's not developed... or restrict the use of it only to Android O and newer making it dead on arrival. Kotlin compiler generates code that's runnable on JVMs supporting Java 6, which makes it work on pretty much a…
Bit of an aside, but is the Kotlin compiler itself runnable on JVMs supporting Java 6? So you could compile on an Android device.
Re: Android now supports Kotlin
#178Earlier quoted context omitted.
I have nothing against Kotlin. It seems to be coming out of nowhere to surpass more "tested" languages for lack of a better way of putting it, but as I'm reading about it I can truly see the appeal. The one thing I'm having trouble figuring out, though, is how much it diverges from Java in terms of inheritance, traits, etc. The verbosity of Java is one thing, but its inheritance system is what made me want to pull my…
It's weird you'd accuse Kotlin of throwing stuff at the wall while simultaneously speaking kind of Scala. Scala has so many competing ideas & approaches just all mashed up into a blob.
Re: Android now supports Kotlin
#179Earlier quoted context omitted.
The newest version of Scala (2.12) requires a JVM with Java 8 feature compatibility which makes it unusable on Android devices. Google would literally be stuck supporting an obsolete version of a language that's not developed... or restrict the use of it only to Android O and newer making it dead on arrival. Kotlin compiler generates code that's runnable on JVMs supporting Java 6, which makes it work on pretty much a…
thought recent android's tools update meant I can use java8 on android devices... guess that requires a recent android device :(
So the Java 8 tools you're talking about essentially take Java 8 compiled bytecode and patch out the parts that aren't compatible with device JVM (e.g. they replace lambda invocations with anonymous classes like you'd use on Java 6 etc.).
This doesn't work for things like Scala which use these new features in patterns those tools can't patch/recognise.
Re: Android now supports Kotlin
#180I should note that Kotlin now supports JDK, JS, iOS, and LLVM as backends. Gradle also announced support for Kotlin. This means you can write your Android app, iOS app, web browser app, desktop app, and your build scripts -- finally all in the same language.
That's a pretty absurd claim, their native implementation is not only experimental, the GC solution is "unknown". You can't make this stuff up, it will be years before anyone is writing production IOS apps in Kotlin. Heck, their JS implementation still generates massive binaries. Targeting the JVM/Android? Sure, good to go; otherwise the promised land is a long way off.
"Currently Kotlin/Native uses reference counting based memory management scheme with a cycle collection algorithm. Multiple threads could be used, but no objects shared between threads are allowed."
They have also said that it's pluggable and they might experiment with other collectors on different platforms, but it's hardly "unknown".
The size of generated JS is definitely a problem at the moment but they're working on it: