←back to thread

320 points willm | 1 comments | | HN request time: 0.216s | source
Show context
mjd ◴[] No.45106669[source]
I haven't read the article yet, but I do have something to contribute: several years ago I was ay PyCon and saw a talk in which someone mentioned async. I was interested and wanted to learn to use it. But I found there was no documentation at all! The syntax was briefly described, but not the semantics.

I realized, years later, that the (non-)documentation was directed at people who were already familiar with the feature from Javascript. But I hadn't been familiar with it from Javascript and I didn't even know that Javascript had had such a feature.

So that's my tiny contribution to this discussion, one data point: Python's async might have been one unit more popular if it had had any documentation, or even a crossreference to the Javascript documentation.

replies(3): >>45106735 #>>45109623 #>>45116352 #
int_19h ◴[] No.45109623[source]
FWIW Python got async/await before JavaScript did. I believe at the time the main inspiration was C#.
replies(1): >>45110078 #
lyu07282 ◴[] No.45110078[source]
JavaScript was always single-threaded asynchronous, the added async/await keywords were just syntactic sugar. Node.js became popular before it as well, though I found at the time it was difficult to avoid callback hell similar to using libuv directly in C.
replies(2): >>45110301 #>>45113443 #
1. int_19h ◴[] No.45110301[source]
async/await was syntactic sugar in C# as well. Callbacks are a natural way to do async so it's no surprise.

And while Python implements async directly in the VM, its semantics is such that it can be treated as syntactic sugar for callbacks there also.