Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Scala 3 - A Quick Tour - Scala Italy 2021
Search
Daniela Sfregola
October 23, 2021
Programming
0
210
Scala 3 - A Quick Tour - Scala Italy 2021
Daniela Sfregola
October 23, 2021
Tweet
Share
More Decks by Daniela Sfregola
See All by Daniela Sfregola
Scala 3 - A Quick Tour - Singapore Scala Programmers 2021
danielasfregola
1
120
ScalaBase 2021- FP: the Good, the Bad, the Ugly
danielasfregola
0
180
Top 5 Cool Things about Scala 3 (that are not enums)
danielasfregola
0
220
LSUG 2019 - FP: The Good, The Bad and The Ugly
danielasfregola
2
290
Scala IO 2019 - FP: The Good, The Bad and The Ugly
danielasfregola
1
840
Scala Days 2019 - Refactor all the things!
danielasfregola
0
280
Refactor all the things!
danielasfregola
0
500
Scala Italy 2018 - Random Data Generation with ScalaCheck
danielasfregola
0
1.7k
Scala Days 2018 Berlin - A Pragmatic Introduction to Category Theory
danielasfregola
2
1.3k
Other Decks in Programming
See All in Programming
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
570
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
210
Cell-Based Architecture
larchanjo
0
140
Microservices rules: What good looks like
cer
PRO
0
1.6k
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.1k
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
410
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.6k
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
190
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
120
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
180
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
25
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
83
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
200
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
0
31
The Language of Interfaces
destraynor
162
25k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Are puppies a ranking factor?
jonoalderson
0
2.4k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
120
Transcript
Scala 3 A Quick Tour @DanielaSfregola Scala Italy - October
2021
Hellooooo • Software Engineer living in London UK •
Scala Lover ❤ • OS Maintainer • Author of "Get Programming with Scala" by Manning 35% OFF on EVERYTHING with code "ctwscalait21"
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
An overview • https://dotty.ep fl .ch/docs/reference/overview.html
@main Annotation object HelloWorld extends App { println("Hello World!" )
}
@main Annotation object HelloWorld extends App { println("Hello World!" )
} object HelloWorld { @main def hello: Unit = { println("Hello world!" ) } }
@main Annotation object HelloWorld extends App { println("Hello World!" )
} object HelloWorld { @main def hello: Unit = { println("Hello world!" ) } } object Hello { @main def echo(n: Int, word: String): Unit = { println(word * n ) } }
Parametrized Traits trait Nameable { def name: Strin g }
Parametrized Traits trait Nameable { def name: Strin g }
trait Nameable(name: String)
Intersection Types class A class B def foo: A &
B = ???
Union Types class A class B def foo: A |
B = ???
Package Object // in file my/demo/package.scal a package m y
package object demo { def customLog(msg: String) { println(s"Customised package log: $msg" ) } }
Package Object // in file my/demo/package.scal a package m y
package object demo { def customLog(msg: String) { println(s"Customised package log: $msg" ) } } [ DROPPED ]
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)
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 Type Inference Map("Scala" -> 3).map { (k, v) =>
s"$k$v" }
Improved Type Inference Map("Scala" -> 3).map { (k, v) =>
s"$k$v" } Scala 2.13.4
Improved Type Inference Map("Scala" -> 3).map { (k, v) =>
s"$k$v" } Scala 2.13.4
Improved Type Inference Map("Scala" -> 3).map { (k, v) =>
s"$k$v" } Scala 3.0.0
Improved Type Inference Map("Scala" -> 3).map { (k, v) =>
s"$k$v" } Scala 3.0.0 Scala 2.13.4
Procedure Syntax def echo(str: String) { st r }
Procedure Syntax def echo(str: String) { st r } Scala
2.13.4
Procedure Syntax def echo(str: String) { st r } Scala
2.13.4
Procedure Syntax def echo(str: String) { st r } Scala
3
Procedure Syntax def echo(str: String) { st r } Scala
3
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
Improved Error Messages def echo(str: String): Unit = { st
r } def echoTwice(str: String): String = { echo(str) match { case x: String => s"$x$x " } }
Improved Error Messages Scala 2.13.4
Improved Error Messages Scala 2.13.4 Scala 3
Strict Equality List("Scala", "3").headOption == "Scala"
Strict Equality List("Scala", "3").headOption == "Scala" Scala 2.13.4
Strict Equality List("Scala", "3").headOption == "Scala" Scala 2.13.4 Scala 3
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://docs.scala-lang.org/scala3/guides/migration
Thank You! •Twitter: @DanielaSfregola •"Get Programming with Scala" by
Manning 35% OFF on EVERYTHING with code "ctwscalait21"