3 ms·
Because the standard library doesn't really have that many callback based functions. The more important issue here is that Promises are seen as fundamentally i
by spion 10y ago
Because the standard library doesn't really have that many callback based functions.
The more important issue here is that Promises are seen as fundamentally incompatible with post-mortem debugging due to their empty-the-stack requirement: https://promisesaplus.com/#point-34 https://promisesaplus.com/#point-34
If the stack is emptied when handling an exception, the context in which that exception happened is completely lost, so its not clear how to get the process to dump a core that contains meaningful information regarding the problem.
This is whats currently blocking node from fully switching to promises. Apparently many companies that have influence in node core rely heavily on post-mortem debugging and don't find the situation acceptable.
- jcheng 10y agoBoth Q and bluebird promises optionally support long stack traces, albeit at a performance hit. And in practice even old style callbacks often (usually?) empty the stack.
- spion 10y agoNo, old style callbacks don't empty the stack on thrown errors - they crash. Long stack traces are fine, but post-mortem debugging means analyzing the entire program's core dump. That includes everything that was in the heap at the time, and not just the names of the functions on the stack but also their arguments (which often point to stuff in the heap). It can be used to reproduce most of the program state at the time of the crash. The real problem is that at some point node decided that throw = programmer errors = core dump. This is wrong and misguided, but thats another story...