FW: FW: [Python-Dev] Simple generator implementation

Uche Ogbuji uche.ogbuji@fourthought.com
Mon, 19 Mar 2001 00:15:07 -0700


> I would call what you need for an efficient XSLT implementation "lazy
> lists." They are never infinite but you would rather not pre-compute
> them in advance. Often you use only the first item. Iterators probably
> would be a good implementation technique.

Well, if you don't want unmanageablecode, you could get the same benefit as 
stackless by iterating rather than recursing throuought an XSLT imlementation. 
 But why not then go farther?  Implement the whole think in raw assembler?

What Stackless would give is a way to keep good, readable execution structured 
without sacrificing performance.

XSLT interpreters are complex beasts, and I can't even imagining replacing 
4XSLT's xsl:call-template dispatch code to be purely iterative.  The result 
would be impenentrable.

But then again, this isn't exactly what you said.  I'm not sure why you think 
lazy lists would make all the difference.  Not so according to my benchmarking.

Aside: XPath node sets are one reason I've been interested in a speed and 
space-efficient set implementation for Python.  However, Guido, Tim are rather 
convincing that this is a fool's errand.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python