Scala 3 was released. The new version was developed for eight years and, according to the developers, is a complete overhaul of the Scala language. Many aspects of the type system have changed, which means that type inference and congestion resolution have been greatly improved.
Scala combines object-oriented and functional programming in a concise high-level language. Scala is a statically typed, object-oriented, functional language that runs on the JVM and has some interesting parallel processing constructs based on the actuator model. An actor is essentially an object that runs concurrently and is involved in message passing.
Scala was released in 2004 as an open source project under the BSD license and version 2 was released in 2006 to extend it.
The developers have worked on the entire Scala language, starting with the type system. The changes to it allow for new functionality like union types and also mean the type system is less intrusive and type inference and overload resolution have been vastly improved.
In addition to the improved type inference, the Scala 3 type system offers new functions, including newly designed lists that fit well into case classes and form the new standard for expressing algebraic data types; opaque types that can hide implementation details; and intersection and union types.
There are also new dependent function types, polymorphic function types. and enter lambdas.
The new release also has a new “silent” syntax for control structures such as if, while and for. The silent syntax does not rely on enclosing the condition in parentheses, and it also allows parentheses or curly braces to be placed around the generators of a for expression. The new keyword is now optional, and optional curly braces enable “a distraction-free, indent-sensitive programming style.”
The developers have also worked on “contextual abstractions”. The development team says a fundamental core concept of Scala was to provide users with a small amount of powerful functionality that could be combined. Scala 3 takes a slightly different approach and focuses on intent rather than mechanism. Rather than offering a very powerful feature, Scala 3 offers several bespoke language features that allow programmers to express their intentions directly. Examples include abstracting context information through the use of clauses so that programmers can abstract information that is available in the calling context and should be passed implicitly; and providing type class instances to define the canonical value of a particular type.
Scala 3 is now available for download on the Scala website.
On the subject of matching items
Scala.js is leaving the experimental phase
Scala 2.11 released
To be informed about new articles on I Programmer, subscribe to our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or LinkedIn.
or send your comment by email to: [email protected]