[Python-3000] AST access (WAS: Adaptation vs. Generic Functions)

Guido van Rossum guido at python.org
Mon Apr 10 17:35:54 CEST 2006


On 4/10/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Guido van Rossum wrote:
>
> > I'm more concerned about the choice of AST data structure and how it
> > affects IronPython, PyPy, Jython and possible other Python
> > implementations. I'd like to keep both the AST and the bytecode spec
> > out of the language spec,
>
> Well, it wouldn't be any less portable than
> bytecode hacking, and could potentially be
> made more portable.
>
> A standard non-text representation of Python
> code seems like a useful thing to have,
> even if it's implemented quite separately
> from the main compiler.
>
> We're actually part way there already, with
> the internal AST <--> python AST transformation.
> The other implementations would just need to
> provide their own versions of that transformation.

Well, maybe I should check in my pgen-in-Python implementation after
all; that can do it out of the box except for the small detail that
the symbol numbers for the grammar non-terminals  don't match
symbol.py.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list