Swift Concurrency Manifesto | Chris Lattner and Lex Fridman

  Рет қаралды 15,050

Lex Clips

Lex Clips

Күн бұрын

Пікірлер: 15
@austinmw89
@austinmw89 4 жыл бұрын
One of my favorite guests
@tomwright9904
@tomwright9904 4 жыл бұрын
5:38 "You're kind of fu- stuck with a bad set of trade offs" :D
@adelinaquijano1083
@adelinaquijano1083 Жыл бұрын
I think my enternet before we apply before last 2018 I thought I finish my contract.
@GoofyHistorians
@GoofyHistorians 4 жыл бұрын
Lex, you are the best!
@unoarecare5728
@unoarecare5728 2 жыл бұрын
please make distributed actor compatible with iOS, take in account battery, app lifetime, and bootstrap node by default in in apple
@kevinayers7144
@kevinayers7144 4 жыл бұрын
wait, wait, wait........ are you saying you've solved race conditions :0
@jj680l
@jj680l 4 жыл бұрын
Rust language is known to have solved race conditions, even when using shared memory. Not sure about Swift.
@Xaxxus
@Xaxxus 3 жыл бұрын
@@jj680l yes, as of swift 5.5 race conditions are essentially solved at the compiler level now. Swift added actors. So if you put your race condition prone code into an actor, you will get compile errors when you try to do something that will cause a race condition.
@NirvanaHalen
@NirvanaHalen 9 күн бұрын
I hate swift. Now I see why. The mind of the guy who created it talks like swift feels. A mess, a mess that is supposed doing magic but is actually making things complicated. People like me HATE auto magic features. Var, Let, -> it’s all shit.
@ConernicusRex
@ConernicusRex 3 жыл бұрын
Not excited by async/await. DispatchQueue already has all of these features.
@pawelpow
@pawelpow 3 жыл бұрын
Completion handlers? Actors? Synchronous syntax?
@spaceowl5957
@spaceowl5957 2 ай бұрын
I'm just learning about Swift concurrency, so forgive me if I'm wrong, but here's my assessment, having worked with DispatchQueues and locks: async / await is kinda just syntax sugar for completion handlers as far as I understand. But it's very nice syntax sugar that does really make the code easier to read and refactor in some cases. If you hide all accesses to a set of state behind a DispatchQueue, you basically have a more flexible version of an actor as far as I understand. So I think Actors are kinda syntax sugar for a specific pattern you can already implement with DispatchQueues. Task is kinda just a DispatchQueue that is compatible with the async / await keywords and the Swift error throwing syntax? It would've felt more elegant if they made async/await compatible with DispatchQueues instead of creating Task. I'm not sure why they didn't do that. Maybe technical reasons? Not sure what 'Synchronous syntax' means that @pawelpow mentioned. In conclusion: If I'm not misunderstanding, the whole Swift concurrency stuff is basically syntax sugar / a more restrictive and opinionated version of stuff you can already do with DispatchQueues and completion handlers. And of course that restrictiveness brings the dubious benefit of 'safety', which I generally dislike because the 'safe' version usually doesn't cover all the things I wanna do, makes some things more cumbersome or require workarounds, doesn't really make it that much easier to write code that is *acutally correct* and bug free, and - knowing Swift - the performance characteristics are probably not great either. So I think I'll use async await in some places instead of nested completion handlers, but I'll probably stay clear of the Actor stuff and just try to do things as single-threadedly as possible (like a sane person) and otherwise I'll use DispatchQueues or locks, which are flexible and performant. It's a shame, I think if Actors were more compatible with DispatchQueues, I think I'd use it as convient syntax sugar sometimes, but I really don't like that it forces you into using the async/await and Task stuff and restrictive Swift 'safety' rules everywhere that you interact with the Actor. I really don't like that. Especially since I'm not confident in this Swift stuff for performance-critical code.
@mutantx4724
@mutantx4724 2 ай бұрын
​@@spaceowl5957 i am also learning Swift concurrency, the more I try to understand, it looks better. Here's what I understand If we use await, task and actors we get compile time checks for race conditions Number of threads and context switching is reduced. No threads will be blocked. Easy to reason about the code I am also trying to find a good source which explains everything simple with examples but cannot find one
@mutantx4724
@mutantx4724 2 ай бұрын
​@@spaceowl5957 i am also learning Swift concurrency, it looks better the more i try to understand. Reduced thread, reduced context switching, compile time check for race conditions, no blocked thread
@NirvanaHalen
@NirvanaHalen 9 күн бұрын
I hate swift. Now I see why. The mind of the guy who created it talks like swift feels. A mess, a mess that is supposed doing magic but is actually making things complicated. People like me HATE auto magic features. Var, Let, -> it’s all shit.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Python vs Swift | Prime Reacts
19:44
ThePrimeTime
Рет қаралды 83 М.
Your Brain 🧠 on Swift Concurrency - iOS Conf SG 2023
30:38
iOS Conf SG
Рет қаралды 10 М.
Василий Усов - А так ли нужна Swift Modern Concurrency?
46:41
Mobius — конференция по мобильной разработке
Рет қаралды 3,7 М.
Python vs Swift | Chris Lattner and Lex Fridman
11:16
Lex Clips
Рет қаралды 156 М.
Bjarne Stroustrup: Learn More than One Programming Language
6:57
Lex Fridman
Рет қаралды 143 М.
Василий Усов - А так ли нужны акторы в Swift Concurrency?
46:54
Mobius — конференция по мобильной разработке
Рет қаралды 2,9 М.