From owner-freebsd-arch@FreeBSD.ORG Wed Jul 30 17:04:02 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B78260E; Wed, 30 Jul 2014 17:04:02 +0000 (UTC) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A73D9293F; Wed, 30 Jul 2014 17:04:01 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id q58so1537878wes.21 for ; Wed, 30 Jul 2014 10:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UB6FDSCMACqevbFpJDC+etOjkro6BgPX8EZZsE0CpVQ=; b=ytGHZoxN/g6GQDlykXl6boeLE+K62idjUwl3fmMR0TX1tpXKSHh+aVU8kDgQBvHXHm LjZJxCgdV+5XCgR1kpio76RXkfxMI8dLdmeuKF55D2SVac4x+vhD0LW4pF2pyx5W36z3 vESjXJOwIYdUY8fAsO7jt0wOs6+Fl669s/OMtJjySQWgiQ3NpQYsY6tes3plOBvfDmwv hfa4PzhF5XqwaswCZGMe3yd1W3ygAXm6BQgFldCUPg7D1pPSrX8HHiVNtrMVuN4TRAMw gSpGrX8GXRn5sGlueoqLDOKrVO+Ab5UeSDTnjJUPguiRyAP81E6XWfEpGJW3HVNkbamJ PWGQ== X-Received: by 10.194.77.177 with SMTP id t17mr7841449wjw.55.1406739839920; Wed, 30 Jul 2014 10:03:59 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id wi9sm6831485wjc.23.2014.07.30.10.03.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jul 2014 10:03:58 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 30 Jul 2014 19:03:56 +0200 From: Baptiste Daroussin To: Jos Backus Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML Message-ID: <20140730170355.GM37672@ivaldir.etoilebsd.net> References: <20140729232338.40AA6580A2@chaos.jnpr.net> <20140730034641.46ABE580A2@chaos.jnpr.net> <20140730071500.GF37672@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nj4mAaUCx+wbOcQD" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: arch@freebsd.org, Adrian Chadd , Jordan Hubbard , "Simon J. Gerraty" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 17:04:02 -0000 --Nj4mAaUCx+wbOcQD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 30, 2014 at 09:18:40AM -0700, Jos Backus wrote: > On Jul 30, 2014 12:15 AM, "Baptiste Daroussin" wrote: > > > > On Tue, Jul 29, 2014 at 09:44:17PM -0700, Jos Backus wrote: > > > On Jul 29, 2014 8:46 PM, "Simon J. Gerraty" wrote: > > > > > > > > > > > > On Tue, 29 Jul 2014 16:30:53 -0700, Jos Backus writes: > > > > >> You certainly cannot wait for all of it to arrive before you sta= rt > > > > >> rendering. > > > > > > > > > >Understood. This is why a serialization output format that supports > > > > >streaming data is useful. > > > > > > > > Indeed; XML works fine for that. > > > > > > Not to beat a dead horse, but so does YAML, and it's more > lightweight/less > > > verbose so I personally find it more elegant. But sure, XML would work > as > > > well. > > > > > YAML is not more lightweight at all, it is really heavy to parse compar= ed > to > > XML or JSON. >=20 > By lightweight I meant syntax verbosity, not computational load (although > it seems easy to emit). It's a more flexible format, and that comes with a > certain price. The question is whether that flexibility is needed or > useful. If JSON can't be used because of its limitations, I would > personally prefer the less verbose YAML over XML. >=20 About json what limitation are you talking about? In yaml you have 2 syntax, on which is inconsistent but user friendly and t= he other which as ugly as XML imho this_is_string: treu this__bool: true so_if_i_want_a_string_true_i_need_quote: "true" If I want to be consistent I need to use the canonical form of yaml: --- !!map { ? !!str "so_if_i_want_a_string_true_i_need_quote" : !!str "true", ? !!str "this__bool" : !!bool "true", ? !!str "this_is_string" : !!str "treu", } and now this is very very ugly :( Plus yaml is context dependant and space dependant resulting in people gett= ing lost about: "Why this yaml is not valid": hu: ha hi: - test - test2 Or why this one is not valid either? hu: ha hi: test I have been there with pkg(8) after being a huge suppoter of YAML I'm now m= ore moderated :) YAML was not machine friendly at all in the end and very very error prone f= or humans :( regards, Bapt --Nj4mAaUCx+wbOcQD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlPZJXsACgkQ8kTtMUmk6EwPrgCeIxpG5zQBeuKRa/3McD3UnNjy trAAn3/K/mbSzbb2FWzc4mfkTqiXt/wd =e/5o -----END PGP SIGNATURE----- --Nj4mAaUCx+wbOcQD--