How Scala 3 Givens Work with Scala 2 Implicits

  Рет қаралды 2,405

Rock the JVM

Rock the JVM

Күн бұрын

Пікірлер
@bomenderick9468
@bomenderick9468 Жыл бұрын
Amazing how you make these implicitly abstract scala concepts looks explicitly concrete. Just enjoy your way of simplifying things.
@JasonYeo
@JasonYeo 3 жыл бұрын
So why did the Scala team introduce givens and usings? How does that improve the implicits situation? The given resolution order is the same as before and now it seems like these are just new keywords for the an old concept. It's basically putting old wine in new bottles.
@BloodnutXcom
@BloodnutXcom 3 жыл бұрын
Implicit keyword becomes deprecated. Scala 3.0 is still backwards compatible but later implicit will be removed.
@-Wessel
@-Wessel 3 жыл бұрын
I think the reason is the name implicit was confusing because: - The name does not imply what it does - the implicit keyword is used for different things that are completely seperate from each other. The new keyword names adress these 2 things. I guess it's like a refactoring of the language: Same functionality but more comprehensible syntax.
@sergeydev8273
@sergeydev8273 3 жыл бұрын
Like, then watching :)
@BloodnutXcom
@BloodnutXcom 3 жыл бұрын
tldr: givens+using are interchangable with implicit
@rockthejvm
@rockthejvm 3 жыл бұрын
Pretty much - with a bit of background about how the compiler works with them
@Nebulorum
@Nebulorum 3 жыл бұрын
Are there differences between given and implícits, or are they just an alias of each other?
@jimaaman
@jimaaman 3 жыл бұрын
I too am wondering this. Are there compiler optimizations or some other benefit to using/given besides constraining the application of implicits?
@rockthejvm
@rockthejvm 3 жыл бұрын
Givens are not aliases of implicits. They have a different mechanism, it's only how the compiler looks for such values that's the same (so they can work interchangeably). The goal of using/given was indeed to constrain the power of implicits, because they were often misused.
@miloventimiglia8547
@miloventimiglia8547 3 жыл бұрын
Nice!!!:)
@rockthejvm
@rockthejvm 3 жыл бұрын
Glad you liked it!
Scala 3: Extension Methods
16:56
Rock the JVM
Рет қаралды 2,9 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 343 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 320 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,4 МЛН
The Most Legendary Programmers Of All Time
11:49
Aaron Jack
Рет қаралды 648 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 40 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 636 М.
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 681 М.
Arenas, strings and Scuffed Templates in C
12:28
VoxelRifts
Рет қаралды 103 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 852 М.