~/talk

Implementing Lambda Expressions in Java

Talkat JVM Language Summit 2012 · 2012-07-30..08-01· [java]
slides:none on file

Java implements lambdas by emitting an invokedynamic call (JSR 292) that defers creation to a runtime lambda metafactory which returns instances of existing functional interface types; the compiler synthesizes a private method for the lambda body and passes captured values as dynamic args. Implementations can generate classes at link time, reuse one wrapper per interface, or return a cached constant for stateless lambdas. Measured results show worst-case parity with inner classes and best-case 4–20× faster; serialization uses a SerializedLambda descriptor and reconstitution by the capturing class to avoid new security holes.

AI-written summary · about

  1. 0:00Intro
  2. 0:15Adding lambda expressions to Java
  3. 4:37Functional interfaces
  4. 7:01We could "just" user inner classes
  5. 8:29Stepping back...
  6. 9:43Its not just for dynamic languages anymore
  7. 12:03Desugaring lambdas to methods
  8. 13:52Lambda capture
  9. 15:10The metafactory API
  10. 17:09Candidate translation strategies
  11. 19:41Indy: the ultimate lazy initialization
  12. 21:31Indy: the ultimate procrastination aid
  13. 24:49Performance example - capture cost
  14. 28:13Not just for the Java Language!
  15. 29:23Possible VM support
  16. 31:10Serialization
  17. 36:03My VM wish-list
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.