Xython - XML-Formed Python

Steve Horne steve at lurking.demon.co.uk
Fri Feb 8 06:40:26 EST 2002


On 5 Feb 2002 13:48:22 -0800, alanmk at hotmail.com (Alan Kennedy) wrote:

>Steve Horne <steve at lurking.demon.co.uk> wrote:

>> The XML would certainly not be easy for people to edit, but it's not
>> meant to be - the presentation is an issue for the editor.
>
>Hand-editing would be a PITA. One of the xython proponents seems to be
>focussed more on the ability to autogenerate python/xython from XSLT,
>but for the life of me, I can't think of a use case for this that would
>not be better served with a dedicated code manipulation/generation tool.

Here, I agree with you except for one thing - XSLT is a standard,
which has some advantages in itself. Develop a library of 'templates'
using XML and XSLT, and presumably you are not making yourself
dependent on some single-vendor tool set.

It's not something I'd be keen to follow up, though. I've already
developed pretty much my ideal templating facility by simply
pre-processing Python scripts to add an ASP-like string literal with
substitutions and block structures. And importantly, it's not limited
to generating Python.

>> But yes, I can see problems. For instance, the error reports would
>> relate to the XML AST - not to the visible representation of the
>> source code.
>
>And don't forget that speedwise, an XML parser would be extemely unlikely
>to be faster than a dedicated parser, even just checking for well-formedness,
>let alone validity.....

Agreed - in fact, it would probably be significantly slower for the
simple reason that the input files are bulkier and contain more text
to process.

-- 
Steve Horne
steve at lurking.demon.co.uk



More information about the Python-list mailing list