RELEASE
We are very pleased to announce the release of Scala 2.11.1!
This release contains an important fix for serialization, which was broken in Scala 2.11.0 (SI-8549). The fix necessarily breaks serialization compatibility between 2.11.0 and 2.11.1 (this is separate from binary compatibility, which is maintained).
Users of distributed systems that rely on serialization to exchange objects (such as akka) should upgrade to Scala 2.11.1 (and akka 2.3.3) immediately. We also strongly recommend that libraries that themselves declare classes with @SerialVersionUID
annotations release a new version and ask their Scala 2.11 users to upgrade.
We apologize for the breakage. We have included a new suite of tests that will ensure stability of serialization for the remainder of the 2.11.x series.
Compared to 2.11.0, this release fixes 26 issues. We reviewed and merged 51 pull requests.
The next minor Scala 2.11 release will be available in at most 2 months, or sooner if prompted by a serious issue.
The remainder of these release notes summarizes the 2.11.x series, and as such is not specific to this minor release.
UpgradingCode that compiled on 2.10.x without deprecation warnings should compile on 2.11.x (we do not guarantee this for experimental APIs, such as reflection). If not, please file a regression. We are working with the community to ensure availability of the core projects of the Scala 2.11.x eco-system, please see below for a list. This release is not binary compatible with the 2.10.x series, to allow us to keep improving the Scala standard library.
Required Java VersionThe Scala 2.11.x series targets Java 6, with (evolving) experimental support for Java 8. In 2.11.1, Java 8 support is mostly limited to reading Java 8 bytecode and parsing Java 8 source. Stay tuned for more complete (experimental) Java 8 support. The next major release, 2.12, will most likely target Java 8 by default.
New features in the 2.11 seriesThis release contains all of the bug fixes and improvements made in the 2.10 series, as well as:
HashMap
s and HashSet
s perform faster filters, unions, and the like, with improved structural sharing (lower memory usage or churn).LongMap
and AnyRefMap
have been added to provide improved performance when keys are Long
or AnyRef
(performance enhancement of up to 4x or 2x respectively).BigDecimal
is more explicit about rounding and numeric representations, and better handles very large values without exhausting memory (by avoiding unnecessary conversions to BigInt
).List
has improved performance on map
, flatMap
, and collect
.scala-library
â as explained above.-Ydelambdafy:method
anonymous functions are compiled faster, with a smaller bytecode footprint. This works by keeping the function body as a private (static, if no this
reference is needed) method of the enclosing class, and at the last moment during compilation emitting a small anonymous class that extends FunctionN
and delegates to it. This sets the scene for a smooth migration to Java 8-style lambdas (not yet implemented).incOptions := incOptions.value.withNameHashing(true)
to your build! Other build tools are also supported. More info at this sbt issue â thatâs where most of the work happened. More features are planned, e.g. class-based tracking.-Xlint
warnings
var
could be a val
.The Scala team and contributors fixed 655 bugs that are exclusive to Scala 2.11! We also backported as many as possible. With the release of 2.11, 2.10 backports will be dialed back.
A big thank you to everyone whoâs helped improve Scala by reporting bugs, improving our documentation, participating in mailing lists and other public fora, and â of course â submitting and reviewing pull requests! You are all awesome.
Concretely, according to git log --no-merges --oneline 2.11.x --not 2.10.x --format='%aN' | sort | uniq -c | sort -rn
, 115 people contributed code, tests, and/or documentation to Scala 2.11.x: Paul Phillips, Jason Zaugg, Eugene Burmako, Adriaan Moors, A. P. Marki, Simon Ochsenreither, Den Shabalin, Miguel Garcia, James Iry, Iain McGinniss, Grzegorz Kossakowski, Rex Kerr, François Garillot, Vladimir Nikolaev, Eugene Vigdorchik, Lukas Rytz, Mirco Dotta, Rüdiger Klaehn, Antoine Gourlay, Raphael Jolly, Simon Schaefer, Kenji Yoshida, Paolo Giarrusso, Luc Bourlier, Hubert Plociniczak, Aleksandar Prokopec, Vlad Ureche, Lex Spoon, Andrew Phillips, Sébastien Doeraene, Josh Suereth, Jean-Remi Desjardins, Vojin Jovanovic, Viktor Klang, Valerian, Prashant Sharma, Pavel Pavlov, Michael Thorpe, Jan Niehusmann, Iulian Dragos, Heejong Lee, George Leontiev, Daniel C. Sobral, Christoffer Sawicki, yllan, rjfwhite, Volkan Yazıcı, Ruslan Shevchenko, Robin Green, Roberto Tyley, Olivier Blanvillain, Mark Harrah, James Ward, Ilya Maykov, Eugene Yokota, Erik Osheim, Dan Hopkins, Chris Hodapp, Antonio Cunei, Andriy Polishchuk, Alexander Clare, æ¨å, srinivasreddy, secwall, nermin, martijnhoekstra, kurnevsky, jinfu-leng, folone, Yaroslav Klymko, Xusen Yin, Trent Ogren, Tobias Schlatter, Thomas Geier, Stuart Golodetz, Stefan Zeiger, Scott Carey, Samy Dindane, Sagie Davidovich, Runar Bjarnason, Roland Kuhn, Robert Nix, Robert Ladstätter, Rike-Benjamin Schuppner, Rajiv, Philipp Haller, Nada Amin, Mike Morearty, Michael Bayne, Marcin Kubala, Luke Cycon, Lee Mighdoll, Konstantin Fedorov, Julio Santos, Julien Richard-Foy, Juha Heljoranta, Johannes Rudolph, Jiawei Li, Jentsch, Jason Swartz, James Roper, Heather Miller, Havoc Pennington, Guillaume Martres, Evgeny Kotelnikov, Dmitry Petrashko, Dmitry Bushev, David Hall, Daniel Darabos, Dan Rosen, Cody Allen, Carlo Dapor, Brian McKenna, Andrey Kutejko, Alden Torres.
Thank you all very much.
If you find any errors or omissions in these relates notes, please submit a PR!
Reporting Bugs / Known IssuesPlease file any bugs you encounter. If youâre unsure whether something is a bug, please contact the scala-user mailing list.
Before reporting a bug, please have a look at these known issues.
Scala IDE for EclipseThe Scala IDE with this release built in is available from this update site for Eclipse 4.2/4.3 (Juno/Kepler). Please have a look at the getting started guide for more info.
Available projectsThe following Scala projects have already been released against 2.11! See also @jrudolphâs analysis of the availability of 2.11 builds of popular libraries (as well as which ones are missing); updated regularly.
Weâd love to include your release in this list as soon as itâs available â please submit a PR to update these release notes.
"org.scalacheck" %% "scalacheck" % "1.11.4"
"org.scalatest" %% "scalatest" % "2.1.7"
"org.scalautils" %% "scalautils" % "2.1.7"
"com.typesafe.akka" %% "akka-actor" % "2.3.3"
"com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2"
"org.scala-lang.modules" %% "scala-async" % "0.9.1"
"org.scalikejdbc" %% "scalikejdbc-interpolation" % "2.0.0"
"com.softwaremill.scalamacrodebug" %% "macros" % "0.4"
"com.softwaremill.macwire" %% "macros" % "0.6"
"com.chuusai" %% "shapeless" % "1.2.4"
"com.chuusai" %% "shapeless" % "2.0.0"
"org.nalloc" %% "optional" % "0.1.0"
"org.scalaz" %% "scalaz-core" % "7.0.6"
"com.assembla.scala-incubator" %% "graph-core" % "1.8.1"
"com.nocandysw" %% "platform-executing" % "0.5.0"
"com.qifun" %% "stateless-future" % "0.2.2"
"com.github.scopt" %% "scopt" % "3.2.0"
"com.dongxiguo" %% "commons-continuations" % "0.2.2"
"com.dongxiguo" %% "memcontinuationed" % "0.3.2"
"com.dongxiguo" %% "fastring" % "0.2.4"
"com.dongxiguo" %% "zero-log" % "0.3.5"
"com.github.seratch" %% "ltsv4s" % "1.0.0"
"com.googlecode.kiama" %% "kiama" % "1.6.0"
"org.scalamock" %% "scalamock-scalatest-support" % "3.1.1"
"org.scalamock" %% "scalamock-specs2-support" % "3.1.1"
"com.github.nscala-time" %% "nscala-time" % "1.0.0"
"com.github.xuwei-k" %% "applybuilder70" % "0.1.3"
"com.github.xuwei-k" %% "nobox" % "0.1.9"
"org.typelevel" %% "scodec-bits" % "1.0.0"
"org.typelevel" %% "scodec-core" % "1.0.0"
"com.sksamuel.scrimage" %% "scrimage" % "1.3.20"
"net.databinder" %% "dispatch-http" % "0.8.10"
"net.databinder" %% "unfiltered" % "0.8.0"
"net.databinder" %% "unfiltered" % "0.7.1"
"io.argonaut" %% "argonaut" % "6.0.4"
"org.specs2" %% "specs2" % "2.3.12"
"com.propensive" %% "rapture-core" % "0.9.0"
"com.propensive" %% "rapture-json" % "0.9.1"
"com.propensive" %% "rapture-io" % "0.9.1"
"org.scala-stm" %% "scala-stm" % "0.7"
"org.parboiled" %% "parboiled-scala" % "1.1.6"
"io.spray" %% "spray-json" % "1.2.6"
"org.scala-libs" %% "scalajpa" % "1.5"
"com.casualmiracles" %% "treelog" % "1.2.3"
"org.monifu" %% "monifu" % "0.9.3"
"org.mongodb" %% "casbah" % "2.7.2"
"com.clarifi" %% "f0" % "1.1.2"
"org.scalaj" %% "scalaj-http" % "0.3.15"
The following libraries are specific to the 2.11.x minor release youâre using. If you depend on them, you should also cross-version fully!
"org.scalamacros" % "paradise" % "2.0.0" cross CrossVersion.full
Cross-building with sbt 0.13
When cross-building between Scala versions, you often need to vary the versions of your dependencies. In particular, the new scala modules (such as scala-xml) are no longer included in scala-library, so youâll have to add an explicit dependency on it to use Scalaâs xml support.
Hereâs how we recommend handling this in sbt 0.13. For the full build and Maven build, see example.
scalaVersion := "2.11.1"
crossScalaVersions := Seq("2.11.1", "2.10.3")
// add scala-xml dependency when needed (for Scala 2.11 and newer)
// this mechanism supports cross-version publishing
libraryDependencies := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
libraryDependencies.value :+ "org.scala-lang.modules" %% "scala-xml" % "1.0.1"
case _ =>
libraryDependencies.value
}
}
Important changes
For most cases, code that compiled under 2.10.x without deprecation warnings should not be affected. Weâve verified this by compiling a sizeable number of open source projects in the Scala community build.
Changes to the reflection API may cause breakages, but these breakages can be easily fixed in a manner that is source-compatible with Scala 2.10.x. Follow our reflection/macro changelog for detailed instructions.
Weâve decided to fix the following more obscure deviations from specified behavior without deprecating them first.
x match { case _ : Foo.type => }
to Foo eq x
, as specified. It used to be Foo == x
(without warning). If thatâs what you meant, write case Foo =>
.class Foo[T] { private val bar: T = ???; new Foo[String] { bar: String } }
, as the bar
in bar: String
refers to the bar
with type T
. The Foo[String]
âs bar
is not inherited, and thus not in scope, in the refinement. (Example from SI-8371, see also SI-8426.)The following changes were made after a deprecation cycle (Thank you, @soc, for leading the deprecation effort!)
Finally, some notable improvements and bug fixes:
serialVersionUID
field for classes annotated with @SerialVersionUID
. The Scala standard library itself was a victim of this bug. As such, collections serialized in 2.11.0 will not be able to be deserialized in 2.11.1. This regression occurred in a failed attempt to fix a related bug in 2.10.x, SI-6988, whereby classes annotated with non literal UIDS, e.g. 0L - 123L
, had no field generated.To catch future changes like this early, you can run the compiler under -Xfuture, which makes it behave like the next major version, where possible, to alert you to upcoming breaking changes.
DeprecationsDeprecation is essential to two of the 2.11.x seriesâ three themes (faster/smaller/stabler). They make the language and the libraries smaller, and thus easier to use and maintain, which ultimately improves stability. We are very proud of Scalaâs first decade, which brought us to where we are, and we are actively working on minimizing the downsides of this legacy, as exemplified by 2.11.xâs focus on deprecation, modularization and infrastructure work.
The following language âwartsâ have been deprecated:
extends App
idiom. We wonât drop DelayedInit
until thereâs a replacement for important use cases. (More details and a proposed alternative.).withFilter
to .filter
: you must implement withFilter
to be compatible with for-comprehensions.()
on missing argument lists.Weâd like to emphasize the following library deprecations:
final
. Proxies and wrappers that were not adequately implemented or kept up-to-date have been deprecated, along with other minor inconsistencies.scala.concurrent.future
and scala.concurrent.promise
round
on Int
and Long
(#3581).Deprecation is closely linked to source and binary compatibility. We say two versions are source compatible when they compile the same programs with the same results. Deprecation requires qualifying this statement: âassuming there are no deprecation warningsâ. This is what allows us to evolve the Scala platform and keep it healthy. We move slowly to guarantee smooth upgrades, but we want to keep improving as well!
Binary CompatibilityWhen 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. We strive to maintain a similar invariant for the behavior
(as opposed to just linkage) of the standard library, but this is not checked mechanically (Scala is not a proof assistant so this is out of reach for its type system).
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).
These are strict constraints, but they have worked well for us in the Scala 2.10.x series. They didnât stop us from fixing 372 issues in the 2.10.x series post 2.10.0. The advantages are clear, so we will maintain this policy in the 2.11.x series, and are looking (but not yet commiting!) to extend it to include major versions in the future.
MetaNote 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.
ConcretelyJust like the 2.10.x series, we guarantee forwards and backwards compatibility of the "org.scala-lang" % "scala-library" % "2.11.x"
and "org.scala-lang" % "scala-reflect" % "2.11.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.
Note that we will only enforce backwards binary compatibility for the new modules (artifacts under the groupId org.scala-lang.modules
). As they are opt-in, itâs less of a burden to require having the latest version on the classpath. (Without forward compatibility, the latest version of the artifact must be on the run-time classpath to avoid linkage errors.)
Finally, Scala 2.11 introduces scala-library-all
to aggregate the modules that constitute a Scala release. Note that this means it does not provide forward binary compatibility, whereas the core scala-library
artifact does. We consider the versions of the modules that "scala-library-all" % "2.11.x"
depends on to be the canonical ones, that are part of the official Scala distribution. (The distribution itself is defined by the new scala-dist
maven artifact.)
Scala is now distributed under the standard 3-clause BSD license. Originally, the same 3-clause BSD license was adopted, but slightly reworded over the years, and the âScala Licenseâ was born. Weâre now back to the standard formulation to avoid confusion.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4