3 ms·
But async doesn't imply IO in many languages, it could just be a timer or a cross thread operation. At the limit is just lazy evaluation. Similarly the absence
by gpderetta 5y ago
But async doesn't imply IO in many languages, it could just be a timer or a cross thread operation. At the limit is just lazy evaluation.
Similarly the absence of async doesn't guarantee the absence of IO, the function could be doing plain old sync IO or scheduling continuations on the event loop by hand.
IMHO there isn't any justification for async in "high overhead" languages, i.e. most of the dynamic languages that are not going to spawn tens if thousands of concurrent coroutines; those languages are better served by green threads or some sort of stackful continuations (the existence of async in python is particularly baffling).
It is more of a necessary evil in high performance languages were dedicating a call stack is a comparatively large cost. Even then I strongly believe that async functions should be awaited by default and any forking should be explicit.
YMMV.