Stackless Python, Tail Recursion and Functional Programming

Christian Tismer tismer at tismer.com
Mon Jan 13 18:40:47 EST 2003


Lulu of the Lotus-Eaters wrote:
> beno <zope at thewebsons.com> wrote previously:
> |Someone wrote me from this list advising me to drop my passion for
> |functional programming because Python doesn't optimize for it. Then I
> |remembered Cameron Laird's *Stackless Python*. Doesn't this take care of
> |this problem by converting the stack into a tree, just like XSLT? Doesn't
> |that make optimization for tail recursion a cake-walk? And, if so, if I
> |implement the necessary changes to my Python distro, can I write recursive
> |programs without worrying about optimization problems?
> 
> I think someone has found my reference to recursive transition networks,
> or Laura's releated one to Markov chains.  As near as I can tell, this
> post is a random assemblage of commonly occurring (related) words and
> phrases from past c.l.py messages.
> 
> Am I right? Do I get a prize for noticing it?

Yes. You will get 42 handshakes from me on PyCon.

> Laird didn't make Stackless.

Laird did make more for Stckles than anybody else (but me, maybe).

> Stackless doesn't optimize tail recursion.

Sorry about that. I didn't find it interesting. Is it?

> None of this has anything to do with XSLT.  There's no real connection
> between stack trees and recursion.  Etc.

Can you please elaborate on that?
I do think that there are more connections between
stack trees and recursion than between a fish and a bicycle.

ciao - chris






More information about the Python-list mailing list