From owner-freebsd-current@FreeBSD.ORG Tue Mar 3 01:37:56 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 3DE404E2 for ; Tue, 3 Mar 2015 01:37:56 +0000 (UTC) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) (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 A7F2291E for ; Tue, 3 Mar 2015 01:37:55 +0000 (UTC) Received: by labhs14 with SMTP id hs14so34339752lab.4 for ; Mon, 02 Mar 2015 17:37:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=UVEka7y+KKggYVhwuuMBDMy/l3b1YQMJ0B3dc803r+0=; b=HXzJXUni+qMNI3hW4cOXTt01iBAUchqhmvd4EXnPGvE3c211VrdUvk7ocKcC/DInZI kXcJn8m5Ajj78lyd+yOMVvJ/dSoOwnPhxzolmtwjUaclEzKE/OqRbL2C7EWrKwW81BYi e73Yxd9bKebCx3NeGd7ZSAvkkvjkDITNk7bqoKq0OQfs+KOd+akDvxUejAHgMLUL/BZB wfhSBC71wbOhcClGpdMeyB+H8kmQs8poETkRXbnGpgchHb9cv6are2dg3dlH2SFuz4Zi 7Ob7BtoXjaC5L5q5RRUKbiuwYIPMbLW1oMVUNy8uMlrRTm+VmnVVu8fLVUiUrlhuNHTR 7d1A== X-Gm-Message-State: ALoCoQlolnqQQ//gB9hNl/exOXJNbi4l8Z8O40Kbygd/0IVnzXwgOYsBOQE6ksnHqDmdrYCWkSHV X-Received: by 10.152.184.198 with SMTP id ew6mr7774058lac.46.1425346337395; Mon, 02 Mar 2015 17:32:17 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id ci4sm2852650lad.16.2015.03.02.17.32.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 17:32:16 -0800 (PST) Message-ID: <54F50F15.4050300@freebsd.org> Date: Tue, 03 Mar 2015 04:32:05 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Allan Jude , 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> <54F429EF.5050400@freebsd.org> <54F46536.8040607@mu.org> <54F4C03F.7030704@freebsd.org> <54F4FECB.90501@freebsd.org> <54F504EF.3030303@freebsd.org> In-Reply-To: <54F504EF.3030303@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x7vPIp1MaM7fxIJd0xniGlIruAErHh1qO" 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 01:37:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --x7vPIp1MaM7fxIJd0xniGlIruAErHh1qO Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 03.03.2015 3:48, Allan Jude wrote: > On 2015-03-02 19:22, Andrey Chernov wrote: >> On 02.03.2015 22:55, Julian Elischer wrote: >>> On 3/2/15 5:27 AM, Alfred Perlstein wrote: >>>> >>>> >>>> On 3/2/15 4:14 AM, Julian Elischer wrote: >>>>> On 3/1/15 10:49 AM, Harrison Grundy 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. >>>>>> >>>>>> (If I'm reviving a long-settled thing, let me know and I'll drop i= t. >>>>>> I'm >>>>>> trying to understand the use case for this.) >>>>> >>>>> To me it would almost seem more useful to have a programmable filte= r >>>>> for which you could produce >>>>> parse grammars to parse the output of various programs.. >>>>> thus >>>>> >>>>> ifconfig -a | xmlize -g ifconfig | your-favourite-xml-parser >>>>> with a set of grammars in /usr/share/xmlize/ >>>>> then we could use it for out-of-tree programs as well if we wrote >>>>> grammars for them.. >>>>> >>>>> The sentiment of machine-readable output is nice, but I think it's >>>>> slightly off target. >>>>> we shouldn't have to change all out utilities, and it isn't going t= o >>>>> help at all with 3rd party apps, >>>>> e.g. samba stuff. A generally easy to program output grammar parser= >>>>> would be truely useful. >>>>> and not just for FreeBSD. >>>>> >>>>> I've been watching with an uncomfortable feeling, but it's taken me= a >>>>> while to put my >>>>> finger on what it was.. >>>>> >>>>> >>>> Are you sure it's not the hairs on the back of your neck standing up= >>>> due to NIH? >>>> >>>> Juniper has been doing this for years and it's very useful for them.= >>> I'm not saying the ability to generate machine readable output is wro= ng, >>> but that the 'unix way' would be to make a filter for it. It seems th= at >>> the noisy people don't >>> agree with me so I will not stand in the way of progress.. >> >> I agree. Even if someone starts with json and xml only, it will need >> some 3rd format soon, and adding any new format have real possibility = to >> break all already existent (like adding json+xml breaks plain text in >> pipes). Moreover, it violates Unix principle 'one tool =3D=3D one gene= ral >> function' and lots of other rules like Eric Raymond ones, making each >> program looks like systemd. It makes harder to merge changes from othe= r >> BSDs too. >> Proper way to do this thing is to back out all changes and write >> completely separate templates-based parser - xml/json writer. >> >=20 > Have you actually looked at libxo? It isn't really specific to xmj/json= , > and could handle adding another format without the need to modify wc >=20 > xo_open_container("wc"); > xo_open_list("file"); > xo_open_instance("file"); > if (cnt(*argv) !=3D 0) > ++errors; > xo_close_instance("file"); > xo_close_list("file"); > xo_close_container("wc"); > xo_finish(); >=20 >=20 > with cnt() being the existing functions in wc, but with the printf > replaced with an xo wrapper. There is nothing specific to json or xml, > that is all handled in libxo. So, why you ever need to modify wc? Just load wc inside your json/xml/etc writer, replacing its printf at the ld-elf.so level. If you can't get json/xml/whatever from wc directly, it is not wc problem, so don't touch it. The problem is on your side, feel free to implement anything you need without affecting source code of others. > Obviously, more care needs to be taken when converting the utilities to= > ensure that the existing output is not changed, but it is not quite as > invasive as some people seem to think. I think yes, it is very invasive and leads to dead end as architectural design. --=20 http://ache.vniz.net/ --x7vPIp1MaM7fxIJd0xniGlIruAErHh1qO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJU9Q8fAAoJEKUckv0MjfbK5ioH/0Ds1EvyHevGoLq6KIhZHhcS CwicLW445TzI5IkvPXtSmxzVv0vjT6ArDluDfB2mDTFTY7ktqfS73Tk1IhpGDSht 4g4Q6QZwXg3s6DudyH98UCJdZLg2u/vfpniwdYXqhJqbDdRvoktGqixx9uzJUk/k GxE6QwJu4sJFesm1y5PrEYo2hkCPUw2RDpElefwh4pgavlu0xgRDdcZA3sNafgsn NwJYC9YDTwhp5/Q9FDiDYL/I6W7GiHG/LMLOkVQ0EuhvInRrNXxeSwHCkhZCy1c0 GMRRCCGr//y+XAQN1fgkjoxoCXeRdcXFF9eAZbB3wLQIfP5Dof/RbxeY4GDT7Fo= =1MiE -----END PGP SIGNATURE----- --x7vPIp1MaM7fxIJd0xniGlIruAErHh1qO--