From owner-freebsd-arch@FreeBSD.ORG Tue Jul 29 08:45:37 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 57A9CD04; Tue, 29 Jul 2014 08:45:37 +0000 (UTC) Received: from mail143c7.megamailservers.com (mail745.megamailservers.com [69.49.98.55]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8D062ACA; Tue, 29 Jul 2014 08:45:36 +0000 (UTC) X-Authenticated-User: hurds.sasktel.net Received: from [192.168.0.33] (ip72-194-65-37.oc.oc.cox.net [72.194.65.37]) (authenticated bits=0) by mail143c7.megamailservers.com (8.13.6/8.13.1) with ESMTP id s6T8jOmp003940; Tue, 29 Jul 2014 04:45:26 -0400 Message-ID: <53D75F24.6090507@sasktel.net> Date: Tue, 29 Jul 2014 01:45:24 -0700 From: Stephen Hurd User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1 MIME-Version: 1.0 To: gahr@FreeBSD.org, Stephen Hurd Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML References: <20140725044921.9F0D3580A2@chaos.jnpr.net> <20140728054217.AC1A0580A2@chaos.jnpr.net> <20140728055336.GJ50802@ivaldir.etoilebsd.net> <53D73796.9060102@FreeBSD.org> <20140729075640.GB76693@ptrcrt.ch> In-Reply-To: <20140729075640.GB76693@ptrcrt.ch> X-Enigmail-Version: 1.6.1_pre20140112 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CTCH-RefID: str=0001.0A020207.53D75F27.010B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.1 cv=cZDr8BzM c=1 sm=1 tr=0 a=Z5AWCFQ5VKA4phzWx86Kmg==:117 a=Z5AWCFQ5VKA4phzWx86Kmg==:17 a=kviXuzpPAAAA:8 a=BDKbP5mgAAAA:8 a=J0_EhWaTXrIA:10 a=2b1Y-s4cCm8A:10 a=YxfxW3ofkq8A:10 a=IkcTkHD0fZMA:10 a=uhPMnebkAAAA:8 a=CjxXgO3LAAAA:8 a=QfKxxUxMAAAA:8 a=LDA7PybYtlmFmPbqO_IA:9 a=QEXdDO2ut3YA:10 a=uljPtXyl9CQA:10 Cc: Jordan Hubbard , arch@FreeBSD.org 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: Tue, 29 Jul 2014 08:45:37 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Pietro Cerutti wrote: > On 2014-Jul-28, 22:56, Stephen Hurd wrote: >> Jordan Hubbard wrote: >>> Is there some reason JSON is not sufficient? I think that’s a better question to ask, since the conversation otherwise quickly tends to sound a little like “I’ll accept any single unified format as long as it’s the specific one I like!” :) I think the greater good argument would suggest just picking one that’s expressive enough (roll a pair of dice), put on your bikeshed-proof sunglasses, and proceed. >> >> The biggest problem I tend to have with JSON is that there is no comment >> format. I rarely update a configuration without adding a comment >> regarding it, and since JSON doesn't have comments, it's simply a >> non-starter for most of my usage. The whole "just a key that you know >> isn't real" hack is terrible. > > There's an interesting post about whether this really is a problem: > > https://groups.yahoo.com/neo/groups/json/conversations/topics/156 > > I'm not saying it isn't, just that there are reasons why comments are > not part of JSON. > Yep, program to program formats obviously don't need comments, comments are for something that a human is modifying on an infrequent basis. But invariably, a serialization format designed to be human readable ends up getting used as a configuration format... and my config files need comments to ensure that future me hasn't forgotten the lessons that present me has learnt. As for comments being "the most difficult feature to support", I find that hard to believe... I don't see how it could possibly be more difficult than string support with escaping - especially for the "to end of line" style comment. As for "removing comments aligns JSON more closely with YAML" could be trivially solved by supporting YAML style comments. The first reason is fine, and while I don't agree with the fourth reason, I can accept it. But really, the ship has sailed, JSON doesn't have comments, and that's the biggest problem I have with JSON. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/ iQF8BAEBCgBmBQJT118kXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDQTUyMTJFRTc2MEFCQ0FBMEQ1RTI5NzRC M0I1QTFCNDk4Q0U1Q0QwAAoJELO1obSYzlzQgc8H/R79tqlzQpjY0jLpwNwUaSgH M5lroa4f4KEpvRqLKRj0Owt/N+rHzXjPL/mmD6XGckGb3JG0HbEmofq2rz/XoUSI mksGLsdGkpN4eQppKaAU+mNAPObLoX6KZA51dbNlE6NzFcJirigWfHqUghOZt0X3 xKAWk86YcUvQZ4uYSU7jrkWVpoQeOg2UcSQ3AVvn+cVrYahN3w+r8ypgudd3IcAY cI0zoTp2w/oiq3mmECdboNFsaZmKlhvXaj0sKrtSlLVHIkPYqzP+2o3QgT96ovHV 0R64R+mg4czpimNcQUrUai3pX5uazwnUSdXy4TnWzYE9IYS33vZjUOqA7wavuDE= =EaXN -----END PGP SIGNATURE-----