Python AST as XML

Oleg Paraschenko olepar at
Fri Oct 29 16:26:29 CEST 2004


Andy Dingley <dingbat at> wrote in message
news:<3sg1o0djs6u5o055pvu88610n5k5498i1q at>...
> On 27 Oct 2004 23:09:02 -0700, olepar at (Oleg Paraschenko)
> wrote:
> >maybe of some interest:
> Maybe 5 years ago, before we realised what a bad idea it was.

  Definitely, I'm not from this "we" set.

> >
> >
> >[quote]
> >XML can be considered as an external representation of in-memory
> >tree-like structures, 
> Yes. But why would I want to ?

  Have you used XPath to navigate in a tree? Have you wrote functions
to navigate in a tree manually, using some DOM-like interface? If yes,
then you know the difference. It is like using regexps vs manual string

>   XML is a clumsy _internal_
> representation and it's only useful as an external representation if
> you need some lowest-common-denominator more than you need a good and
> appropriate representation.

  No, I don't worry about lowest-common-denominator. I know a silver
bullet for tree processing (xpath + xslt) and want to use it.

>  The best external representation of
> Python is some Python source, not some over-abstracted XML version.

  It depends. How can you, for example, eliminate tail recursion
in the Python source form representation?

> > and XML-related standards as methods of processing such data. 
> XML-related protocols don't process data, they process an XML
> representation of that data.

  While data and XML representation are isomorphic, it is not

> Their ability to do so is based on the
> XML aspect of it, not the underlying data model. This makes them
> somewhere between clumsy to develop wiith, or simply incapable of
> addressing the problem.

  When data is tree, a gap between XML and data is minimal.

> "Lets make all our data standards interwork by using XSLT" was the
> theme of late '99.   It didn't work.


More information about the Python-list mailing list