This page is no longer maintained — Please continue to the home page at

Scala 2.8 Preview

After 2.7.4, the next major release of Scala will be 2.8. This version will make a rather bigger jump ahead than previous releases. It will fix many outstanding tickets, and include several changes and additions. Read below for more!

Features Included in Scala 2.8

At least the following new features will be included:

  • Redesigned collection libraries. Scala's collection class hierarchy has been redesigned to be more regular, expressive, and performant.  A snapshot of the new design is contained in the 2.8.0x branch of Scala's subversion repository. A white paper explaining the new design is forthcoming. The redesign is done so that most user code should  be unaffected. However, implementations of collections such as sequences, sets or maps will need to be re-adapted to the new framework to use its full functionality.
  • Named and default arguments. Method arguments can be passed by names, and method parameters can have default values.
  • Package objects. Packages can now be defined not just by files in some directory, but in addition by a special object that lists additional members of the package. For instance, you could add a number of type aliases, which would then be visible as members of the package. This functionality is used in the new collection libraries to ensure backwards compatibility. For instance class List in the new library will live in package scala.collection.immutable. But code that accesses it as a scala.List will still work, because there is a package object definition like this:
    package object scala
      type List[+A] = scala.collection.immutable.List[A]
      val List = scala.collection.immutable.List
  • Beefed up Scala Swing libraries. There will be new functionality and better documentation in the scala.swing package.
  • Support for continuations. A compiler plugin will support continuations as an optional feature of Scala, using a type-directed continuation passing transform. Continuations are useful to implement advanced control constructs, for instance for asynchronous I/O, user interface event handling, or dataflow concurrency.
  • Type specialization. A new @specialize annotation on a type parameter will produce specialized versions of the generic code for primitive types. This makes it possible to avoid costly boxing and unboxing operations for higher-order functions or generic data structures such as arrays. It can lead to important speedups.
  • Revamped REPL. Scala's interpreter loop will have a lot of new functionality. In particular command completion will work.
  • Packrat parser combinators Scala's combinator parser library will be upgraded to "packrat parsing". This helps efficiency and also permits more grammar styles to be expressed as parsers. For instance, left-recursive productions can now be handled.

The 2.8 version will also drop most operations that were deprecated in earlier versions, and will no longer support the old version 1.4 of the Java Virtual Machine. The class file format and compilation internals will be changed to some degree, so that programs compiled under 2.8 will not be compatible with binaries compiled earlier. Source compatibility should be by and large assured, however.

Finally, concerning the timeframe, we want to have the first beta out at the beginning of June. So that's just 6 more weeks!


Re: Scala 2.8 Preview

I'm pleasantly surprised that named and default arguments made it into 2.8. I liked the proposal -- particularly since I like similar APIs in Perl -- but there was something about it that didn't seem to be quite de Scala thing.


Anyway, I'm also surprised continuations will be supported only through a compiler plugin. What is the trade off on making it default on the compiler?


Re: Scala 2.8 Preview

Given the break with backwards compatibility it would seem like a good moment to up the major version number to 3.

Re: Scala 2.8 Preview

Hm. I'm kind of disappointed to see that ticket #6b6b6b ( has not made it into 2.8 yet. Support for nested JAVA-annotations is increasingly important for using modern frameworks (JPA and Struts-2.1) which rely heavily on annotations.


Re: Scala 2.8 Preview

I second that. Nested annotations are very important espacially in regard to JPA. As I understood it, it could not be implemented so far as it depends on the named-parameters feature. And this will be available in 2.8. So I still got the hope that it will make into 2.8, too!

Apart from that, the new feature list looks very promising! I can't await 2.8 final.

Best regards


Re: Scala 2.8 Preview

 Yep, this one is important, also a useful one for helping to get Scala into the workplace, swap out Java for leaner domain layers!


 - Ross

Re: Scala 2.8 Preview

Hi, I'm currently developing a library named Scalaffinity and I really need nested annotations to work properly with JPA. I have commented out many-to-many relationships waiting for this feature to be released, as well as Hibernate @CollectionOfElements. I think nested annotations are just urgent.

Re: Scala 2.8 Preview

+1 on the nested annotations/jpa thing.  

Re: Scala 2.8 Preview

+1 for nested annotations per trac ticket #6b6b6b.

Re: Scala 2.8 Preview

This has  been implemented in trunk five weeks ago, so the next version of Scala will support nested annotations.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland