|
|
|
|
|
by eyelidlessness
1185 days ago
|
|
async (the keyword) is doing fantastic because it’s better than all of the available alternatives. Those alternatives: - ad hoc callbacks, which had a great Result-ish type signature but really do warrant the “hell” in “callback hell” - Promise APIs, which are semantically equivalent to async the keyword, unless you care about call stacks, and have a lot of the same hellish problems as the ad hoc callbacks they were meant to address (less nesting! same everything else!) - Um fibers? Good luck making sense out of whatever that’s doing. It’s a good idea, but it’s also all opaque magic when you try using it. - Actual threads and child processes… there are valid use cases, and they’re worth pursuing if you have a valid use case, but the facilities for development with them are basically “here’s a bunch of low level concepts that closely mirror their system level counterparts, hope you know/figure out what you’re doing!” |
|
The author of esbuild gave up trying to code esbuild with nodejs/worker threads and switched to Go for a less limited/restricted concurrency environment.