tech-userlevel archive

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

Re: wc(1) Output and POSIX



On Wed, Dec 28, 2016 at 02:54:00AM +0000, David Holland wrote:
 > I... think the library itself looks pretty gross,

to wit, it's doing almost exactly the same things as proplib or any of
the proposed proplib replacements, just with a very slightly different
goal.

The goal of proplib, as eventually more or less concluded after many
rounds of bikeshedding over the last several years, is to provide an
interface for transferring structured data that isn't dependent on
a C compiler's binary layout of struct members.

The goal of this library is to output printable structured data into
any of several standard forms, possibly doing some rendering/
formatting in the process.

In both cases, the expensive part is the API for feeding in structured
data.

libxo's API is, as far as I can tell from the partial documentation in
its man page (there's a link to more documentation posted on github,
which doesn't work), nearly as complicated as proplib, but completely
different and seems to be based on some idea of streaming without even
proplib's minimal attention to having a data model.

Except, if you're going to have a mode that renders the output before
printing it, you kind of really want to have a document tree you can
process, even more than if you're just spitting out a standard format
to be read in later/elsewhere by another instance of the same library.

Meanwhile the API doesn't seem to have any facilities for specifiying,
you know, actual formatting, other than what seems to be an
incompatible reinvention of printf.

So I would vote against this thing. We can do better. Also, as we've
seen with proplib replacement proposals, it's the API design that's
expensive and the code itself is a weekend's work or maybe two. So we
don't save much by reusing the libxo implementation... unless we want
to have the API for compatibility with FreeBSD code, and you know, I'd
rather not.

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


Home | Main Index | Thread Index | Old Index