4 ms·
Swift as a language may not be superior to go in itself ( quite the opposite imho), but the fact that go chose a specific type of concurrent programming and bui
by bsaul 11y ago
Swift as a language may not be superior to go in itself ( quite the opposite imho), but the fact that go chose a specific type of concurrent programming and built their language around it makes it more straightforward.
With swift, designers chose not to choose. Which means you'll resort to using libraries ( basic threads with gcd or C libraries such as libmill, or libuv), which means future incompatibilities between codebases that chose different models.
- stevetrewick 11y agoNo. GCD is not 'basic threads', GCD is a concurrency model based on executing blocks (closures) on queues. Threads are abstracted away by GCD. NSOperationQueue abstracts even further to provide a higher level concurrency model. Or you can go down the stack to NSThread to actually get your 'basic threads'. The programmer gets to choose the level of abstraction appropriate to the task in hand.
- bsaul 11y agolet's say gcd is still much lower level than channels+select or asyncio+single run loop or actors+shared nothing. At the minimum, i would say it's much more flexible but also much less opinionated.