Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Scala 3 - A Quick Tour - Scala Italy 2021
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daniela Sfregola
October 23, 2021
Programming
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Scala 3 - A Quick Tour - Scala Italy 2021
Daniela Sfregola
October 23, 2021
More Decks by Daniela Sfregola
See All by Daniela Sfregola
Scala 3 - A Quick Tour - Singapore Scala Programmers 2021
danielasfregola
1
140
ScalaBase 2021- FP: the Good, the Bad, the Ugly
danielasfregola
0
230
Top 5 Cool Things about Scala 3 (that are not enums)
danielasfregola
0
270
LSUG 2019 - FP: The Good, The Bad and The Ugly
danielasfregola
2
330
Scala IO 2019 - FP: The Good, The Bad and The Ugly
danielasfregola
1
1k
Scala Days 2019 - Refactor all the things!
danielasfregola
0
320
Refactor all the things!
danielasfregola
0
560
Scala Italy 2018 - Random Data Generation with ScalaCheck
danielasfregola
0
1.8k
Scala Days 2018 Berlin - A Pragmatic Introduction to Category Theory
danielasfregola
2
1.4k
Other Decks in Programming
See All in Programming
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
220
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.5k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.3k
Next.js: The final boss of Web Performance
guaca
0
370
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
280
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1.1k
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
460
SODA - FACT BOOK(EN)
sodainc
1
190
AI-Powered Domain-Driven Design
ziobrando
0
360
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
170
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
1
270
Crash Auto Pipelines
veronikapj
1
140
Featured
See All Featured
Mind Mapping
helmedeiros
1
420
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
750
The Curious Case for Waylosing
cassininazir
1
590
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to Ace a Technical Interview
jacobian
280
24k
What's in a price? How to price your products and services
michaelherold
247
13k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
770
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Optimizing for Happiness
mojombo
378
71k
It's Worth the Effort
3n
188
29k
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"