7 ms·
"Everything is Async: Because the base environment has been built essentially from scratch, everything is asynchronous. This means there is no ‘defer to threa
by enneff 16y ago
"Everything is Async: Because the base environment has been built essentially from scratch, everything is asynchronous. This means there is no ‘defer to thread’ like in Twisted Python; You just can’t make blocking code."
This is not necessarily a good thing. Sometimes you need to write a piece of code that executes sequentially. Having the ability to do that if you need to is a good thing. Sometimes it can be unnatural and unwieldy to split a block of functionality up into a set of callback functions.
- mjw 16y agoYep. Your code ends up looking like the output of a continuation-passing transform, with every kind of sequential composition involving nested callbacks. It feels quite low-level and clunky and is one of the things I like least about writing Javascript on the browser. Another thing is, when you go async, you're essentially giving up on using the language runtime's stack for most purposes. With that, you lose some useful functionality (useful stack traces, exceptions bubbling up).
- Andi 16y agoUse Step, man