top | item 32200181

(no title)

danellis | 3 years ago

> It only works in languages where promises/futures/tasks are a first-class citizen. Eg JavaScript.

Why would that be true?

discuss

order

jchw|3 years ago

I think the actual answer is that it only works in languages where you can eagerly execute async code disconnected from the Promise/Future construct. It would've worked in ES3 using a Promise polyfill. (Which is notable because it does not fit the aforementioned criteria—it had no real async support.)

hinkley|3 years ago

It isn’t. The first implementation of promises I worked on was in Java. We used it as part of verifying certificate chains. If you use threads it doesn’t matter if the operations are blocking, as long as you move them off-thread.