4 ms·
Does anyone know if there are any plans for coroutines or similar mechanisms in the new versions of ecma/javascript? Python's async frameworks like monocle and
by viraptor 16y ago
Does anyone know if there are any plans for coroutines or similar mechanisms in the new versions of ecma/javascript? Python's async frameworks like monocle and diesel work around issues like that by returning another item from a generator and receiving the result again, which works quite well and makes the code look the same as the synchronous one.
- olavk 16y agoThere is a proposal for adding generators and the yield keyword like in Python, and Mozilla already supports it.
- grayrest 16y agoI know Brendan Eich has mentioned that he would like to bring python-like generators into the language. They're in Mozilla's engine, were in ES4, and they're a ES Harmony strawman. http://wiki.ecmascript.org/doku.php?id=strawman:generators http://wiki.ecmascript.org/doku.php?id=strawman:generators Otherwise, I'm not really aware of anything. I know there's been efforts around Promises but I think those have been restricted to libraries and I think that even that's stalled because the CommonJS list is split between Promises/A and Promises/B.