Does anyone have some performance comparison betweend projects written in pure Java vs straightforward Kotlin? I don't feel that method count is performance measure, I'd rather see some fps, method calls/sec or something like this. Or I'm wrong about method count?
There was someone from JetBrains doing profiling and chatting about it in #kotlin (freenode IRC) the other day. Oddly, he found some things got faster in Kotlin for no obvious reason. Some JVM optimisation magic, I guess.
Kotlin is a much more pragmatic language than many such new ones. They are building it for use in their own products including performance sensitive products like IntelliJ. For example it has an inline method attribute. This may seem remarkably low level for a modern JVM based language intended for industrial use, but there's a point to it: it lets you use lambda functions and misc features that rely on them without extraneous memory allocations. Applied consistently this sort of thing can make the difference between "a lovely language that's too expensive to use" and "a lovely language that is deployable". It's not auto-inferred because otherwise you wouldn't be able to make libraries that have stable ABIs with Kotlin.
Generally they seem to be targeting zero performance degradation over Java even when using the advanced features, which is nice to see.
Yep, I agree. Mostly because it was me digging into JMH :) Indeed we are measuring and optimising. This is still early work in progress, but we have some good results already:
inline fun calc<T, R>(value: T, fn: (T)->R): R = fn(value)
inline fun identity<T>(value: T): T = calc(value) { it }
// This is optimised down to loading constant value 1 into variable x
val x = identity(1)
Besides having nice syntax for lots of everyday things Java developers are doing, we want to provide means for doing it effectively, clearly and maintainably.