The next big Scala release is edging further down the roadmap, with the milestone release – Scala 2.12 M1 – released this week.
In Scala 2.12-M1, the experimental support for Java 8 that featured in version 2.11 has now been extended. Once the final Scala 2.12 is released (supposedly around January 2016) Java 8 lambdas and streams will be fully supported, bridging some significant gaps between the two languages. Whilst programs written in Scala 2.12, including the compiler, will only be executed in Java 8 or even newer, the current milestone (2.12.0-M1), still targets Java 6.
This Java 8 and beyond focus for Scala was first revealed last summer in the official Typesafe roadmap for Scala 2.12. In an interview with InfoQ, Adriaan Moors (Scala tech lead at Typesafe), explained that the decision came in part as a result of the instrumental role Java has played in Scala’s success and adoption. He commented that the company was, “keen to evolve with the platform to enjoy the improvements made to it and its ecosystem.”
Planned future Java 8-centric additions for Scala 2.12 include Java 8 style closures, which will allow the Scala compiler to emit closure classes (lambdas) just as you can with Java 8. There’s also planned lambda syntax for SAM types. Again, in Java 8 fashion, this lets you instantiate any type with one single abstract method by passing a lambda, improving the user experiences for libraries written for Java 8 in Scala.
“GenBCode” – the optimizer and backend introduced in Scala 2.11 – will eventually come as default. Alongside this, Scala 2.12 will feature a new inliner and bytecode optimizer.
Besides this, there haven’t been too many changes between 2.11 and 2.12-M1, and code without deprecation warnings that compiles on the former should also work on the latter. However, in order for the language team to keep renovating the Scala standard library, the release is not binary compatible with the 2.11 series.