According to an official update, the Scala team announced the release the new version — Scala 2.13 that brings overhauled standard library and a number of improvements including a faster compiler and more.
Contents
What is Scala?
Scala is a high-level programming language based on object-oriented and functional programming paradigms.
This programming language comes with static types that help developers avoid bugs in a complex application. On the other hand, its JVM and JavaScript runtimes enable developers to build high-performance systems using a huge ecosystem of libraries.
Read:Â Why Programmers Should Learn Scala Programming?
New Features and Updates in Scala 2.13
Overhauled Standard Library Collections
This is one of the major highlights of Scala 2.13. The standard library collections are now improved in terms of simplicity, performance, and safety as compared to previous versions. Some of the important changes are as follows:
New Concrete Collections
In Scala 2.13, the Stream collection is replaced by LazyList that not only evaluates elements in order but only when needed.
It comes with a new mutable.CollisionProofHashMap collection that implements mutable maps using a hashtable using red-black trees in the buckets. This ensures good performance even in cases like hash collisions.
The mutable.ArrayDeque collection, a double-ended queue is also added, that uses a resizable circular buffer internally.
Simpler Method Signatures
With the new version, the transformation methods cannot take an implicit ‘CanBuildFrom’ parameter. This will result in making code simpler and easier to understand.
Simpler Type Hierarchy
The package scala.collection.parallel is now a part of the Scala standard module. With Scala 2.13, this module will be available as a separate JAR which you can also drop if it does not use parallel collections. Furthermore, Traversable and TraversableOnce are now deprecated.
Changes in the Scala Language
The new release of Scala introduces literal-based singleton types, partial unification, and by-name method arguments are now extended to support both implicit and explicit parameters.
Improved Concurrency
Futures are internally redesigned to provide expected behavior in a broader set of failures. The updated Futures will also set the grounds for increased performance and robust applications.
Also Read:Â Top 5 Highest Paying Programming Languages of 2019
Changes in Compiler
The compiler has improved a lot as compared to the previous version. It’s now able to perform deterministic and reproducible compilation. It basically means the upgraded compiler of Scala 2.13 can now generate identical output for identical input in various cases.
Overall, the collections and arrays operations are now optimized making the compiler 5-10% better than Scala 2.12.
These are some of the features and updates in the new release of Scala. If you’re interested, you can check out the full release notes here.