Jorge wrote:
>  or some other creative way of statically encoding the "might suspend 
execution" condition into the syntax?
Yes, of course, it would be fine. Why ?
Because this is the crux of the "run-to-completion" debate that we're immersed in.

Right now, JS has run-to-completion, where completion is defined as the end of a method, or a "yield" statement. If the "yield" statement continues to be required for code paths which may transfer control to another context, then that won't change, and all the run-to-completion objections to coroutines disappear. IOW, there is no difference WRT run-to-completion between generator-yield and coroutine-yield.

The catch is, of course, that all code which either can yield, or can call other functions which yield, must have the "yield" keyword there, to mark that run-to-completion invariants will end at that point. This seems like a very reasonable compromise to me.

-Eric

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to