News for hackers. Stuff that matters.
Re:From Java to Kotlin and Back Again by jrs95 on Wednesday May 23, 2018 @04:10PM (#17137750)
Yes, Java lambdas are just syntactic sugar over anonymous classes with a single method IIRC. You must define a full Interface to use when defining the function signature. Kotlin functions are essentially objects that can be passed around, stored in variables, etc. You can also have functions that don’t belong to any class, no need to use static methods for that.
Re:From Java to Kotlin and Back Again by krzyk on Wednesday May 23, 2018 @04:29PM (#17137951)
Not exactly, lambdas use invokedynamic which has different performance characteristics when compared to anonymous classes.

See a talk by Brian Goetz - https://www.youtube.com/watch?v=MLksirK9nnE

Re:From Java to Kotlin and Back Again by jrs95 on Wednesday May 23, 2018 @04:52PM (#17138156)
Great, thank you for the correction. I only knew of what it looked like from an implementation perspective, had no idea things worked differently at runtime.