Saturday , October 23 2021

The Scala programming language 2.13 offers better handling of collections


Again it took about two and a half years, so far with 2.13.0 a new major release of the Scala programming language appeared. The new version of the library focuses on libraries and brings only minor syntax changes. The focus of the current language version is the simplified handling of collections.

The Collections API was introduced in Scala 2.8 in the programming language and offers a broadly uniform treatment of different types of collections, such as map. stratagem and Seq, With version 2.13, some changes are added, which should create more clarity and simplify usage. The declared goal is to keep Collections as compatible as possible with Scala 2.12 and to accept only unavoidable changes to break.

One innovation here is that traversable excluded, so far on Iterable in the hierarchy, but had this as a single subtype. traversable is only an alias for version 2.13 Iterable[A],

Another change affects the handling of futures in the standard library. The redesign was designed to deliver expected behavior over a wider range of error conditions, as well as better performance and more robust applications.

In addition, Scala now, like many other programming languages, allows the underline to be used as a separator for numeric literals. In addition, the empty square brackets are held as Unit Value, x op () not like before x.op ()but stop x.op (()) is. Thanks to optimizations for concurrent programming, the future is probably much better than before.

The compiler is talking about a 5 to 10 percent faster execution, a deterministic output, and a reworked optimizer.

The best overview of the large number of other minor changes is provided by the release notes, which also provide links that have a good impact on more information in the current Scala development.

Behind Scala's development is mainly the Lightbend company, which is run by another Scala creator, Martin Odersky. In addition to Kotlin, Scala is probably the most common of the many Java Virtual Machine (JVM) languages ​​that have emerged in the last 15 years. Meanwhile, there is also a development thread (Scala.js) with JavaScript as the runtime environment to run Scala applications.

Scala combines the concepts of functional and object-oriented programming as uncompromisingly as almost any other language. The programming language now has a different license and is now available under the Apache 2 license. Then another smaller release is planned, which should prepare the way especially for the move to Scala 3 planned for 2020.

See developer heise:


Source link