February 27, 2021
Hot Topics:

Is Stackless Python for You?

  • 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

This article was originally published on December 6, 2000

Enterprise Development Update

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

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