From owner-freebsd-current@FreeBSD.ORG Tue Mar 3 22:14:15 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C620BD93; Tue, 3 Mar 2015 22:14:15 +0000 (UTC) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E42321C; Tue, 3 Mar 2015 22:14:15 +0000 (UTC) Received: by pablf10 with SMTP id lf10so56965680pab.12; Tue, 03 Mar 2015 14:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=R4fmBldnCJVk+J6QXbMoHg5+sjnmiTeHcHD5ImjKmkU=; b=LRDYDzDlqXAnY3KvlN3bHpugWlSzP2kaD2+ddiCV4ILVrb15ZeeqQsVz8bux/+Uyw9 152ECd9hXHaB9ndLb4uISEIrHcU6o77VxJkdKpk7ztjyFaRSLnp498GE5ipEvTNbmipA ipTdu2SHUfjs1YZ4mTMeKHaAsQ2cinmM/e2fgIExZVvN2IkmG23xT4OzStkRD5oAtntH 6t5o9zcA8GwdDjrVaY/rwixN8pWJrdR7vU4byXddsHwICT6a1oN31ZnuObI+QSB70oPP Afmo9wcIZxZBGUDyZnwlW/HjMR1BTgw4fJzfhrhU3OykevegGn+Z2rrSSaFQ2Vcn6XQc E77Q== X-Received: by 10.66.218.129 with SMTP id pg1mr1411542pac.65.1425420855005; Tue, 03 Mar 2015 14:14:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.66.237.39 with HTTP; Tue, 3 Mar 2015 14:13:54 -0800 (PST) In-Reply-To: References: <54F31510.7050607@hot.ee> <54F34B6E.2040809@astrodoggroup.com> <54F35F29.4000603@astrodoggroup.com> From: Arseny Nasokin Date: Wed, 4 Mar 2015 02:13:54 +0400 Message-ID: Subject: Re: Massive libxo-zation that breaks everything To: Craig Rodrigues Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Harrison Grundy , freebsd-current Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 03 Mar 2015 22:14:15 -0000 On 2 March 2015 at 00:25, Craig Rodrigues wrote: > On Sun, Mar 1, 2015 at 10:49 AM, Harrison Grundy < > harrison.grundy@astrodoggroup.com> wrote: > > > Thanks! > > > > 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. > > > > > I think if you take another pass at reading the entire thread of responses > to see the discussion for the motivation behind libxo, you will get the > idea: > https://lists.freebsd.org/pipermail/freebsd-arch/2014-July/015633.html > > > There are many people who are building products on top of FreeBSD. > For these people, it is super useful for the base utilities in FreeBSD > to emit output in properly formatted XML or JSON. > > That way, they do not need to write scripts to take the output of > say, netstat, and use awk/sed/whatever scripts to take the human readable > netstat output and convert it to a form which can be used in a script. > > There are many, many parsers for XML and JSON not in the base system. > For people building products on top of FreeBSD, they don't care > if these parsers are not in the base, since they can add these parsers on > top of base FreeBSD. > > For example, languages like Python and Ruby have excellent parsers > for JSON and XML. Many people build products using these languages. > There are JSON and XML parsers in C, C++, and other languages as well. > > In addition to people building products, the other audience of people who > benefit from libxo are devops people. > These days, devops folks have no problem using Python, Ruby, Perl, > whatever to write scripts to interact with Unix boxes and pull information > off of it. Having the base utilities emit info in native JSON or XML > greatly facilitates this. > > I talked to one person who is improving FreeBSD support for Saltstack (a > devops framework). He told me > that if more base utilities such as sysctl, could use libxo to emit output > in JSON, that would greatly facilitate improving FreeBSD support for > these devops frameworks. That is because Saltstack would require > less FreeBSD-specific parsing code for getting info from base utilities. > > -- > Craig > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > Craig, I think it's bad idea. If you look deep inside Mac OS X, you'll find plist(5) or similar format output of few utilities. They leave application output as is, and give library access (with Objective C Frameworks) to everyone who want to build anything. It includes Scripting Bridge interface to have public API to any program which exposes it. Yes, programs has libraries to be able to read and output JSON/XML/Plist formats natively. The better idea is give well-designed API and language bindings like py-objc or jpype for example. I don't think you really need libdf if you have libutil(3) to have information about free space. -- Eir Nym