tech-userlevel archive

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

Re: proplist



On Thu, Apr 15, 2010 at 09:50:05PM -0400, der Mouse wrote:
 > > Ugliness is highly subjective.  This form can be considered ugly
 > > because it has a lot of completely extraneous double quotes.  For
 > > example.
 > 
 > Not completely extraneous.  _Something_ has to delimit strings, and
 > whether it's better to use " " or <long-string> <long-string/>
 > is...well, I suppose "highly subjective" about covers it.

Well yes. Except, the names of *fields* generally are (and generally
should be) identifiers, not the general case of strings. So while
string values ultimately need to be quoted or escaped somehow, field
names shouldn't be. This leads to formats like

        foo {
           bar = 3;
           baz = "qwerty";
        }

(modulo assorted variant punctuation)

which are in general much easier to read and edit and thus much more
suitable for config files than XML is.

The parsing for any of these formats, even the Common Lisp one, is
trivial. The hard part is interfacing the parser results to an
application; this is what proplib is supposed to do, and IMO, it does
a pretty poor job. My opinion is colored by having spent most of the
last three years working on tools for handling semistructured data (an
only slightly more general model than plists) but I don't think it
would be much different if I hadn't.

The primary problem, really, is that proplib can't make up its mind if
it's a tool for *shipping* data or a tool for *managing* data. (The
difference is whether it's expected that the data will be unpacked
from proplib into some native representation, or whether proplib will
be used to hold and manipulate it after receiving it.) If the former,
operations like prop_object_equals are unnecessary bloat; if the
latter, they're not nearly enough and you also really want to have
many more operations -- things like prop_number_add(), for example.

I would say what we actually *want* for most of the places proplib has
been used or proposed is a shipping tool, and in cases where we really
want a management tool we should be using libdb or sqlite or something
else along those lines, the precise choice depending on the situation.

Unfortunately, so far it hasn't really been possible to discuss this
point.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index