XML DTD for Python source?

Greg Wilson gvwilson at nevex.com
Fri Mar 3 08:49:48 EST 2000


> "Neel Krishnaswami" <neelk at brick.cswv.com> wrote
> XML might be a useful interchange format, but IMO it doesn't
> really help solve the core difficulties in this enterprise.

I wasn't expecting XML to solve my problem; however, given the growing
number of high-powered XML manipulation tools out there, I figured that
using it might make my problem easier to solve.  At the (trivial for power
users,
non-trivial for beginners) level, it'd also allowed users to format their
code in the
same rich ways that they format web pages.

> [literate programming, Ensemble, etc.]

Thanks for the Ensemble link --- I know my way around literate programming
fairly well, but hadn't run into the Berkeley project.

> Neel:
> what would an XML representation for Scheme programs look like?

> Greg:
> I don't know, but I don't think it would look like the token-level
> representation you posted.  I think it would look more like an XML
> encoding of an abstract syntax tree (AST).

> Neel:
> ...you *can't* store arbitrary Scheme code in semantically
> rich XML, because predicting whether you can finish reading a Scheme
> program is equivalent to the Halting Problem.

Yes, I'm aware that you can't capture the whole of a program's semantics
by textual analysis.  However, having written Scheme compilers in Scheme,
and having messed around (fifteen years ago) with Scheme-to-C compilers,
I seem to remember building AST's for the language that contained more than
just the syntax...

Thanks,
Greg (who is still looking for a DTD for a programming language)





More information about the Python-list mailing list