Recompile AST?

Bengt Richter bokr at oz.net
Fri Nov 11 02:41:10 EST 2005


On 10 Nov 2005 16:07:56 -0800, "Paul Boddie" <paul at boddie.org.uk> wrote:

>Bengt Richter wrote:
>> I've also posted sporadic musings about the possibilities for AST-transforming
>> custom import functions to do optimizations and macros and special forms etc.,
>> but no one seemed much interested (or maybe they quietly went off to do
>> something of their own ;-)
>
>For an example of AST transformations, take a look at the
>libxml2macro.py script in the libxml2dom distribution [1]: it contains
>code which transforms ASTs based on simple rules (changing method calls
>to function calls) as well as the magic sequence of instructions to
>generate .pyc files from ASTs. Originally, the analysis distribution
>[2] also compiled modified ASTs to Python bytecode, but such activities
>didn't really fit in with the goals of that particular project.
>
>Paul
>
>[1] http://www.python.org/pypi/libxml2dom
>[2] http://www.python.org/pypi/analysis
>
Thanks for the links. I downloaded the tgzs but it will be a while
before I get into anything ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list