gabriel rosenkoetter on 28 Nov 2003 08:52:02 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] XML, text, and the development of unix


On Tue, Nov 25, 2003 at 09:20:47AM -0500, Alex Birch wrote:
> Please show me an example where seeing in XML where there is a 
> difference between a tab or a space?

I was generalizing the mistake. You made a syntax error, make(1)
barfed on it. There is *more* syntax to know in XML and, thus, more
potential for mistakes.

I don't see the "copying from a book" case as particularly relevant.
First, the book's author, if he's teaching Makefile syntax, is
responsible for pointing out that rule definitions need to be
prefaced with a tab. Second, I find it hard to believe that you
consult a book on every XML tag that you type.

I trust you have the same complaint against Python?

> With XML at least I can SEE the difference.

That is true, in this specific case.

> What I was thinking is just a thin wrapper and know when you're inside a 
>  tag. Then just return the tag.

I'm not sure I understand what you mean here. Could you give an
example of input and output?

> I said line-centric; I meant tag-centric.

I that thought you might.

> What other traditional tools would be nice? xsed? xgrep?

Weren't we discussing xgrep? (Did you mean xawk?)

I think sed and awk's functionality doesn't necessarily map cleanly
onto XML. When I use xawk, do I want the whole tag, do I want the
contents of the tag, what? When I use xsed, do I want only to
replace tag names? Do I want to replace tag values? There're some
serious interface questions that would need to be considered to
adhere to the principle of least surprise.

On Tue, Nov 25, 2003 at 09:50:55AM -0500, Alex Birch wrote:
> gabriel rosenkoetter wrote:
> >But I think having XML files replace passwd would be ridiculous.
> >It'll make programmatic access to those files slower, which is
> >pretty definitely not something you want. It also violates the
> >principle of least surprise (it's been the way it is for a long
> >time), and it's fixing something that isn't broken.
> Would making the .conf file in binary be worth it for the speed up?  How
> frequently are you going to reading those files?

No, because it wouldn't speed things up noticeably on most systems.
(Parsing an ASCII file with exactly the amount of data you need like
/etc/passwd isn't significantly slower than finding your data in,
say, a Berkeley DB until you get more than a few thousand records.)

Note though, that we do replace what could be a flat file with
binary files ofr MTAs (as for /etc/aliases in Sendmail, but also for
all the various maps under Postfix).

I note you neglected my other two objections there...

> I'm a huge fan of extreme programming: where your variables are your
> documentation.

Huh? I thought extreme programming was the latest silly buzzword to
mean "two people working together on the same computer". Has its
meaning been overloaded?

In any case, I think that's a really terrible idea. People who
program code that runs well typically don't document well, and
especially if they're forced to type absurdly long variable names,
they'll just be slowed down.

> XML allows programs to use the same conf files but ignore
> tags that aren't important for them.

How is that different from existing facilities?

> This could facilitate migration between sendmail and exim.

... assuming either application could use XML configuration files
which, unless I'm mistaken, neither can.

On Tue, Nov 25, 2003 at 11:23:16AM -0500, kmhryhpdblyx@spammotel.com wrote:
> That's why I said "basic syntax".  It means I don't have to worry about 
> knowing to use tabs instead of spaces for example.

You do, however, have to worry about knowing when to use angled
brackets and double quotes.

> Sorry, I thought we were discussing text config files?  I look at it this 
> way, it's pretty neat to have the _option_ of creating an XSLT stylesheet 
> for your config file if that's what turns you on.   Then you could display 
> your config file in a browser if you'd like.

You still have to know a layout (what tags to use) for the config
file, just like you now have to know the format of /etc/passwd, in
order to create a new entry. Without a universal agreement between
software programs that use an XMLized /etc/passwd on what those
tags are, you'll end up with some redundancies (just as information
is now stored redundantly in the POSIX LDAP map).

> >On Tue, Nov 25, 2003 at 10:44:14AM -0500, kmhryhpdblyx@spammotel.com wrote:
> >> I'm in the camp that thinks XML simplifies life.
> At 11:09 AM 11/25/2003, you wrote:
> >XML makes some problems simpler, but it is not a universal simplifier.
> I never said it was.

Actually, I think you did. Right there.

Btw, could you please cite a little bit more clearly in the furture?
"you wrote" isn't very meaningful on a mailing list...

> How so?  I detect the error and handle it in an appropriate manner.

That's the hard problem that XML doesn't solve. Detecting every
possible error is *always* difficult in anything more complicated
than the most trivial situation.

> What difference does it make how the file is formatted?

Then having a very strict format, like /etc/passwd, makes it easy to
detect semantic errors. Having a relatively freeform format like XML
makes it computationally more complex to solve the same problem for
no clear benefity.

> My main point is that I think it's easier for a casual user to understand a 
> well-written XML config file because they don't have to first understand 
> the application-specific syntax of the plain text config file.

But they do! There will HAVE to be application-specific tags in that
config file, which means that they will have to understand how the
application intends to use those tags, which means they might as
well understand the cnfig file format you're XMLizing.

On Tue, Nov 25, 2003 at 12:18:05PM -0500, Adam Turoff wrote:
> For example, I can put a LoadModule declaration in my XF86Config in the
> right place, but LoadModule is meaningless in my .bashrc.  Both are
> using the same syntactic representation -- ASCII.  Converting both to
> XML doesn't help me configure X once I have a bunch of bash aliases set
> up on my .bashrc.

Perfect example, Adam, thank you.

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpah7wl2Rbqa.pgp
Description: PGP signature