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

Guido van Rossum wrote:
> On 4/9/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> > Robert Brewer wrote:
> > > Part of the benefit of the bytecode-hacking is that
> > > your _expression_ never has to be in a string.
> >
> > I'm wondering whether there should be some kind of
> > "code literal" syntax, where you write a Python
> > _expression_ and the compiler transforms it as far
> > as the AST stage, then makes it available to the
> > program as an AST object.
> >
> > Or would that be too close to "programmable
> > syntax" for Guido's liking?
>
> 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,
> otherwise those implementations will face the tough choice
> of either changing their parser technology to one that
> is probably less suited, or implementing two full parsers.

Not to mention cross-version issues with persisted AST objects or bytecode-sequences. When pickling my _expression_ objects, I chose to decompile them back into Python code for that reason. Although I had to upgrade the decompiler between 2.3 and 2.4 (to allow for the JUMP target changes, for example) I didn't have to upgrade a single saved _expression_ object.


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to