Comment

Comment by orangy

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.
parent orangy 12 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton