On 3/2/15 5:30 PM, Alfred Perlstein wrote:

On Mar 2, 2015, at 4:22 PM, Andrey Chernov <a...@freebsd.org> wrote:

On 02.03.2015 22:55, Julian Elischer wrote:
On 3/2/15 5:27 AM, Alfred Perlstein wrote:

On 3/2/15 4:14 AM, Julian Elischer wrote:
On 3/1/15 10:49 AM, Harrison Grundy wrote:

That does seem useful, but I'm not sure I see the reasoning behind
putting into base, over a port or package, since processing XML in base
is a pain, and it can't serve up JSON or HTML without additional
utilities anyway.

(If I'm reviving a long-settled thing, let me know and I'll drop it.
trying to understand the use case for this.)
To me it would almost seem more useful to have a programmable filter
for which you could produce
parse grammars to parse the output of various programs..

ifconfig -a | xmlize -g ifconfig | your-favourite-xml-parser
with a set of grammars in /usr/share/xmlize/
then we could use it for out-of-tree programs as well if we wrote
grammars for them..

The sentiment of machine-readable output is nice, but I think it's
slightly off target.
we shouldn't have to change all out utilities, and it isn't going to
help at all with 3rd party apps,
e.g. samba stuff. A generally easy to program output grammar parser
would be truely useful.
and not just for FreeBSD.

I've been watching with an uncomfortable feeling, but it's taken me a
while to put my
finger on what it was..
Are you sure it's not the hairs on the back of your neck standing up
due to NIH?

Juniper has been doing this for years and it's very useful for them.
I'm not saying the ability to generate machine readable output is wrong,
but that the 'unix way' would be to make a filter for it. It seems that
the noisy people don't
agree with me so I will not stand in the way of progress..
I agree. Even if someone starts with json and xml only, it will need
some 3rd format soon, and adding any new format have real possibility to
break all already existent (like adding json+xml breaks plain text in
pipes). Moreover, it violates Unix principle 'one tool == one general
function' and lots of other rules like Eric Raymond ones, making each
program looks like systemd. It makes harder to merge changes from other
BSDs too.
Proper way to do this thing is to back out all changes and write
completely separate templates-based parser - xml/json writer.

Read the library. It doesn't care what output format it needs. It is up to the 
translation layer to do it. You could even do a csv format or most any other 
structured output format without changing the userland utils.
As far as I can see that's not an argument either way.
I just think it makes more sense to spend more time writing one generic converter and grammar files than to mess up the insides of every utility in the system. If we had a tool, we could have grammar templates for 3rd party tools easily.. do YOU want to make libxo changes to 3rd party ports? of course not. so you are going off here solving a half of the problem.

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to