|
|
|
|
|
by thom
1233 days ago
|
|
I actually think async/await is a terrible primitive, and if you’re on Java, the approach of Project Loom is vastly superior (i.e. threads can be cheap so everything can just be synchronous again). I’ve no problem with library-level concepts like promises and futures but it feels very short sighted to put it into an actual language, it’s just noise. |
|
8 years ago I wrote a npm package that turned code that looks like this:
into this: it was never ready for production use, but it showed that synchronous code illusion can be created from callbacks.How would you prefer to write asynchronous code?
How does Loom handle resource starvation problem? If a thread puts a while (true) {} in there somewhere, can that thread be preempted away from that kernel thread?