After many months of development, and a large number of bug fixes, the Scala Team has released the next version of their concise, JVM-based programming language. Scala 2.8
is a major release that includes a redesigned collection library, manifests for polymorphic arrays, type specialization, and improvements to the Scala IDE. Tools like Scaladoc, Sbaz, and Scalap have gotten enhancements along with other aspects of Scala. Developers should be aware that Scala 2.8 is not binary compatible with the 2.7 branch. The final release is expected within the next few months.
Uniform collection library
Scala 2.8 features a completely revamped collection library. In past versions of Scala, the collection classes suffered from inconsistencies and a lack of functionality. The library is now organized more efficiently, allowing easier implementation of new collections. The design optimizes sharing and code reuse while maintaining backwards compatibility.Named and default arguments
Named and default arguments work together so developers can choose one parameter by name and use defaults for the others. Named arguments look like assignments to the called method's formal parameter names. Default arguments reduce code duplication and they enable "copy" methods for case classes. This allows generation of quickly modified case class copies. The named arguments can be used to selectively change copied instance values.New array implementation, manifests for polymorphic arrays
Array handling has been optimized and simplified in Scala 2.8. The scheme uses implicit conversations and manifests to integrate arrays into the new collection library. This method is much more predictable in terms of implicit conversions.Type specialization
Scala 2.8's specialized type parameters allow the compiler to transparently generate multiple versions of a definition. The type parameters also use the most specific version if the static type information at a call site allows it.
Package objects optionsBesides
classes and objects also
methods can now be contained within packages. They are added by declaring a package object. The Scala Team says Package objects are still a work in progress and could see more improvements before the GA release.
Scala Swing libraries
The Scala Swing libraries have grown in 2.8 and the documentation has improved. There are additional demos, the window subhierarchy has been refactored, components publish key events, impute events can be consumed, there's lazy Swing listener installation, and more complete component caching.Enhanced REPL
Along with bug fixes, the history is now searchable and there's integrated shell access. There's tab-completion for all packages on the classpath along with object and instance methods and fields, including type aliases and package objects. The power mode offers direct access to compiler internals.Java Annotations
There is now support for nested java annotations. For annotations on fields, developers can specify which synthetic members (getter / setter) will have the annotation.
The new compiler infrastructure for Scala 2.8 provides a better platform for building IDE plugins. Speed is up by 50% in some cases and a new build manager is available.Scala Eclipse Plugin
The Scala plugin for Eclipse
has improved JDT integration and a new build manager. The plugin will be getting its own launch schedule and does not support Scala 2.7 or lower. The Scala IDE has been reworked so that it can be reused by non-Eclipse IDEsScaladoc 2
There are graphical improvements in Scaladoc 2 along with automatic comments expansion. There's now a wiki-like syntax and compile-time error checking as well.Sbaz 2
During long downloads and dependency audit diagnostics, Sbaz gives better feedback. Support for pack200 has been added, which reduces file sizes by 70% in some cases. Sbaz can now update itself reliably and it can work on Windows using cmd or cygwin.Scalap
The new Scalap is aware of package objects and can decompile them by using <package_name>.package