[Python-Dev] Stackless Python

Christian Tismer tismer at stackless.com
Mon May 31 20:16:52 EDT 2004


Bob Ippolito wrote:

oops, ok, this need some words, still.

...

> Ok, then I am mistaken.  I thought I had seen a commit message that said 
> it was made non-recursive.  Either way, it's possible to write a 
> non-recursive version of map or anything else, it's just a bit of work.

I had that in 1.0, and I don't plan to do it again, although it
is simple, now.

...

> I don't think so, because the C stack should never run too deep, since 
> most code that is going to recurse (from the python-view) will do it 
> non-recursively (from the C-view).

You can create such situations. Until Stackless 3.0, it was possible
to do very deep explicit calls to the __call__ wrapper, for instance,
and wrappers were not supported.
Stackless 3.1 which is about to be announced has full support
for all slots and all methods by the machinery. Supported are
all tail-recursive calls (like __call__), because this is very cheap
to do. But it is possible to implement as many of special method
handlers and wrapper handlers as one wishes; I have the infrastructure
ready for this.

Anyway, for this rare artificial case, I have a check built in that
measures stack size instead of recursion counting, and it will
save the stack if necessary. Of course this is platform dependent,
but my, if we switch this off for non-supported platforms, what
do we loose?

[C++ exception issues]

> I don't think that the entire exception handling mechanism gets 
> corrupted.  Each tasklet should always have a consistent view of the C 
> stack.  Anyway, I don't think we need to discuss it any further unless 
> someone writes a failing test... and if that is indeed the case, then 
> the discussion should be taken to the stackless list.

Good idea, see you there! cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  mobile +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/




More information about the Python-Dev mailing list