Quick summary of Kotlin and why you'd want to use it in Android:
Lambdas
Fairly lightweight, probably looking at 10% overhead only
Can ducktype existing classes. eg add "hello".reverse()
IDE support in Jetbrains (but not in eclipse)
Can turn 'try..finally' into library methods
Full interop with java files in same project
val/var types help to reduce side effects
fun main(args : Array<String>) {
val a = calculate(1) { x -> 10 + x } //11
val b = calculate(2) { x -> 20 * x } //40
println("a = $a, b = $b")
}
fun calculate(a : Int, calc : (Int) -> Int) : Int{
return calc(a)
}
I can only recommend that you take all the claims from JetBrains employees about other languages with a large grain of salt.
Having watched most of their presentations, it seems to be a sad fact that they can't seem to sell their language without spreading FUD and making misleading claims about their “competitors” (especially about Scala it seems).
I can totally understand how frustrating it must be for the Kotlin devs that they have still failed to produce anything which could be described as a stable, working release, but I think the right solution for them would be to spend less time bashing other languages and to work harder, not to badmouth and disrespect other open-source communities, their work and their projects.
I wrote a river of news reader called Android Rivers based on Kotlin - the github code is here http://goo.gl/FdEPw.
The app is available at Google Play http://goo.gl/kShgp (I made a new release today).
Feel free to evaluate the "start up" performance of my app.
My only problem with Kotlin so far is I haven't managed to figure out how to run ProGuard with it to reduce the APK. The Kotlin lib itself is pretty reasonable(less than 500KB).
Edit: add technical profile of Android Rivers
Using SQLite database
High performance XML parsing(RSS 1.0/2.0,ATOM and OPML)
High performance JSON parsing(RiverJs)
Media Service (custom podcast player)
Writing Android Service
Accessing Android Clipboard
Fragments
Implementing Holo theme in Android 2.2 above
Library modules
First class Outliner UI support
Asynchronous operations
Managing file system
Creating custom dialogs
Implementing Sliding Menu
Asynchronous HTTP calls
Integrating Android Java library
Implementing Arabic language support
That was certainly interesting, but it seems far from conclusive. It's an Android beginner saying that everything seemed to work alright. Is he/she in a good position to evaluate startup performance?
> Is he/she in a good position to evaluate startup performance?
Even my grandma would be in a good position to evaluate startup performance.
Anyway, I was building an app back in the time of Android 2.0 to discover the platform and I had no problems, neither with startup time nor with apk size.
That's why I get a bit concerned when people who a) build a “competing” language and b) only seem to know Scala from reading stuff on the internet, make misleading claims.
If this had just happened once I wouldn't have said anything, but this seems to become a pattern.
I'm a Web guy starting to learn Android, and thinking of using Scala, may I know how bad the startup time when using Scala (and other problems if you know any)? My understanding is you can use ProGuard to slim it down and make it as fast/small as Java.