4 ms·
> , that's not a benchmark for a conclusion on how successful a potential integration into the core language might be That's fair. I'm also biased by the fact
by BiteCode_dev 5y ago
> , that's not a benchmark for a conclusion on how successful a potential integration into the core language might be
That's fair.
I'm also biased by the fact I really like to know when my code is suddenly going into async territory.
I like the JS model for this: it's explicit enough that there is little surprise (promises are now a standard, so if something returns a promise, it's async), but implicit enough that I don't have to care (no loop to setup, no coroutine instantiation between calling and scheduling). And it aged well: future can now just be awaited, and you can simply keep the callback api in non async function.
gevent is too implicit to my taste I guess. Now you could argue that we could make gevent calls explicit, but then it would be not that much different from asyncio.
I would really be happy if the community would settle in something like:
@autorun
async def coro(): ...
Then:
coro() # this calls create_task(), and binds it to the upper nursery
I think it would strike the right balance from a usability point of vue.
As for the interoperability issue, it's a pretty though nuts to crack.