3 ms·
It's interesting to me that people seem to be trying to bridge Promises with CSP. Why aren't more people investigating the more straightforward async/await tran
by doty 12y ago
It's interesting to me that people seem to be trying to bridge Promises with CSP. Why aren't more people investigating the more straightforward async/await transformation that the C# compiler does? CSP just seems like one transformation too far.
- Arnavion 12y agoasync/await is trivial to mimic with yield - run the outer-most generator in spawn, use yield* with "async" methods, and use yield with Promise-returning methods. Projects like Regenerator already know how to convert yield to straightforward JS. So you already have the transformation the C# compiler does.
- jkrems 12y agoasync/await is an upcoming JS feature that actually is kind-of supported by Bluebird when combined with generators. The author just didn't know about it (I guess) and reimplemented it via macros.
- mateuszf 12y agoIt works like this in ClojureScript.