On Dec 12, 2009, at 11:29 PM, Dan Stromberg wrote:

> How close is cython (0.12 and trunk or whatever cython calls trunk, or
> the cython-closures repository?) to supporting generators?

It's getting closer. Actually, Craig Citro made some progress on  
stress-testing it last week (he's been looking at doing this for a  
while, but has been very busy with teaching this last quarter...), and  
if all goes well closures should be merged in, otherwise we'll at  
least know where we stand. (I think they're pretty solid.)

> I have a performance-oriented project I'm working on, and cython seems
> like a good fit - except I really wanted it to have generators.  I'd
> happily eliminate monkey patching and nested scopes for cython's
> performance, if it just had generators.
>
> I heard that cython will want "functional" closures first, then
> generators (but does "functional" here mean "'functional' as in
> 'working'" or "'functional' as in 'functional programming'".

Both :).

> Have the true closures been added?

That's what's in the closures branch.

> Someone wrote that the requirements for adding generators are  
> understood
> (it was probably in the cython FAQ).  Is there a list of these
> requirements written down somewhere?

As Stefan mentioned, there's the CEP which documents it pretty well.

> Thanks!
>
> PS: I tried building the cython-closures code, but it still gives an
> error on the 'yield' keyword, despite there appearing to be some
> yield-related code in there.

Closures are an essential building block for generators. Essentially,  
closures boil down to being able to retain the local state of a  
function while it's not actively running--something that generators  
obviously need to be able to do. It is the one glaring deficiency, and  
I don't think it's that far away (in terms of work, probably months  
before I could personally sit down and attack it).

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to