Re: [GSoC] Machine readable output from userland utilities

看板FB_hackers作者時間11年前 (2014/05/24 13:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串24/29 (看更多)
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 _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
文章代碼(AID): #1JW2xIn_ (FB_hackers)
討論串 (同標題文章)
完整討論串 (本文為第 24 之 29 篇):
文章代碼(AID): #1JW2xIn_ (FB_hackers)