Scala 3
A Quick Tour
@DanielaSfregola
Singapore Scala Programmers - May 2021
Slide 2
Slide 2 text
Hellooooo
• Software Engineer
living in London UK
• Scala Lover ❤
• OS Maintainer
• Author of
"Get Programming with Scala"
by Manning
35% OFF with code "scala3party"
Slide 3
Slide 3 text
Scala 3 is here!
• After 8 years of work
• 28,000 commits
• 7,400 pull requests
• 4,100 closed issues
• ...released on May 13th, 2021!
https://www.scala-lang.org/blog/2021/05/14/scala3-is-here.html
Slide 4
Slide 4 text
An overview
• https://dotty.epfl.ch/docs/reference/overview.html
Enums
sealed abstract class Color(val rgb: Int)
case object Red extends Color(0xFF0000)
case object Green extends Color(0x00FF00)
case object Blue extends Color(0x0000FF)
Slide 15
Slide 15 text
Enums
sealed abstract class Color(val rgb: Int)
case object Red extends Color(0xFF0000)
case object Green extends Color(0x00FF00)
case object Blue extends Color(0x0000FF)
enum Color(val rgb: Int):
case Red extends Color(0xFF0000)
case Green extends Color(0x00FF00)
case Blue extends Color(0x0000FF)
Improved Error Messages
Arrested Developers
What the Scala Compiler & Lucille Bluth
Have In Common
by Fiona Condon, NeScala 2017
https://www.youtube.com/watch?v=78iIbiRwFTM
Slide 27
Slide 27 text
Improved Error Messages
def echo(str: String): Unit = {
str
}
def echoTwice(str: String): String = {
echo(str) match {
case x: String => s"$x$x"
}
}
Compatibility with 2.13
Migrating to Scala 3
is easy* !
* if you are using Scala 2.13
* if you don't have macros in your code
Scala 3 Migration Guide
https://scalacenter.github.io/scala-3-migration-guide
Slide 34
Slide 34 text
Thank You!
•Twitter: @DanielaSfregola
•"Get Programming with Scala"
by Manning
35% OFF with code "scala3party"