As for (1), I'd be happy to hear a proposal. If you'd like to work on this, feel free to submit an issue or even a pull request on github — suggestions like this are very welcome. Thanks! :)
As for (1), I'd be happy to hear a proposal. If you'd like to work on this, feel free to submit an issue or even a pull request on github — suggestions like this are very welcome. Thanks! :)
In any case, are you sure that JS generators should be considered a "future" thing? I just did a bit of research, and it sounds like you are talking about this proposal:
http://wiki.ecmascript.org/doku.php?id=proposals:iterators_a...
According to the following page, much/all of that proposal was included in JS 1.7, which was implemented in Firefox 2.0.
https://developer.mozilla.org/en/New_in_javascript_1.7
And FF 2.0 was released in October 2006. A quick check shows that my FF installation (3.6.22) supports generator functions, and the "yield" keyword, just fine, as long as I say
<script type="text/javascript;version=1.7">
Regardless, I'm a little out of my depth here.Generators like in Python allow for nice AI scripting with explicite time-sharing - each AI actor is generator function, that in main loop has yield statement.
That way it all works in one thread, and ai code can be written straightforward, like each actor had it's own thread.