Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaranm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: gcc-config 2.0 development
Date: Tue, 09 Aug 2005 22:31:52
Message-Id: 20050809232808.0ae0de2a@snowdrop.home
In Reply to: [gentoo-dev] Re: gcc-config 2.0 development by Jeremy Huddleston
1 On Tue, 09 Aug 2005 15:12:48 -0700 Jeremy Huddleston
2 <eradicator@g.o> wrote:
3 | On Tue, 2005-08-09 at 22:19 +0100, Ciaran McCreesh wrote:
4 | > | but I think having the xml configuration files allows a much more
5 | > | robust configuration.
6 | >
7 | > How so? Using XML doesn't magically make your data files any
8 | > different. It simply makes them much harder to parse.
9 |
10 | That's a matter of opinion.
11
12 Not really. It's pretty easy to prove that a full XML parser is
13 computationally more complicated (and hence slower and more bug prone)
14 than most 'obvious' flat text file formats.
15
16 | I see it as a way to abstract away the
17 | configuration and utilize an existing library to handle the parsing.
18 | If we do want to eliminate outside dependencies (which I think is an
19 | extremely valid point and concern), then we could internally
20 | implement a different configuration format that is easier to parse.
21
22 Interacting with an XML library is around the same degree of difficulty
23 as writing a simple flat text parser. Remember that if you're using
24 XML, you have to be able to handle *all* the fancy XML nonsense,
25 including DTD voodoo and processor directives.
26
27 The only 'advantages' to XML are that you can partially validate the
28 syntax (but not the contents) of a file and that by writing a really
29 complicated XSLT mess you can transform it into a different XML file.
30 The former is a duff argument because a) the only reason you need
31 validation is because XML's syntax is so complicated and b) you can't
32 validate CDATA things anyway. The latter is silly because you can use
33 sed, grep, cut etc on any sane textfile format, and it's far easier
34 than XSLT.
35
36 | I'd probably go for something similar to the samba/gdm config files
37 | if we were to go down this road:
38 <snip>
39
40 Much saner.
41
42 --
43 Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
44 Mail : ciaranm at gentoo.org
45 Web : http://dev.gentoo.org/~ciaranm