From owner-freebsd-current@freebsd.org Sun Nov 15 23:36:15 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4FCA30FC0 for ; Sun, 15 Nov 2015 23:36:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD251359; Sun, 15 Nov 2015 23:36:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id tAFNa6Bi005630; Sun, 15 Nov 2015 15:36:10 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201511152336.tAFNa6Bi005630@gw.catspoiler.org> Date: Sun, 15 Nov 2015 15:36:06 -0800 (PST) From: Don Lewis Subject: Re: libXO-ification - Why - and is it a symptom of deeper issues? To: allanjude@freebsd.org cc: freebsd-current@freebsd.org In-Reply-To: <5648CA60.3060800@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2015 23:36:15 -0000 On 15 Nov, Allan Jude wrote: > On 2015-11-15 13:06, Garrett Cooper wrote: >> >>> On Nov 15, 2015, at 09:51, Andrey Chernov wrote: >>> >>>> On 15.11.2015 20:37, Adrian Chadd wrote: >>>>> On 15 November 2015 at 09:10, Dan Partelly wrote: >>>>> Meaning, is that simple to push things in head , if somone does the work, even with with no proper review of the problem at hand , and the proposed solutions ? >>>> >>>> Nope and yup. The juniper folk had a solution to a problem multiple >>>> people had requested work on, and their proposal was by far the >>>> furthest along code and use wise. >>>> >>>> It's all fine and good making technical decisions based on drawings >>>> and handwaving and philosophizing, but at some point someone has to do >>>> the code. Juniper's libxo was the furthest along in implementation and >>>> production. >>> >>> It seems it is the only and final argument for libXO existence. I >>> remember 2 or 3 discussions against libXO spontaneously happens in the >>> FreeBSD lists, all ended with that, approximately: "we already have the >>> code and you have just speculations". Alternative and more architecture >>> clean ideas, like making standalone template-oriented parser probably >>> based on liXO, are never seriously considered, because nobody will code >>> it, not for other reasons. >> >> We lack a [dtd/json] spec for tools, so programming for xo'ification doesn't seems like the best idea in the world to me from a end-user sysadmin/developer perspective. >> >> I could just as easily use standard tools like awk, grep, sed, and more advanced languages like perl or Python to parse output, and assuming output doesn't get a major rewrite, I'd just go with that method that's worked pretty well for me over the last 10 years of my career.. >> >> Cheers, >> -NGie >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >> > > The big difference is, a json parser isn't going to blow up if a new > field gets added in the middle, and your awk/grep/sed script probably will. Or more likely, if some value gets large causing adjacent columns run together. Or even if you the utility is used to display something where some of the data contains whitespace. How is an awk script going to cope with this: # grep spacey /etc/passwd spacey user:*:6666:6666:Update Builder:/tmp/spacey:/bin/csh # su 'spacey user' % cd ~ % touch 'a file' % ls -l total 1 -rw-r--r-- 1 spacey user 6666 0 Nov 15 15:24 a file vs a json parser: % ls --libxo json -l {"__version": "1", "file-information": {"directory": [{"total-blocks":1, "entry": [{"name":"a file","mode":"-rw-r--r--","mode_octal":644,"links":1,"user":"spacey user","group":"6666","type":"regular","size":0,"modify-time":1447629885}]}]} }