October 28, 2016
Hot Topics:

Is Stackless Python for You?

  • December 6, 2000
  • By Cameron Laird
  • Send Email »
  • More Articles »

Powerful Parsing

The same underlying mechanisms are helpful in a much different, and more widely needed, functional domain: text processing. Many programmers find the "regular expressions" available in Perl and other languages, including Python, an epiphany of productivity, in comparison to the byte-oriented procedural pattern-matching they first learned. However, there are language constructs as much more powerful than regular expressions as regular expressions exceed character comparison. Icon, for example, has "generators," which are, roughly speaking, expressions that return multiple values. Generators have resonances with the "functional" features--lambda, map, list comprehensions--that have been added to recent Python releases. A generator efficiently expresses such operations as, "find instances of 'entitlement' in the vicinity of a numeric year after 1994 in the top half of any formatted page." In fact, generators usually have "lazy" semantics so that a monitoring application might begin to display the first instances before the entire document has been scanned.

With the generators that Stackless Python provides, savvy programmers can build remarkably efficient and concise parsers for a variety of computing and human language problems.

How Do I Get Stackless Python?

Stackless Python is not part of the standard Python release for either version 1.6 or 2.0. You can, however, download a copy from the Stackless Python home page at www.stackless.com. Stackless Python is sufficiently well-verified that several developers, like independent consultant Gordon McMillan, already rely on it for production deliveries. It's widely expected that stackless elements, probably including microthreads first, will appear in future Python releases, perhaps as early as version 2.1. All the details of syntax and semantics remain provisional, though, as of mid-November 2000.

For deeper explanations of Stackless Python construction and capabilities, see http://starbase.neosoft.com/~claird/comp.lang.python/stackless.html/

About the author:
Cameron Laird is vice president of Phaseit Inc., in Friendswood, Texas. He writes frequently on Python programming topics and welcomes e-mail comments.

Page 2 of 2

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel