pyjaco icon indicating copy to clipboard operation
pyjaco copied to clipboard

Yield-generators

Open dusty-phillips opened this issue 12 years ago • 5 comments

dusty-phillips avatar Jan 09 '12 23:01 dusty-phillips

guess this isn't possible yet

dxlbnl avatar Apr 20 '12 17:04 dxlbnl

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.

chrivers avatar Jul 02 '12 15:07 chrivers

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 ..

ionelmc avatar Jan 15 '13 00:01 ionelmc

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 :)

chrivers avatar Jan 17 '13 13:01 chrivers

+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.

martindale avatar Jun 17 '13 16:06 martindale