I just created the coroutines tag. However, I then noticed that there is already the async-await tag. I think these are distinct concepts, even though in some languages, that distinction is a bit blurry. I would argue that coroutines are not necessarily asynchronous. However, if the consensus is that they are just synonyms, then perhaps one should be made a synonym of the other (or just removed)?
Coroutines are a control flow mechanism. You can reimplement coroutines by using
goto and mutating an address both sides have access to. As such a coroutine is to
for loops are to
while loops. A form of sugar.
Async/await requires arbitrary suspension and resumption of functions so builds off of coroutines. As
goto would be horrible to work with. However the async/await pattern specializes coroutines with a scheduler to manage the coroutines.
You can build your own async/await scheduler in any language which supports coroutines (not generators, which only support unidirectional communication). Which is how Python had support for the async/await pattern way before
await were added to the language.
in some languages, that distinction is a bit blurry.
If the only coroutines the language supports are async/await ones then users likely can conflate the two concepts.
coroutines are not necessarily asynchronous
Coroutines have nothing to do with asynchronous. Asynchronous (async/await) requires* coroutines to work.
*: T&C apply
if the consensus is that they are just synonyms, then perhaps one should be made a synonym of the other (or just removed)?
The two terms are not synonymous. As such the coroutine tag shouldn't be removed because of such a train of thought.