5 ms·
C# was, as far as I'm aware, the first major language to implement async/await atop of Task<T> (akin to Java's Future<T>). The CLR uses native threads. Go chan
by eropple 9y ago
C# was, as far as I'm aware, the first major language to implement async/await atop of Task<T> (akin to Java's Future<T>). The CLR uses native threads.
Go channels are also orthogonal to async/await. Message passing is not a substitute for futures/tasks, though it can be used to achieve similar goals. I would be extremely cautious about claiming that Go channels would be "more performant" than an otherwise-equivalent futures implementation, too.
- wahern 9y agoGoroutines are not the same thing as Go channels.
- eropple 9y agoSorry, yes. Fibers (Go didn't invent them) also aren't directly equivalent because they don't allow explicit yields and composition.
- wahern 9y agoFibers don't, but goroutines + channels + closures do. They permit composition using the same call/return syntax and semantics as normal function calls. Futures and promises don't. Async/await is closer, but only by creating a second class of function incompatible with normal functions.
- deleted 9y ago[deleted]