pyjaco
pyjaco copied to clipboard
Yield-generators
guess this isn't possible yet
We have looked at it, but it's very difficult to do. We are looking at a new compiler infrastructure called IST (Intermediate Syntax Tree), which should make this easier, but it's still very tricky.
Basically, yield-functions need to be programmatically refactored in order to work like a resumable automaton, instead of a normal call-return function. It's not easy.
How about generators in Javascript 1.7 https://developer.mozilla.org/en-US/docs/JavaScript/New_in_JavaScript/1.7#Generators ?
They will eventually get supported on most browsers ..
Well, they might be.. eventually. But requring javascript 1.7 which is still hardly supported anywhere, would be quite a big leap in terms of system requirements, and I fear it will significantly hamper the usefulness of pyjaco.
We can solve this by having a more intelligent code generator instead, which also ensures that the semantics will be identical between pyjaco code and native python.
So, no, I don't think it's a viable option. Sorry :)
+1 for this. Generators and yield
are available in node.js version 0.11.2, Javascript 1.7 has been supported since Firefox 2, and support in V8 / Chrome is imminent.
Things move quickly. This would be great for pyjaco.