On Sun, Oct 9, 2016 at 9:50 AM, Guido van Rossum <gu...@python.org> wrote:
> I think I'm convinced by Amber's argument. Coroutines are something
> you can look up in e.g. Knuth (or Wikipedia) and you'll find something
> a pretty good match. All queries for "async functions" seem to go to
> some ECMAScript proposal (similar in nature to PEP 492 actually)

You got me curious and I did some reading... it looks like this
proposal has been finalized and is starting to ship in browsers now,
and that it's *very* similar to PEP 492. As in, the working group was
explicitly studying "Python and C#" [1] for implementation experience,
and from the user point of view the final syntax and semantics are
essentially identical to our async functions / coroutines [2]. They
even have Yury's async-toggles-the-keyword-status-of-await lexer hack
:-).

I guess personally I like it when different languages that have the
same concept use the same name for it? Knuth will get you into the
right ballpark, but between Python and Javascript's async functions,
it looks like knowing how to use one is ~100% directly transferable to
knowing how to use the other.

(Apparently C# went with "async method" for their terminology, so
they're consistent too.)

> and I
> am not particularly eager to throw ourselves in front of that
> bandwagon.

I vote that we think of this as them throwing themselves in front of
your bandwagon ;-).

-n

[1] e.g. 
https://github.com/tc39/ecmascript-asyncawait/issues/89#issuecomment-185086819
[2] There is one interesting difference: since they already have an
event loop + future implementation baked into their runtime, they
elected not to separate out the coroutine trampoline as a
user-replaceable library component, like Python did. Instead, their
'await foo' is effectively hard-coded to do
'foo.add_done_callback(current continuation) + suspend'. Which is
identical to what the standard asyncio.Task trampoline does anyway, so
this is not a difference that matters to anyone who isn't writing
their own I/O library. Though I guess it means we won't be seeing a
curio.js anytime soon.

-- 
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
Async-sig mailing list
Async-sig@python.org
https://mail.python.org/mailman/listinfo/async-sig
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to