From owner-freebsd-current@freebsd.org Sun Nov 15 18:10:39 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 D8329A2F854 for ; Sun, 15 Nov 2015 18:10:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (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 ABF291A32; Sun, 15 Nov 2015 18:10:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pabfh17 with SMTP id fh17so151879067pab.0; Sun, 15 Nov 2015 10:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KRJXsFOyXngQqhAt62136I23ISRrlWFyCyFREr9pyqI=; b=TAQf5NT1buDpwrE3KqJQWYjlyhVlCaUSt9u5NZ6nhX+I7TeaIsXhlrMW8dzD8xSmkC fXNzYTUPAHcQ0tOIise04as90Pu+jopyC9jtF+/eK0/rYtwrCKHBDQtXu2iTb9BH3u4D l61TLSp70HjcLawJEzEx/MLHru0P9LIQbAdRe7aJhBGyIx9PLWtNH1egh8wnryEGsdo+ /MXCh3BdSQStTJfCU3gjML8hxydxCwrjb0XJSFvT0WblITy98cebY4AAF7hJnooSMoz3 dLtdrO8iHaBy+aP/l19xo5GaoWf0z2/rCzOke3gzTdCd+2jx03zD7Pm9ifKiWtADn8b5 c5Eg== X-Received: by 10.68.68.233 with SMTP id z9mr43106292pbt.76.1447611039347; Sun, 15 Nov 2015 10:10:39 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:5949:ebdc:f5b2:56d8? ([2601:601:800:126d:5949:ebdc:f5b2:56d8]) by smtp.gmail.com with ESMTPSA id ws6sm31658750pbc.33.2015.11.15.10.10.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Nov 2015 10:10:38 -0800 (PST) Content-Type: text/plain; charset=cp932 Mime-Version: 1.0 (1.0) Subject: Re: libXO-ification - Why - and is it a symptom of deeper issues? From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <5648C964.2020405@freebsd.org> Date: Sun, 15 Nov 2015 10:10:37 -0800 Cc: freebsd-current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2DF061E9-2541-4B10-9744-C49C515FF672@gmail.com> References: <0650CA79-5711-44BF-AC3F-0C5C5B6E5BD9@rdsor.ro> <5648C964.2020405@freebsd.org> To: Allan Jude 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 18:10:39 -0000 > On Nov 15, 2015, at 10:05, Allan Jude wrote: >=20 >> On 2015-11-15 07:54, Dan Partelly wrote: >>=20 >> Hi all, >>=20 >> I was looking at the new facility of dumping JSON,XML from many utils in b= ase and after some funny minutes, I couldn't stop ask myself =81g Ok, this i= s funny , but why ? =81g And I couldn't find a real answer. Ill outline what= I think: >>=20 >>=20 >> 1. Undoubtedly, it makes base code slightly harder to understand and main= tain. >=20 > I am not sure that libxo actually makes the code any harder to > understand and maintain. It might actually make it slightly better. >=20 > replacing: >=20 > printf("%s %s %d\n", foo, bar, number); >=20 > with: >=20 > xo_emit("{:foo/%s} {:bar/%s} {:number/%d}", foo, bar, number); >=20 > it not really hurting much. That's by and large true, but there are other APIs that need to be called on= exit (xo_finish?) and in other scenarios where flushing, etc is needed. If y= ou don't do that, you don't get the output you expect (which broke uptime/w s= everal months ago..). Also, typos with the meta language into the xo_emit calls have bit is more t= han once ;(.=