3 ms·
> it would be fundamentally incorrect to ever call a function marked as async from most points of your program flow For a language with async/await yes, you ne
by assbuttbuttass 2y ago
> it would be fundamentally incorrect to ever call a function marked as async from most points of your program flow
For a language with async/await yes, you need to bifurcate your program into synchronous and asynchronous pieces, and be very careful to maintain that split.
For a language with a synchronous thread abstraction like go, you simply don't need to create this artificial bifurcation in the first place
- fwip 2y agoYes. The person I replied to described a situation that, to me, is made easier by this bifurcation.
- eyelidlessness 2y agoIs it though? In a hypothetical JS with the possibility of, say, “decoloring” async functions—e.g. by optionally blocking on their resolved return value—the situation that function coloring helps… ceases to exist as a situation in need of helping in the first place. That would be broadly unappealing where single threaded, cooperative concurrency is a baseline assumption! But it’s more fair to say it’s a trade off, and it’s also fair to recognize the things made impossible by a trade off.