Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2014 22:11:58 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: [GSoC] Machine readable output from userland utilities
Message-ID:  <53802A1E.8060201@mu.org>
In-Reply-To: <537FB374.2000800@highsecure.ru>
References:  <49E9736E-AD14-4647-8B15-30603D01360C@mail.bg> <537F0DD9.6090805@highsecure.ru> <537F11A9.8020504@mu.org> <CAETOPp0k8kESHkYShksovDm04pm4as9DoAfCm2-ojJ3in=4hsw@mail.gmail.com> <CAJ-VmomBDfePkKXMf_piG%2BhnhmwhhTREm5a5m2Qt=7U8E585Ww@mail.gmail.com> <537FB374.2000800@highsecure.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

On 5/23/14, 1:45 PM, Vsevolod Stakhov wrote:
> On 23.05.2014 17:04, Adrian Chadd wrote:
>> Hey all,
>>
>> I'd actually prefer that some library API (like what's in libstatfoo)
>> gets fleshed out to cover what hooks and options are required so you
>> don't have to have the bikeshed argument of "what format." You only
>> need to write some code to output it in the format you want.
>>
>> The UNIX way is tools, not policy. The library is a policy, sure, but
>> it's a policy to let you define your own policies. It won't be locking
>> anyone into anything like "json or bust."
>>
>> So how about the focus be on that, rather than trying to teach
>> individual tools about individual encoding types?
>
> That is actually exactly what I'm proposing by using UCL. Store output 
> as UCL objects and convert them to a human readable output, json, xml, 
> yaml, libnv. Moreover, libucl is already in the base, so it is worth 
> to check if its capabilities is enough for the vast majority of 
> userland tools.
JFYI, this is probably a little different from what is needed.  This is 
due to the needs of streaming output utilities such as "netstat 1" or 
"vmstat 1", etc.

What we likely want is something very simple and is a streaming output 
like SAX.  Right now we are looking at YAJL which offers a streaming 
output which is perfect for long running status commands. The goal would 
be to make a shim that sits between YAJL and the application which also 
would allow use of xml streams and other streams such as ucl and yaml.

http://lloyd.github.io/yajl/

-Alfred








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53802A1E.8060201>