News for hackers. Stuff that matters.
Re:Kotlin, the Swift of Android by orangy on Monday September 01, 2014 @05:40PM (#8254782)
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.

There are no comments on this comment yet.