From owner-freebsd-current@FreeBSD.ORG Mon Mar 2 09:28:05 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BE57CEF for ; Mon, 2 Mar 2015 09:28:05 +0000 (UTC) Received: from mailout.easymail.ca (mailout.easymail.ca [64.68.201.169]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3C5F772 for ; Mon, 2 Mar 2015 09:28:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id D72C6E43C for ; Mon, 2 Mar 2015 04:28:02 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at mailout.easymail.ca X-Spam-Flag: NO X-Spam-Score: -3.85 X-Spam-Level: X-Spam-Status: No, score=-3.85 required=5 tests=[ALL_TRUSTED=-1.8, AWL=-0.143, BAYES_00=-2.599, DNS_FROM_AHBL_RHSBL=0.692] Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (easymail-mailout.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ijo8H24aAKnz for ; Mon, 2 Mar 2015 04:28:02 -0500 (EST) Received: from bsddt1241.lv01.astrodoggroup.com (unknown [40.141.24.126]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 82C67E435 for ; Mon, 2 Mar 2015 04:28:02 -0500 (EST) Message-ID: <54F42C6A.1000309@astrodoggroup.com> Date: Mon, 02 Mar 2015 01:24:58 -0800 From: Harrison Grundy User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: Massive libxo-zation that breaks everything References: <54F31510.7050607@hot.ee> <54F34B6E.2040809@astrodoggroup.com> <54F35F29.4000603@astrodoggroup.com> <75C49F53-C675-4712-A446-370025EED037@me.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 02 Mar 2015 12:33:11 +0000 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: Mon, 02 Mar 2015 09:28:05 -0000 On 03/02/15 01:23, David Chisnall wrote: > On 1 Mar 2015, at 21:29, Rui Paulo wrote: >> >> On Mar 1, 2015, at 11:11, David Chisnall >> wrote: >>> How would it be in a port? It involves modifying core >>> utilities (some of which, like ifconfig, rely on kernel APIs >>> that change between releases) to emit structured output. >>> Maintaining two copies of each utility, one in the base system >>> with plain-text output only and another in ports with XML/JSON >>> output would be very painful. >> >> It would work fine if we had *libraries* for >> ifconfig/netstat/route/etc. Obviously that's not the case and no >> one has stepped up to implement them. I've also seen FreeBSD >> committers expressing their distaste for libraries for "trivial" >> command line utilities, which implies they are unaware of another >> world beyond the CLI. :-) > > I am completely in favour of libraries for the underlying > functionality of these commands and would love to see all of the > system management commands become thin wrappers around a library, > though it's a lot of engineering work. In particular, these > libraries will need to have stable APIs that we can support across > multiple major releases, and getting those right is difficult. We > really don't want to be stuck in 10 years maintaining a hastily > designed API for a library. > > I see one use of the libxo output as helping to design those APIs. > People are going to wrap various tools in libraries for their > favourite scripting languages and this will give us a corpus for > experimenting. > > It's also worth noting that often invoking a tool and consuming its > output is the easiest way to get a stable API and ABI where > performance is not a primary concern (i.e. most management > interfaces). > > As to a world beyond the CLI, I saw a nice demo a few years ago of > a terminal emulator that used WebKit and came with a hacked-up set > of parsers for common tools. I'd love to have something simpler > (no need for a full WebKit - simple outline and table views would > be enough and could be done with curses for ssh) for FreeBSD where > I could type ls in the CLI and get a table view that I could then > sort and filter by selecting column headings. Those of us that > have used Lisp and Smalltalk environments know that a CLI doesn't > have to be a teletype emulator. > > David It would seem like the libxo stuff runs the risk of becoming this same API. --- Harrison