Skip to content

Scala 2.13.0-M4

Pre-release
Pre-release
Compare
Choose a tag to compare
@lrytz lrytz released this 15 May 09:23
· 9949 commits to 2.13.x since this release
v2.13.0-M4

The 2.13 Scala collections have landed!

This is the first 2.13 milestone that includes the improved and simplified Scala collections library. We expect the API to mostly remain stable after this release, although there may still be minor changes in M5.

The goal for this release is to bootstrap the Scala ecosystem on the new collections.

Collections changes

The most important changes in the collections:

  • Transformation methods no longer have an implicit CanBuildFrom parameter. This makes the library easier to understand (in source code, Scaladoc, and IDE code completion). It also makes compiling user code more efficient.
  • The type hierarchy is simplified.Traversable no longer exists, only Iterable. (And as in previous milestones, parallel collections are now in a separate hierarchy in a separate module.)
  • scala.Seq is now an alias for scala.collection.immutable.Seq (no longer scala.collection.Seq) (note that this also changes the type of Scala varargs methods)
  • Views have been vastly simplified and should now work reliably. They no longer extend their corresponding collection type, for example, an IndexedSeqView no longer extends IndexedSeq.
  • The to[Collection] method was replaced by the to(Collection) method
  • collection.breakOut no longer exists, use .view and .to(Collection) instead
  • Immutable hash sets and hash maps have a new implementation (ChampHashSet and ChampHashMap, based on the "CHAMP" encoding). We are eager for reports of resulting performance changes.
  • New collection types:
    • immutable.ArraySeq is an effectively immutable sequence that wraps an array
    • immutable.LazyList is a lazy linked list that is lazy in both the head and the tail. immutable.Stream (only lazy in the tail) is deprecated.
  • Deprecated collections were removed (MutableList, immutable.Stack, others)

To learn more about those changes and how to adapt your code, take a look at the FAQ wiki page. This document is intended for library maintainers and assumes familiarity with the 2.12 Scala collections. User documentation will be made available for the next milestone.

Other changes

Other notable changes in Scala 2.13.0-M4:

  • The scala-xml library is no longer bundled with the release, and scala-compiler no longer has a scala-xml dependency #6436
  • Procedure syntax (def m() { ... }) is deprecated #6325
  • View bound syntax (A <% B) is deprecated #6500
  • -Y and -X flags that affect language semantics were removed #6505
  • Methods with no parameter lists, or only an empty parameter list, are no longer eta-expanded (val f: () => Any = someMethod). Explicit eta-expansion is required (someMethod _). #6475
  • Partial unification (#5102) is enabled by default (and thus -Ypartial-unification is no longer accepted)
  • The "macro paradise" compiler plugin is incorporated into the compiler. Instead of using the plugin, macro annotations can be enabled with the -Ymacro-annotations flag. #6606
  • Assorted deprecated methods and classes have been removed

For more details, see closed bugs and merged PRs.

See also the notes for the previous milestones: M3, M2, M1.

The compiler performance in 2.13 is 5-10% better compared to 2.12. The integration of the new collections library shows up in the performance graph as a nice improvement.

Contributors

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

A special congratulations to @julienrf from the Scala Center, the top contributor this cycle due to his tireless work on the new collections. Especially significant external contributors to the collections work were @odd, @marcelocenerine, and @msteindorfer; others are included below. A special welcome to newcomer @NthPortal, and a shoutout to the growing team of regulars who keep the scala/scala PR queue filled with excellence and conviviality.

This release was brought to you by 76 contributors, according to git shortlog -sn --no-merges ^e2a211c ^v2.13.0-M3 v2.13.0-M4. Thank you Julien Richard-Foy, Lukas Rytz, Stefan Zeiger, Jason Zaugg, Marcelo Cenerino, Martin Odersky, Odd Möller, A. P. Marki, Adriaan Moors, Seth Tisue, Ólafur Páll Geirsson, Harrison Houghton, Eugene Yokota, NthPortal, Miles Sabin, Guillaume Martres, Aggelos Biboudis, Mike Skells, Martijn Hoekstra, jvican, Xavier Fernández Salas, awibisono, Allan Renucci, BuildTools, Ethan Pronovost, Jimin Hsieh, Cong Zhao, howtonotwin, Kenji Yoshida, Georgi Krastev, Heikki Vesalainen, Piotr Kukielka, Danila Matveev, Nicolas Stucki, Dale Wijnand, Stephen Nancekivell, Aaron S. Hawley, Jasper Moeys, Tim Ruhland, Viktor Klang, Isaac Levy, Philippus Baalman, Alex Levenson, Rob Norris, Ryan Williams, Chujie Zeng, Shohei Shimomura, Antoine Gourlay, Sébastien Doeraene, Vince, esarbe, Iaroslav Zeigerman, ke-to, kelebra, mmocentre, roman, sh0hei, Alex Glukhovtsev, Iulian Dragos, Jeff Brower, Jeff Shaw, Jonathan Frawley, Håkon Hjelde Wold, Kentaro Tokutomi, LPTK, Dhanesh Arole, Dhanesh, David Hoepelman, Matthias Sperl, Michael Steindorfer, Daniel Moss, Oleksii Tkachuk, Paolo Giarrusso, Pathikrit Bhowmick, Peter Fraenkel, Rex Kerr.

Obtaining Scala

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