Do I need to use a validating parser?

Joshua E. Smith jesmith at kaon.com
Tue May 4 18:58:27 BST 1999


XML-Conformant.  Cool, I'll add that to the FAQ you wanted me to write. ;)

> > If you were using a programming language which is XML-ish, what XML
> > features would you be annoyed to see left out (substitution of entities is
> > an obvious one, which I've seen 3DML slammed for)?  
>
>I find it very hard to imagine coding in a Turing-complete
>programming language that is XML-ish -- markup languages are usually
>quite clumsy for representing programming languages.
>
>What exactly do you mean, here?

I really meant what I wrote.  I'm assuming that most programmers will not
actually write in the markup language, but rather will use editors which
produce markup as their output.  If you think about it, that's what's
already happening with tools like Access or Delphi (users work in an
editor, and for the most part, don't touch the code), and of course that's
almost the only way anyone can deal with HTML anymore.

So from that perspective, even if it was clumsy, it wouldn't really matter.

The right question is: Can a program be represented as a tree?  And the
answer is always yes.  For example, think about LISP.  What is that if not
a tree structured language?  And XML is *GREAT* for representing trees.

Now consider what happens to your favorite ALGOL-derived language (say,
Java) when you compile it.  It gets formatted by YACC into a parse tree.
So represent the parse tree in XML to begin with, and get rid of the
compiler front end.

My language isn't anything like LISP or ALGOL, but I think this gets the
point across.  It's pretty easy to write programming languages which are
XML-Conformant.

My language doesn't use constructs like "if-then" or "for-next" so the user
wouldn't be exposed to any nasty parse trees anyway; but even if it did, I
don't know that

<for var="i" from="0" to="100">
  stuff
</for>

is all that clumsier than the non-tagged equivalent.

-Joshua Smith


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list