|
|
|
|
|
by masklinn
1066 days ago
|
|
In fact python had general coroutines first in yield, which is mostly used for iteration (“generators”) and state machines. Some frameworks (e.g. twisted) did use them for concurrency, and the core team originally planned something similar, however the ergonomics were not what they wanted (especially when mixing coroutines-for-concurrency and coroutines-for-iteration), so they went for a more specialised design. |
|
> went for a more specialised design
My impression is that JS evolved similarly - (ab)using generator for concurrency, then specialized async-await as a language feature.