XML DTD for the package configuration file

Isaac Jones ijones at syntaxpolice.org
Sun Oct 19 21:10:25 EDT 2003


Acceptance by Haskell developers is probably the most important factor
to this choice, and I'm definitely willing to go with the consensus
here, but I do want to make sure that XML gets a fair hearing.

I'm really not married to it, and I like the Haskell syntax better,
but it seems to me that XML offers package management systems (written
in other languages) an easy way to deal with the Haskell package
configuration file if they need to.  This is actually a big deal if we
want this system to integrate nicely with a wide variety of platforms.
Let's say that someone wants to write a tool to look at a package's
configuration file and build a package (RPM, DEB, etc) for their
system.  Are all such tools going to have to be written in Haskell?
What if emacs wants to parse the packages.conf file to track down the
source code for a library?

Furthermore, XML has a good way of specifying character encodings, and
it's pretty easy to parse and understand.

As for the assertion that it is unusable by both humans and computers,
I disagree.  In fact, it only takes a short time to learn, and for
something like the packages file, someone who has never seen XML
before could probably understand it and alter it.  Users of the
package system will not have to learn XML, and few programmers will
have to learn it.

The argument that we should not rely on other tools is definitely
valid, especially for this project, but we're only talking about a
single Haskell library (HaXml, which "locate" tells me is included
with GHC 6.0).  You say "Relying on other tools", I say "code reuse".
If I write a parser with Happy, as has been done for ghc-pkg, we're
still relying on other tools.  (I realize that there are other parsing
options.)

In short, I'm ready to agree that we drop XML, but I really don't feel
that anyone has given me anything to sink my teeth into with this
decision.

So to change the subject a little, has anyone written a generic parser
for the Haskell syntax?  It would be neat to have a parser that could
be used across projects to build an AST.

peace,

isaac


More information about the Libraries mailing list