Moving from Scala 2 to Scala 3

Intermediate

Description

The Scala language just took a huge leap forward. The arrival of Scala 3 brings powerful new language features which can help simplify our code as well as improve safety and readability.

Understanding what these features bring to the table (and when and why to use them) can be tough, however.

This 2-day hands-on workshop leads participants through the step-by-step transformation of a Scala 3 application into a new application which takes advantage of the latest features of our favorite language.

Starting with a fully-functional Scala 2.13 application. First, the Scala 3 compiler is used to analyze and automatically rewrite the source code where needed to use Scala 3 specific language syntactic constructions and rewrite deprecated syntax. Then, the code is transformed in a series of manual steps to leverage specific Scala 3. The resulting Scala 3 application is smaller, safer and easier to understand.

By the end of the workshop participants will have a better understanding of:

  • Why these new Scala 3 language features have been introduced.
  • When, Where and How to use them.
  • What the Scala compiler itself can do to help in the transition to Scala 3.

Prerequisites

This is an intermediate-level course. Workshop participants should have at least 6 months of hands-on experience with Scala 2.13.

Content

  • Scala 3 Language overview
  • Scala 3 Compiler rewrite capabilities
  • Syntax rewriting - Fewer braces & new control constructs syntax
  • Rewriting deprecated syntax using -source:xxx
  • Scala 2 & 3 library interoperability
  • Top level definitions
  • Parameter untupling
  • Contextual abstractions - new syntax
    • given, using, and summon
    • extension methods
    • Type class instances
  • Enumerations & export clauses
  • Union & Intersection types
  • Opaque type aliases - do’s and don’ts
  • Multiversal equality
Eric Loots

LunaTech

Adrien Piquerez

Scala Center

Trevor Burton-McCreadie

LunaTech

Are you interested in this workshop?

Buy now for Madrid