Lambdas: It’s Java Jim, but not as we know it
One of the big new features in JDK 8, as we all know, was Lambda expressions. In this talk, we’ll review the ideas behind lambdas and then dig into the performance implications of using them, looking at the use of invokedynamic rather than simple syntactic sugar for anonymous inner classes. We’ll conclude by exploring how, using only one new functional interface, we can solve (in theory) any problem using only Lambda expressions.
The origins of Lambda expressions go back eighty years, well before Java (and even modern computing) started and is based on the work of Alonso Church, who created Lambda calculus as a mathematical model of computation. Lambdas give us a much simpler way to represent an anonymous function without all the boilerplate code of inner classes. This really is Java, but most of it won’t look like any code you’ve ever seen before. Be prepared for some mind-bending use of Lambda expressions!