Scala 2.12.0 M1 now available
A milestone release in Scala 2.12.0 M1 is here with the series set to put all its eggs into the Java 8 basket. Containing bug fixes and improvements brought up from 2.11, the new Scala series will eventually dial down its backports.
The Scala 2.12.0 M1 release is here, featuring all bug fixes and improvements made in the 2.11 series. Series 2.12 will squarely focus on Java 8, with programs written in Scala 2.12, including the compiler, only executable on Java 8 or newer. The Scala team have said that they are “working with the community to ensure availability of the core projects of the Scala 2.12 eco-system”.
Set targets for Java 8
The series goals for 2.12 include continuing Java 6 support for a while longer, but only in Scala 2.11. By tracking the Java platform evolution, the Scala team hope to introduce experimental features into the 2.11.x series under a flag, like Java 8-style closure compilation, so the transition between 2.11 and 2.12 is hassle-free.
This will be achieved by cross-building between 2.11 and 2.12 through full backward source compatibility. The team has stated that they won’t be removing deprecated methods, “but will support optional deprecation errors”. There will also be close alignment between the 2.11 and 2.12 compiler and standard library code bases.
The release notes state the following changes planned for Scala 2.12:
- Java 8 style closures. The Scala compiler will emit closure classes (lambdas) in the same manner as Java 8
- Lambda syntax for SAM types. Similar to Java 8, Scala 2.12 allows instantiating any type with one single abstract method by passing a lambda. This feature is already available in Scala 2.11 using the
- New backend and optimizer. The “GenBCode” backend, which is already available in Scala 2.11 using the
-Ybackend:GenBCodecompiler option, will be enabled by default. Scala 2.12 will also ship with a new inliner and bytecode optimiser
It should be noted that the above list is open-ended and will be added to during the Scala 2.12 milestone cycle.
Changes and continuation
Some modules have been removed come the new series, meaning that the the Scala actors library is no longer available. The continuations plugin is no longer shipped with the new release, as well as the Scala distribution archives and the
scala-library-all Maven dependency no longer including Akka actors. Users will need to add the Akka library as a dependancy instead.
Binary compatibility has also been continued with this release, which began with minor releases of Scala 2.11. While every 2.12.x release will be binary compatible with 2.12.0, the team underlines that milestone releases and release candidates are not binary compatible with any other release.
A total of 47 exclusive bugs have been fixed in Scala 2.12.0. For those a bit slow with their upgrading schedule, the release of 2.12.0 means that backports to 2.11 will be dialled back.