3 ms·
FWIW Python got async/await before JavaScript did. I believe at the time the main inspiration was C#.
by int_19h 1y ago
FWIW Python got async/await before JavaScript did. I believe at the time the main inspiration was C#.
- lyu07282 1y agoJavaScript 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.
- int_19h 1y agoasync/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.
- guappa 1y agoasync await is syntactic sugar hiding calls to poll() and callbacks in every programming language.