HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
GOTO 2013 • Lambdas in Java: A Peek under the Hood • Brian Goetz

GOTO Conferences · Youtube · 12 HN points · 2 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention GOTO Conferences's video "GOTO 2013 • Lambdas in Java: A Peek under the Hood • Brian Goetz".
Youtube Summary
This presentation was recorded at GOTO Aarhus 2013. #gotocon #gotoaar
http://gotocon.com

Brian Goetz - Java Language Architect at Oracle

ABSTRACT
The big language features for Java SE 8 are lambda expressions (closures) and default methods (formerly called /defender methods/ or /virtual extension methods/). Adding closures to the language opens up a host of new expressive opportunities for applications and libraries, but how are they implemented? You might assume that lambda expressions are simply a more syntactically compact form of inner classes, but, in fact, the implementation of lambda expressions is substantially different and builds on the invokedynamic feature added in Java SE 7. This session illustrates the boundary where language design and JVM architecture meet and influence each other.

https://twitter.com/gotocon
https://www.facebook.com/GOTOConference
http://gotocon.com
#Java #Lambda #JavaSE8
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
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

jrs95
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.
Jan 10, 2015 · 12 points, 1 comments · submitted by joegreen
phatak-dev
Seems like Scala going to be enormously benefit from this.
This talk explains why: https://www.youtube.com/watch?v=MLksirK9nnE
revelation
Read "people wouldn't stop harassing us for lambdas after we decided to delay them again and again, and so we half-assed a solution that is easy for us and binds into all the overengineered class hierarchies you have lying around".
BrandonM
I believe Hacker News calls this a Minimum Viable Product.
mateuszf
MVP and 100% backward compatibility don't go with each other well.
BrandonM
The linked talk actually does a pretty good job describing how Java 8's Lambda is both backwards compatible and forward thinking.

1. The idea of @FunctionalInterface leveraged practices that were already in use--interfaces with a single method--for Comparator, Runnable, Callable, and external libraries. This meant that users could use lambdas to implement such interfaces immediately, with no changes to existing libraries.

2. The actual implementation of a lambda in bytecode is a single invokedynamic call. They went that route to avoid tying the bytecode representation to their initial implementation.

A future change could add true function types, and have them automatically instantiate a target functional interface (provided that they have the same "shape"). That would require a language change (adding function types), but not a bytecode change.

That would have the nice result that all the code that people are writing now could work with new function types, and new code could be written to accept the function types instead of functional interfaces. My library would become unnecessary at that point, and I would be pretty happy about that.

That is, Java 8's lambda implementation does not preclude fully-backwards-compatible "real" lambdas in the future.

Personally, I think the Lambda project was a well-reasoned, intelligent step forward. The video is really worth watching, because I wasn't aware of how flexible their future directions are until I watched it.

mateuszf
Thanks. But that is totally compatible with what I said. Java lambdas were well thought out, doing MVP style development would highly likely blow it.
frowaway001
> That is, Java 8's lambda implementation does not preclude fully-backwards-compatible "real" lambdas in the future.

No, it just made them a lot harder to achieve, because any decent "real" lambda implementation requires now the introduction of another language feature: type aliases.

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.