librelist archives

« back to archive

Another example of using Python AST

Another example of using Python AST

Mark Dewing
2012-07-02 @ 13:10
    After seeing the Numba project, I tried something similar.   Mostly to
try out a pattern matching / structure decomposition approach to walking
the Python AST (vs. the standard visitor technique).  And to learn llvm-py
(and llvm).    It does the translation at run time in order to get accurate
type information.

The code is here (project is called 'pyvoom'):

It only translates some expressions, very simple loops, and indexing into
1-D Numpy arrays.

Mark Dewing