Skip to content

Releases: scala/scala

Scala 2.12.0-M5

29 Jun 23:29
v2.12.0-M5
Compare
Choose a tag to compare
Scala 2.12.0-M5 Pre-release
Pre-release

The Scala team at Lightbend is proud to announce the-milestone-also-known-as-RC0! 🎈

Here are the highlights for Scala 2.12.0-M5:

  • #5251: concrete trait methods are compiled to a static method (in the interface classfile) containing the actual implementation, and a default method forwards that to the static one.
  • #5085: classes extending traits no longer get mixin forwarders (in most cases), the JVM picks the correct default method.
  • #5102 adds partial unification of type constructors (behind -Ypartial-unification) and fixes SI-2712. Thanks @milessabin!
  • The optimizer now listens to -opt (instead of -Yopt)
  • SI-9390: local methods that don't capture this
    are emitted as static to prevent capturing the outer instance in lambdas.

Check out the release-note worthy PRs for more details!

In total, we merged 96 pull requests, of which 9 are by new contributors -- welcome!

This milestone resolves 49 JIRA tickets.

Note: #5085 introduces a performance regression, it causes the Scala compiler to run 20% slower. Any Scala program that uses concrete trait methods might see a slowdown. The most likely cause is that the JVM does not perform "class hierarchy analysis" (CHA) for methods defined in interfaces, including default methods, as noted in JDK bug 8036580. This prevents the JIT from performing certain (important) optimizations. Most likely we will have to revert the change to fix the issue, but we are still investigating the details. The 2.12 release notes will clarify the impact of changes to traits on binary compatibility.

As usual for milestones, 2.12.0-M5 is not binary compatible with any other Scala release, including other 2.12 milestones. Scala 2.12 requires a Java 8 runtime.

To ensure a short RC cycle, only pull requests that could not ship in 2.12.1 will be considered for 2.12.0 (i.e., showstopper bugs or those that may affect binary compatibility).

Scala 2.12

Scala 2.12 is all about making optimal use of Java 8's new features. Traits (#5003) and functions are compiled to their Java 8 equivalents, and we treat Single Abstract Method types and Scala's builtin function types uniformly from type checking to the back end (#4971). We also use invokedynamic for a more natural encoding of other language features (#4896). We've standardized on the GenBCode back end (#4814, #4838) and the flat classpath implementation is now the default (#5057). The optimizer has been completely overhauled for 2.12.

Except for the breaking changes listed below, code that compiles on 2.11.x without deprecation warnings should compile on 2.12.x too, unless you use experimental APIs such as reflection. If you find incompatibilities, please file an issue.

New features

Trait compiles to an interface

With Java 8 allowing concrete methods in interfaces, Scala 2.12 is able to compile a trait to a single interface. Before, a trait was represented as a class that held the method implementations and an interface. Note that the compiler still has quite a bit of magic to perform behind the scenes, so that care must be taken if a trait is meant to be implemented in Java. (Briefly, if a trait does any of the following its subclasses require synthetic code: defining fields, calling super, initializer statements in the body, extending a class, relying on linearization to find implementations in the right super trait.)

Java 8-style lambdas

Scala 2.12 unifies Scala's notion of a function (or "lambda", or "closure") with Java 8's approach to lambdas. We compile lambdas to the same byte code as the Java 8 compiler, regardless of whether they target a FunctionN class from the Scala standard library or a Java 8 functional interface (a Single Abstract Method type). Furthermore, the type checker accepts a function literal as a valid expression for either kind of "function-like" type (e.g., the built-in Int => Int or IntUnaryOperator).

Welcome to Scala 2.12.0-M5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92).
Type in expressions for evaluation. Or try :help.

scala> (x => x + 1) : java.util.function.IntUnaryOperator
res0: java.util.function.IntUnaryOperator = $$Lambda$1093/1901700557@4f966719

scala> (x => x + 1) : Function1[Int, Int]
res1: Int => Int = $$Lambda$1116/1609038183@59e43e8c

For each lambda the compiler generates a method containing the lambda body, and emits an invokedynamic that will spin up a lightweight class for this closure using the JDK's LambdaMetaFactory.

Compared to Scala 2.11, the new scheme has the advantage that, in most cases, the compiler does not need to generate an anonymous class for each closure. This leads to significantly smaller JAR files.

New back end

Scala 2.12 standardizes on the "GenBCode" back end, which emits code more quickly because it directly generates ASM bytecode from Scala compiler trees, while the previous back end used an intermediate representation called "ICode". The old back ends (GenASM and GenIcode) have been removed (#4814, #4838).

New bytecode optimizer

The GenBCode back end includes a new inliner and bytecode optimizer.
The optimizer is enabled using the -opt:l:classpath compiler option.
Check -opt:help to see the full list of available options for the optimizer.

The following optimizations are available:

  • Inlining final methods, including methods defined in objects and final methods defined in traits
  • If a closure is allocated and invoked within the same method, the closure invocation is replaced by an invocations of the corresponding lambda body method
  • Dead code elimination and a small number of cleanup optimizations
  • Box/unbox elimination #4858

The work on the new optimizer is still ongoing. You can track it in the scala-dev repository issue tracker.

Breaking changes

SAM types

As of #4971, we treat Single Abstract Method types in the same way as our built-in FunctionN classes. This means overloading resolution has more contenders to choose from, making type inference less effective. Here's an example:

class C[V] {
  def sort(cmp: java.util.Comparator[V]): C[V] = ???
  def sort(cmp: (V, V) => Int): C[V] = sort(
    new java.util.Comparator[V] {
      def compare(a: V, b: V): Int = cmp(a, b)
    })
}

(new C[Int]) sort (_ - _) // error
(new C[Int]) sort ((_ - _): java.util.Comparator[Int]) // ok
(new C[Int]) sort ((a: Int, b: Int) => a - b)  // ok

The first attempt fails because the type checker cannot infer the types for _ - _'s arguments anymore.
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments the methods are applied to. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that Comparator[?] and (?, ?) => ? are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the Function2 overload).

Finally, implicit conversion of SAM types to Function types won't kick in anymore, since the compiler does this conversion itself first:

trait MySam { def apply(x: Int): String }

implicit def unused(fun: Int => String): MySam
  = new MySam { def apply(x: Int) = fun(x) }

// uses sam conversion, not the `unused` implicit
val sammy: MySam = _.toString

Changed syntax trees (affects macro and compiler plugin authors)

PR #4794 changed the syntax trees for selections of statically accessible symbols. For example, a selection of Predef no longer has the shape q"scala.this.Predef" but simply q"scala.Predef". Macros and compiler plugins matching on the old tree shape need to be adjusted.

Binary compatibility

Since Scala 2.11, minor releases of Scala are binary compatible with each other.
Scala 2.12 will continue this tradition: every 2.12.x release will be binary compatible with 2.12.0.
Milestone releases and release candidates, however, are not binary compatible with any other release.

Scala 2.12 is not and will not be binary compatible with the 2.11.x series. This allows us to keep improving the Scala compiler and standard library. We are working with the community to ensure that core projects in the Scala eco-system become available for 2.12. Please refer to this growing list of libraries and frameworks.

The Scala 2.11.1 release notes explain in more detail on how binary compatibility works in Scala. The same policies apply...

Read more

Scala 2.12.0-M4

04 Apr 23:33
v2.12.0-M4
Compare
Choose a tag to compare
Scala 2.12.0-M4 Pre-release
Pre-release

This milestone marks feature completeness for 2.12! Traits (#5003) and functions are compiled to their Java 8 equivalents, and we treat Single Abstract Method types and Scala's builtin function types uniformly from type checking to the backend (#4971). We also use invokedynamic for a more natural encoding of other language features (#4896). We've standardized on the GenBCode back-end (#4814, #4838) and the flat classpath implementation is now the default (#5057). The optimizer has been completely overhauled for 2.12. This milestone adds box/unbox optimization (#4858).

For more details about what's new in this milestone, including some breaking changes, please take a look at these 14 noteworthy PRs.

In total, we merged 135 pull requests, of which 16 PRs by new contributors -- welcome! This milestone resolves 49 JIRA tickets.

We'd especially like to thank Felix Mulder for his excellent work on the new Scaladoc interface! Check it out!

As usual for milestones, 2.12.0-M4 is not binary compatible with any other Scala release, including other 2.12 milestones. Scala 2.12 requires a Java 8 runtime.

Scala 2.12.0-M3-dc9effe

18 Mar 07:21
Compare
Choose a tag to compare
Pre-release

This is an internal release, to serve as a new STARR ahead of 2.12.0-M4.

The release is bootstrapped through the new trait encoding in #5003

Scala 2.11.8

09 Mar 03:27
v2.11.8
Compare
Choose a tag to compare

We are pleased to announce the availability of Scala 2.11.8!

Significant changes since 2.11.7 include:

  • The Scala REPL now has robust and flexible tab-completion (details below)
  • An assortment of bugs have been fixed

Compared to 2.11.7, this release resolves 44 issues. We merged 175 pull requests.

As usual for minor releases, Scala 2.11.8 is binary compatible with other releases in the Scala 2.11 series.

The last planned 2.11.x release will be 2.11.9 in late 2016.

New tab-completion in the Scala REPL

The implementation of tab-completion in the Scala REPL has been rewritten and now uses the same infrastructure as for example Scala IDE and ENSIME.

There are a number of improvements:

  • Reliable completion, also in partial expressions and syntactically incorrect programs: try class C { def f(l: List[Int]) = l.<TAB>
  • CamelCase completion: try (l: List[Int]).rro<TAB>, it expands to (l: List[Int]).reduceRightOption
  • Show desugarings performed by the compiler by adding //print: try for (x <- 1 to 10) println(x) //print<TAB>
  • Complete bean getters without typing get: try (d: java.util.Date).day<TAB>
  • Find members by typing any CamelCased part of the name: try classOf[String].typ<TAB> to get getAnnotationsByType, getComponentType and others
  • Complete non-qualified names, including types: try def f(s: Str<TAB>
  • Press tab twice to see the method signature: try List(1,2,3).part<TAB>, which completes to List(1,2,3).partition; press tab again to display def partition(p: Int => Boolean): (List[Int], List[Int])

Thanks to @retronym and @som-snytt for their fruitful collaboration on this work!

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests! You are all magnificent.

According to git shortlog -sn --no-merges v2.11.7..v2.11.8, 44 people contributed to this minor release: Seth Tisue, Jason Zaugg, Janek Bogucki, Lukas Rytz, Stefan Zeiger, A. P. Marki, Rex Kerr, Performant Data LLC, wpopielarski, Adriaan Moors, Vlad Ureche, Rui Gonçalves, vsalvis, martijnhoekstra, todesking, Li Yao, Frank S. Thomas, Igor Racic, Michał Pociecha, Kenji Yoshida, Tomas Janousek, dk14, jvican, stusmall, kirillkh, Alexey Romanov, Antoine Gourlay, Arnout Engelen, Eitan Adler, Felix Mulder, Gerard Basler, Jan Bessai, JoeRatt, Kirill Khazan, Linas Medziunas, Marconi Lanna, Mariot Chauvin, Michael, Parambir Singh, Paul Draper, Ryan Zhang, Simon Schäfer, Sébastien Doeraene, Tim Vergenz.

Obtaining Scala

Scala releases are available through a variety of channels, including (but not limited to):

Scala 2.11 Notes

The release notes for Scala 2.11.1 have important information applicable to the whole 2.11 series, such as:

  • Details on new features, important changes and deprecations since Scala 2.10.
  • The specification of binary compatibility between minor releases.

Scala 2.12.0-M3

06 Oct 14:55
v2.12.0-M3
Compare
Choose a tag to compare
Scala 2.12.0-M3 Pre-release
Pre-release

We are pleased to announce the availability of Scala 2.12.0-M3!

Significant changes since M2 include:

  • The REPL received a robust and flexible implementation of tab-completion (details below) - a fruitful collaboration between @som-snytt and @retronym
  • The @implicitAmbiguous annotation allows customizing the error message when an implicit search finds multiple ambiguous values (details below) - thanks @puffnfresh!
  • Enabling -Ywarn-unused-import now correctly warns about unused imports that were considered but discarded during an implicit search - thanks @som-snytt!
  • The optimizer now attempts to inline invocations of higher-order methods if the argument function is statically known, eliminating polymorphic callsites. (This work will be refined further in later milestones.)
  • The standard library no longer contains a clone of Java's fork/join library, but uses the one bundled in Java 8

Compared to M2, this release resolves 21 issues. We merged 49 pull requests.

As usual for milestones, 2.12.0-M3 is not binary compatible with any other Scala release, including other 2.12 milestones.

About Scala 2.12

The Scala 2.12 series targets Java 8. Programs written in Scala 2.12 must be compiled and run on Java 8 or newer.

Source compatibility

Scala 2.12 is mostly source compatible with 2.11. Code that compiles on 2.11.x without deprecation warnings should compile on 2.12.x too, unless you use experimental APIs such as reflection. If you find incompatibilities, please file an issue.

Binary compatibility

Since Scala 2.11, minor releases of Scala are binary compatible with each other.
Scala 2.12 will continue this tradition: every 2.12.x release will be binary compatible with 2.12.0.
Milestone releases and release candidates, however, are not binary compatible with any other release.

Scala 2.12 is not and will not be binary compatible with the 2.11.x series. This allows us to keep improving the Scala compiler and standard library. We are working with the community to ensure that core projects in the Scala eco-system become available for 2.12. Please refer to this growing list of libraries and frameworks.

The Scala 2.11.1 release notes explain in more detail on how binary compatibility works in Scala. The same policies apply to 2.12 as well.

New features

Future 2.12 milestones will include additional new features. For now, M3 includes the following major changes:

New backend

Scala 2.12 enables the "GenBCode" backend by default.

The new backend is more efficient than the default backend of Scala 2.11, because it directly generates ASM bytecode from Scala compiler trees, while the previous backend used an intermediate representation called "ICode".

Java 8 style closure classes

Scala 2.12 emits closures in the same style as Java 8.

For each lambda the compiler generates a method containing the lambda body.
At runtime, this method is passed as an argument to the LambdaMetaFactory provided by the JDK, which creates a closure object.

Compared to Scala 2.11, the new scheme has the advantage that the compiler does not generate an anonymous class for each lambda anymore.
This leads to significantly smaller JAR files.

Lambda syntax for SAM types (experimental)

As of M3, this feature is not yet on by default. You can enable it with the -Xexperimental compiler option.

When the option is enabled, then similar to Java 8, Scala 2.12 allows instantiating any type with one single abstract method by passing a lambda. This improves the experience of using libraries written for Java 8 in Scala.

This feature was also available in Scala 2.11, also via -Xexperimental.

New tab-completion in the Scala REPL

The implementation of tab-completion in the Scala REPL has been rewritten and now uses the same infrastruture as for example the Scala IDE or Ensime. Note that this feature will also be available in 2.11.8.

There are a number of improvements:

  • Reliable completion, also in partial expressions and syntactically incorrect programs: try class C { def f(l: List[Int]) = l.<TAB>
  • CamelCase completion: try (l: List[Int]).rro<TAB>, it expands to (l: List[Int]).reduceRightOption
  • Show desugarings performed by the compiler by adding //print: try for (x <- 1 to 10) println(x) //print<TAB>
  • Complete bean getters without typing get: try (d: java.util.Date).day<TAB>
  • Find members by typing any CamelCased part of the name: try classOf[String].typ<TAB> to get getAnnotationsByType, getComponentType and others
  • Complete non-qualified names, including types: try def f(s: Str<TAB>
  • Press tab twice to see the method signature: try List(1,2,3).part<TAB>, which completes to List(1,2,3).partition; press tab again to display def partition(p: Int => Boolean): (List[Int], List[Int])

Thanks to @som-snytt for helping out with this work!

New bytecode optimizer

The GenBCode backend includes a new inliner and bytecode optimizer.
The optimizer is enabled using the -Yopt:l:classpath compiler option.
Check -Yopt:help to see the full list of available options for the optimizer.

As of M3, the following optimizations are available:

  • Inlining final methods, including methods defined in objects and final methods defined in traits
  • If a closure is allocated and invoked within the same method, the closure invocation is replaced by an invocations of the corresponding lambda body method
  • Dead code elimination and a small number of cleanup optimizations

The work on the new optimizer is still ongoing. You can track it in the scala-dev repository issue tracker.

The @implicitAmbiguous annotation

The @implicitAmbiguous annotation allows customizing the error message when an implicit search finds multiple ambiguous values. Refer to the Scaladoc of the annotation class for an example.

Thanks to @puffnfresh for this contribution!

Unbundled features

The following modules have been removed from the Scala 2.12 distribution:

Breaking changes

Changed syntax trees (affects macro and compiler plugin authors)

PR #4794 changed the syntax trees for selections of statically accessible symbols. For example, a selection of Predef no longer has the shape q"scala.this.Predef" but simply q"scala.Predef". Macros and compiler plugins matching on the old tree shape need to be adjusted.

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests! You are all magnificent.

According to git shortlog -sn --no-merges 2.11.x..v2.12.0-M3, 44 people have contributed to Scala 2.12 so far: Lukas Rytz, Jason Zaugg, A. P. Marki, Rex Kerr, Adriaan Moors, Seth Tisue, Kato Kazuyoshi, Rui Gonçalves, Simon Ochsenreither, Max Bileschi, François Garillot, qilab gamma, jxcoder, Masato Sogame, Dominik Gruntz, Simon Schäfer, Kenji Yoshida, Todd Vierling, Viktor Klang, Alexey Romanov, Evgeny Vereshchagin, rubyu, Marc Siegel, dgruntz, Aleksandar Prokopec, Antoine Gourlay, Brian McKenna, Denis Rosset, Denton Cockburn, Erlend Hamnaberg, Eugene Dzhurinsky, Janek Bogucki, Lukas Elmer, Maks Atygaev, Malte Isberner, Nicolas Stucki, Paolo Giarrusso, Roman Hargrave, Shadaj, Steven Scott, Vojin Jovanovic, cchantep, harryhuk, martijnhoekstra. Thank you!

Thanks also to Miguel Garcia and James Iry for their substantial prior work on the new compiler backend.

Release notes

You can propose edits to these release notes on GitHub.

Obtaining Scala

Scala releases are available various ways, such as:

Scala 2.10.6

18 Sep 17:45
v2.10.6
Compare
Choose a tag to compare

Scala 2.10.6 resolves a license incompatibility in scala.util.Sorting, but is otherwise identical to Scala 2.10.5. A total of three pending backports were merged.

We strongly encourage you to upgrade to the latest stable version of Scala 2.11.x, as the 2.10.x series is no longer actively maintained.

Scala IDE

The current release of Scala IDE supports any 2.10.x release, and is available on the download site.

Release Notes for the Scala 2.10 Series

The release notes for the Scala 2.10 series, which also apply to the current minor release, are available in the release notes for Scala 2.10.4. They contain important information such as:

  • The specification of binary compatibility between minor releases.
  • Details on new features, important changes and deprecations in Scala 2.10.

Scala 2.12.0-M2

15 Jul 20:52
v2.12.0-M2
Compare
Choose a tag to compare
Scala 2.12.0-M2 Pre-release
Pre-release

We are pleased to announce the availability of Scala 2.12.0-M2!

We would like to highlight the following changes since M1:

  • Java 8 is now required.
  • Lambdas are compiled to Java 8 style closures.

Compared to M1, this release resolves 9 issues. We merged 29 pull requests.

As usual for milestones, 2.12.0-M2 is not binary compatible with any other Scala release, including other 2.12 milestones.

About Scala 2.12

Beginning with 2.12.0-M2, the Scala 2.12 series targets Java 8. Programs written in Scala 2.12, including the Scala 2.12 compiler, can only be executed on Java 8 or newer.

Source compatibility

2.12 is mostly source compatible with 2.11. Code that compiles on 2.11.x without deprecation warnings should compile on 2.12.x too, unless you use experimental APIs such as reflection. If you find incompatibilities, please file an issue.

Binary compatibility

Since Scala 2.11, minor releases of Scala are binary compatible with each other.
Scala 2.12 will continue this tradition: every 2.12.x release will be binary compatible with 2.12.0.
Milestone releases and release candidates, however, are not binary compatible with any other release.

2.12 is not and will not be binary compatible with the 2.11.x series. This allows us to keep improving the Scala compiler and standard library. We are working with the community to ensure that core projects in the Scala eco-system become available for 2.12. Please refer to this growing list of libraries and frameworks.

The Scala 2.11.1 release notes explain in more detail on how binary compatibility works in Scala. The same policies that applied to 2.11 will apply to 2.12 as well.

New features

Future 2.12 milestones will include additional new features. For now, M2 includes the following major changes:

New backend

Scala 2.12 enables the "GenBCode" backend by default.

The new backend is more efficient than the default backend of Scala 2.11, because it directly generates ASM bytecode from Scala compiler trees, while the previous backend used an intermediate representation called "ICode".

Java 8 style closure classes

Scala 2.12 emits closures in the same style as Java 8.

For each lambda the compiler generates a method containing the lambda body.
At runtime, this method is passed as an argument to the LambdaMetaFactory provided by the JDK, which creates a closure object.

Compared to Scala 2.11, the new scheme has the advantage that the compiler does not generate an anonymous class for each lambda anymore.
This leads to significantly smaller JAR files.

Lambda syntax for SAM types (experimental)

As of M2, this feature is not yet on by default. You can enable it with the -Xexperimental compiler option.

When the option is enabled, then similar to Java 8, Scala 2.12 allows instantiating any type with one single abstract method by passing a lambda. This improves the experience of using libraries written for Java 8 in Scala.

This feature was also available in Scala 2.11, also via -Xexperimental.

New Bytecode Optimizer

The GenBCode backend includes a new inliner and bytecode optimizer.
The optimizer is enabled using the -Yopt:l:classpath compiler option.
Check -Yopt:help to see the full list of available options for the optimizer.

As of M2, the following optimizations are available:

  • Inlining final methods, including methods defined in objects and final methods defined in traits
  • If a closure is allocated and invoked within the same method, the closure invocation is replaced by an invocations of the corresponding lambda body method
  • Dead code elimination and a small number of cleanup optimizations

The work on the new optimizer is still ongoing. You can track it in the scala-opt repository issue tracker.

Unbundled features

The following modules have been removed from the Scala 2.12 distribution:

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests! You are all magnificent.

According to git shortlog -sn --no-merges 2.11.x..v2.12.0-M2, 40 people have contributed to Scala 2.12 so far: Lukas Rytz, Jason Zaugg, A. P. Marki, Rex Kerr, Adriaan Moors, Kato Kazuyoshi, Max Bileschi, Rui Gonçalves, jxcoder, François Garillot, rubyu, Dominik Gruntz, Evgeny Vereshchagin, Kenji Yoshida, Marc Siegel, Masato Sogame, Simon Ochsenreither, Todd Vierling, Viktor Klang, Maks Atygaev, dgruntz, harryhuk, Denton Cockburn, Paolo Giarrusso, Denis Rosset, Roman Hargrave, Antoine Gourlay, Seth Tisue, Shadaj, Alexey Romanov, Steven Scott, Tim Vergenz, martijnhoekstra, Aleksandar Prokopec, Janek Bogucki, Eugene Dzhurinsky, cchantep, Lukas Elmer, Erlend Hamnaberg, Malte Isberner. Thank you!

Thanks also to Miguel Garcia and James Iry for their substantial prior work on the new compiler backend.

Release notes

You can propose edits to these release notes on GitHub.

Obtaining Scala

Scala releases are available various ways, such as:

Scala 2.11.7

23 Jun 22:28
v2.11.7
Compare
Choose a tag to compare

We are very pleased to announce the availability of Scala 2.11.7!

We would like to highlight the following changes:

  • Exhaustivity checking for pattern matching is now much snappier -- thank you @gbasler! (SI-9181)
  • A 300x more embeddable Scala REPL, brought to you by a team effort with Apache Spark. Thank you @ScrapCodes, @retronym & co! (#4548, #4563)
  • Scala also <3 INDYs -- experiment with all our favorite new Java 8 features as follows and get an exclusive sneak preview of 2.12.0-M2!
  • Oh, and the spec is now much spiffier! Thanks, @soc!

Compared to 2.11.6, this release resolves 53 issues. We merged 124 pull requests (out of 157). Before upgrading, please also check the known issues for this release.

As usual for minor releases, Scala 2.11.7 is binary compatible with other releases in the Scala 2.11 series.

The quarterly release schedule will continue for 2.11.x until the end of this year, and a few more quarters into 2016.

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests! You are all magnificent.

According to git shortlog -sn --no-merges v2.11.6..v2.11.7, 36 people contributed to this minor release: Lukas Rytz, Jason Zaugg, A. P. Marki, Grzegorz Kossakowski, Adriaan Moors, Rex Kerr, Simon Ochsenreither, Antoine Gourlay, Gérard Basler, Zhong Sheng, Kato Kazuyoshi, Michał Pociecha, Janek Bogucki, vsalvis, Prashant Sharma, Daniel Dietrich, Kenji Yoshida, YawarRaza7349, Simon Schäfer, Eugene Burmako, Guillaume Martres, Sean Riggin, Christoph Neijenhuis, Szabolcs Berecz, Bruno Bieth, dumpstate, esfandiar amirrahimi, nafg, swaldman, Alessandro Lacava, Geoffrey Knauth, Jean-Rémi Desjardins, EECOLOR, Niko Vuokko, Cody Allen, RobertZK. Thank you!

Obtaining Scala

Scala releases are available through a variety of channels, including (but not limited to):

Scala 2.11 Notes

The release notes for Scala 2.11.1 have important information applicable to the whole 2.11 series, such as:

  • Details on new features, important changes and deprecations since Scala 2.10.
  • The specification of binary compatibility between minor releases.

Scala 2.12.0-M1

05 May 14:03
v2.12.0-M1
Compare
Choose a tag to compare
Scala 2.12.0-M1 Pre-release
Pre-release

We are very pleased to announce the release of Scala 2.12.0-M1!

Code that compiles on 2.11.x without deprecation warnings should compile on 2.12.x (we do not guarantee this for experimental APIs, such as reflection). If not, please file an issue.

We are working with the community to ensure availability of the core projects of the Scala 2.12 eco-system. This release is not binary compatible with the 2.11.x series, to allow us to keep improving the Scala standard library.

The Scala 2.12 series targets Java 8. Programs written in Scala 2.12, including the Scala 2.12 compiler, can only be executed on Java 8 or newer. Note that the current milestone release (2.12.0-M1) still targets Java 6.

New Features in the 2.12 Series

Scala 2.12 contains all of the bug fixes and improvements made in the 2.11 series.

At the current stage in the milestone cycle, Scala 2.12 is still very similar to Scala 2.11.

The following changes are planned for Scala 2.12:

  • Java 8 style closures.
    The Scala compiler will emit closure classes (lambdas) in the same manner as Java 8.
    The design notes for this feature are available in this gist.
  • 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 avalable in Scala 2.11 using the -Xexperimental compiler option.
    It improves the experience of using libraries written for Java 8 in Scala.
  • New backend and optimizer.
    The "GenBCode" backend, which is already available in Scala 2.11 using the -Ybackend:GenBCode compiler option, will be enabled by default.
    Scala 2.12 will also ship with a new inliner and bytecode optimizer.
    We keep track of issues and work items for the new optimizer on the scala-opt repostiory issue tracker.

The above list is incomplete and will be extendend during the Scala 2.12 milestone cycle.

Up the current milestone, the Scala team and contributors fixed 47 bugs that are exclusive to Scala 2.12.0. During the development cycle of Scala 2.12, we will continue to backport issues to 2.11 whenever feasible. With the release of 2.12.0, backports to 2.11 will be dialed back.

Removed Modules

The following modules have been removed from the Scala 2.12 distribution:

  • The Scala actors library is no longer released with Scala 2.12.
    We recommend that you use the Akka actors library instead.
    To migrate your code, follow the Scala actors migration guide before upgrading your project to Scala 2.12.
  • The Scala distribution archives and the scala-library-all maven dependency no longer inlcude Akka actors.
    To use the Akka actors library, add it to your project as a dependency.
  • The continuations plugin is no longer shipped with the Scala 2.12 distribution.

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests! You are all magnificent.

According to git shortlog -sn --no-merges 2.11.x..v2.12.0-M1, 33 people contributed to this major release: Jason Zaugg, Lukas Rytz, A. P. Marki, Rex Kerr, Kato Kazuyoshi, Max Bileschi, jxcoder, François Garillot, rubyu, Adriaan Moors, Dominik Gruntz, Evgeny Vereshchagin, Marc Siegel, Masato Sogame, Simon Ochsenreither, Todd Vierling, Viktor Klang, cchantep, Denton Cockburn, Paolo Giarrusso, Denis Rosset, Roman Hargrave, Rui Gonçalves, Shadaj, harryhuk, Steven Scott, Antoine Gourlay, Aleksandar Prokopec, Lukas Elmer, Erlend Hamnaberg, Maks Atygaev, Malte Isberner, dgruntz. Thank you!

These release notes are hosted on GitHub and are continuously updated during the Scala 2.12.0 release cycle. You are kindly invited to contribute!

Reporting Bugs

Please file any bugs you encounter on our issue tracker. If you're unsure whether something is a bug, please contact the scala-user mailing list. Before creating a new issue, search search the issue tracker to see if your bug has already been reported.

Scala IDE for Eclipse

A release of the Scala IDE for Eclipse for Scala 2.12 will be available together with the release.

Note that for the current milestone (2.12.0-M1), the Scala IDE is not yet available.

Available Projects

Please refer to the list of libraries and frameworks available for Scala 2.12.

Binary Compatibility

Since Sala 2.11, minor releases of Scala are binary compatible. Scala 2.12 continues this tradition: every 2.12.x release will be binary compatible with 2.12.0. Note that milestone releases and release candidates are not binary compatible with any other release.

Definition

When two versions of Scala are binary compatible, it is safe to compile your project on one Scala version and link against another Scala version at run time. Safe run-time linkage (only!) means that the JVM does not throw a (subclass of) LinkageError when executing your program in the mixed scenario, assuming that none arise when compiling and running on the same version of Scala. Concretely, this means you may have external dependencies on your run-time classpath that use a different version of Scala than the one you're compiling with, as long as they're binary compatibile. In other words, separate compilation on different binary compatible versions does not introduce problems compared to compiling and running everything on the same version of Scala.

We check binary compatibility automatically with MiMa.

Forwards and Back

We distinguish forwards and backwards compatibility (think of these as properties of a sequence of versions, not of an individual version). Maintaining backwards compatibility means code compiled on an older version will link with code compiled with newer ones. Forwards compatibility allows you to compile on new versions and run on older ones.

Thus, backwards compatibility precludes the removal of (non-private) methods, as older versions could call them, not knowing they would be removed, whereas forwards compatibility disallows adding new (non-private) methods, because newer programs may come to depend on them, which would prevent them from running on older versions (private methods are exempted here as well, as their definition and call sites must be in the same compilation unit).

Meta

Note that so far we've only talked about the jars generated by scalac for the standard library and reflection.
Our policies do not extend to the meta-issue: ensuring binary compatibility for bytecode generated from identical sources, by different version of scalac? (The same problem exists for compiling on different JDKs.) While we strive to achieve this, it's not something we can test in general. Notable examples where we know meta-binary compatibility is hard to achieve: specialisation and the optimizer.

In short, if binary compatibility of your library is important to you, use MiMa to verify compatibility before releasing. Compiling identical sources with different versions of the Scala compiler (or on different JVM versions!) could result in binary incompatible bytecode. This is rare, and we try to avoid it, but we can't guarantee it will never happen.

Concretely

We guarantee forwards and backwards compatibility of the "org.scala-lang" % "scala-library" % "2.12.x" and "org.scala-lang" % "scala-reflect" % "2.12.x" artifacts, except for anything under the scala.reflect.internal package, as scala-reflect is still experimental. We also strongly discourage relying on the stability of scala.concurrent.impl and scala.reflect.runtime, though we will only break compatibility for severe bugs here.

The Last 2.10.x Release: 2.10.5

05 Mar 02:05
v2.10.5
Compare
Choose a tag to compare

With pride and a pang of nostalgia, we announce the availability of Scala 2.10.5 -- the last release in the 2.10.x series.

We'd like to encourage you to upgrade to 2.11.6 as soon as possible. (Please note that this announcement does not affect Typesafe's commercial support offering.)

Scala 2.10.5 is the final maintenance release in this series, and is binary compatible with previous releases in the Scala 2.10 series. We would like to highlight the following change:

  • We fixed a cross-site scripting vulnerability in Scaladoc's JavaScript. Many thanks to @todesking for discovering this, suggesting a fix, and for delaying disclosure until this release! This bug could be used to access sensitive information on sites hosted on the same domain as Scaladoc-generated documentation. All previous versions of Scaladoc are affected (Scala 2.11.6 includes the fix as well). We do recommend, as a general precaution, to host Scaladoc documentation on its own domain.

Compared to 2.10.4, this release resolves 10 issues. Out of 23, we merged 18 pull requests. Before upgrading, please also check the known issues for this release.

Scala IDE

The current release of Scala IDE supports any 2.10.x release, and is available on the download site.

Changes since 2.10.4

Library

XML Support

Compiler

Scaladoc

Macros/Reflection

Release Notes for the Scala 2.10 Series

The release notes for the Scala 2.10 series, which also apply to the current minor release, are available in the release notes for Scala 2.10.4. They contain important information such as:

  • The specification of binary compatibility between minor releases.
  • Details on new features, important changes and deprecations in Scala 2.10.

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in mailing lists and other public fora, and submitting and reviewing pull requests! You are all magnificent.

According to git shortlog -sn --no-merges v2.10.4..v2.10.5, the following people contributed to this minor release:
Jason Zaugg, Eugene Burmako, A. P. Marki, Adriaan Moors, Grzegorz Kossakowski, Antoine Gourlay, Jeroen ter Voorde, Kato Kazuyoshi, Miles Sabin, and Viktor Klang. Thank you!