Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Scala 2.8 Beta 1 Released

Scala 2.8 Beta 1 Released

This item in japanese

The creators of the Scala programming language have just released the long-awaited first beta of Scala 2.8

It includes a huge number of bug fixes with respect to 2.7.7, and many new features. This beta is the foundation for the release of the upcoming final version of 2.8.0, expected in a few months.

The small increase in the version number (from 2.7.7) does not properly reflect how many changes the language has undergone. Unfortunately, Scala 2.8 is not binary compatible with the 2.7 branch.

Some examples of new features are (see the release announcement for a comprehensive listing): 

Redesigned Collection Library

Scala's collection library has been completely redesigned. It is now not only easier to implement new collections, users will also notice the benefits (while being mostly backwards compatible), as Daniel Sobral remarked on the Scala-User mailinglist

Scala 2.7 doesn't have the necessary power to make a "map" that returns a "Map" from a "Map". Being able to do things like that is the main reason for the new collection library in Scala 2.8."

More on the new collections can be found in this entry on the Scala website

Named and Default Arguments

Scala 2.8 also offers new language features, like the new named and default arguments. Named arguments look like assignments to the names of the called method's formal parameters: 

def resize(width: Int = 800, height: Int = 600) = { ... }
resize(width = 120, height = 42)

 Named and default arguments work hand in hand; one can pick a certain parameter by its name and use defaults for the others: 

resize(height = 42) 

These novelties are also used in another new feature: case classes have a copy method whose parameters default to the current values. Using named arguments, one can selectively change values for the copied instance, as shown on the Scala website

Improved Interactive Interpreter

Scala's interactive interpreter has become a lot more powerful with support for tab-completion on packages, classes, and members. The feature uses reflection, and works not only for Scala code but just as well with Java. A blog post by Arjan Blokzijl explores more of the new features. 

Improved Eclipse Plug-in

A new version of the Scala Eclipse plug-in will be released along with Scala 2.8. Integration with the JDT has been greatly improved; a new build manager makes compilation much faster and more reliable. A presentation by Miles Sabin (PDF), the main developer of the Scala plug-in, has further details about the work that has happened last year.

InfoQ also talked to Miles to learn more about the current status and the future of the IDE. The IDE comes with support for the new version of Scala, but does it also support Scala 2.7? 

The IDE is currently intrinsically linked to the compiler ... it's the latter that drives all of the IDEs semantically sensitive features. It will be possible to loosen the dependency a little to support multiple versions for releases beyond 2.8, but unfortunately not for earlier versions. For now I recommend that people create separate Eclipse instances for work on the 2.7 vs. 2.8 streams.

A recent meeting report mentioned that the Scala IDE will get its own release schedule, what is the intention behind that? 

With the 2.8 stream, the IDE is on a much more solid footing that it has been previously. It should be possible to move forward more quickly now, and we need to option of releasing more frequently than the main Scala toolchain.

What are your plans for the future of the IDE? 

My goal is for the Scala tooling to be at least on a par with the tooling for Java. There's a way to go on that, but we can get there. 
With the 2.8 final release I hope to launch a dedicated web presence for the IDE which will be the primary source for releases on the new cycle, will collect the existing but somewhat scattered documentation and resources for the IDE, and be a central organizing point for users and contributors.

Of course, the Eclipse IDE is not the only one with support for 2.8; NetBeans and IntelliJ are on their way too. 

Scala Days 2010

On April 15-16, Scala enthusiasts will meet at Scala's birthplace, the EPFL in Lausanne, Switzerland, for the first Scala Days, "to exchange ideas and form business relations, as well to discover the latest practical and theoretical development concerning the Scala language".

Get the Scala 2.8 Beta, and make sure to report bugs and problems so they can be fixed for the final release, which should be ready "in a few months".

Rate this Article