Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Python AST as XML

From: paul@------.---.-- (---- ------)
To: NULL
Date: 11/2/2004 8:00:00 AM
Andy Dingley <dingbat@c...> wrote in message news:<3sg1o0djs6u5o055pvu88610n5k5498i1q@4...>...
> On 27 Oct 2004 23:09:02 -0700, olepar@g... (Oleg Paraschenko)
> wrote:
> 
> >maybe of some interest:
> 
> Maybe 5 years ago, before we realised what a bad idea it was.

Actually, it's something I've considered before myself, and there are
apparently various extensions to GCC (the compiler suite, not just the
C compiler) which support similar concepts, so I suppose it's the
royal "we" you're using.

> >http://pysch.sourceforge.net/ast.html
> >
> >[quote]
> >XML can be considered as an external representation of in-memory
> >tree-like structures, 
> 
> Yes. But why would I want to ?   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.  The best external representation of
> Python is some Python source, not some over-abstracted XML version.

Unless you're writing tools in other languages. I personally find the
various Python modules for source code inspection to be adequate, but
you can't just import the compiler package in Java, for example.

> > 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. 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.
> 
> "Lets make all our data standards interwork by using XSLT" was the
> theme of late '99.   It didn't work.

It may not have worked in the royal court, but XSLT has lots of
interesting and productive uses provided you choose your problems
carefully. I can imagine that transforming various sections of Python
code (for simple macro implementations, for example) *is* one of those
problem areas in which XSLT can usefully be used. Moreover, by
choosing XML, the developer(s) have at least opened an area up to
various effective tools (including XSLT) which could not have been
readily used in that area before; that in itself suggests that the
project was worth undertaking, if only for the benefits subsequent
projects can derive from it.

Paul


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent