Scala 2.12 & Java 8: More Fun Together!

Adriaan Moors

Scala Compiler Team Lead

To take full advantage of Java 8’s support for lambdas and interfaces with concrete methods, a lot is changing behind the scenes of the Scala 2.12 compiler!

At the language level, Scala has always had first-class support for lambdas, of course, and with Java 8’s invokedynamic machinery we can now compile them to more compact and efficient bytecode. We also interoperate fully with Java’s modeling of functions as Single Abstract Method types (aka functional interfaces).

The other advantage of compiling to Java 8 bytecode is a more direct encoding of traits. The invokedynamic instruction plays an interesting role here as well, surprisingly!

While we were revamping the back-end, we’ve also replaced the old optimizer with a much more robust and powerful one, based on Miguel Garcia’s earlier work.

Finally, I’ll talk about the crucial ingredients of my kind of functional programming language (beyond nice syntax for functions). Thrilling slide titles will include: “val is your friend”, “everything is an expression”, “patterns for destruction”, “how I stopped worrying about variance”.

Tags: , , ,

Location: Salon B
April 11th, 2016
2:45 PM - 3:45 PM