Re: [Json] Human JSON (Hjson)

Peter Cordell <petejson@codalogic.com> Thu, 26 May 2016 17:15 UTC

Return-Path: <petejson@codalogic.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EBB4E12D7AF for <json@ietfa.amsl.com>; Thu, 26 May 2016 10:15:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.92
X-Spam-Level:
X-Spam-Status: No, score=-0.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JDtIlE0rfLdb for <json@ietfa.amsl.com>; Thu, 26 May 2016 10:15:35 -0700 (PDT)
Received: from ppsa-online.com (lvps217-199-162-192.vps.webfusion.co.uk [217.199.162.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D33C312D7C5 for <json@ietf.org>; Thu, 26 May 2016 10:15:34 -0700 (PDT)
Received: (qmail 3525 invoked from network); 26 May 2016 18:10:42 +0100
Received: from host86-178-51-202.range86-178.btcentralplus.com (HELO ?192.168.1.72?) (86.178.51.202) by lvps217-199-162-217.vps.webfusion.co.uk with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 26 May 2016 18:10:42 +0100
To: Carsten Bormann <cabo@tzi.org>
References: <9ec25767-7471-2ca3-ded5-afed67863742@gmail.com> <82b2ba3f-a6c2-c98b-b365-b698ab285149@codalogic.com> <57471309.8040102@tzi.org>
From: Peter Cordell <petejson@codalogic.com>
Message-ID: <37c6ca77-0178-3448-53c3-330c847afdfc@codalogic.com>
Date: Thu, 26 May 2016 18:15:30 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0
MIME-Version: 1.0
In-Reply-To: <57471309.8040102@tzi.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/JaB23KTkmZzFtzIFWT9e--wJ_LY>
Cc: json@ietf.org
Subject: Re: [Json] Human JSON (Hjson)
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 26 May 2016 17:15:37 -0000

On 26/05/2016 16:15, Carsten Bormann wrote:
> Peter Cordell wrote:
>> For me JSON is too simple, and YAML is too complex.  I've tried to get
>> into YAML a couple of times, but it seems to have multiple ways to do
>> the same things, so I end up getting confused.
>
> I think it would be a great academic subject to study *where* people
> stumble that try to pick up something like YAML.  Can you relate your
> experience in some more detail (off-list if that helps)?
>

I'll do one round on-list in the hope that it's helpful for some 
possible future work:

- The specification is long!

- Having two forms - block style and flow style - doubles the confusion

- As a C family programmer, the block format doesn't 'speak' to me,
   (whereas the JSON format does)

- I haven't done YAML for the other reasons, but I imagine getting the
   indentation right with lists started by '-' is annoyingly fiddly.
   Hence I'm put off going down that path before even trying it.

- Perl-esq levels of non-intuitive magical characters

- There looks to be things like namespacing which for most things I
   probably won't need.  Alas, because they are there, at some point
   some bright spark will use them, which means I will have to support
   them.  So though I could look at things like that as 'optional' at
   some point they probably won't be, in much the same way that if you
   attempt to use a simplified XML processor, at some point it will bite
   you!


>> It clearly fails at at
>> least one level to be human friendly.  Why JSON doesn't have comments
>> eludes me.  JavaScript does, so missing that bit in the subsetting was a
>> big drop off IMO.
>
> JSON was meant as an interchange format between programs, which don't
> need comments to talk to each other.  (Also, if you do need to include
> commentary material, you way want to process this together with the
> other data, so you just add it as fields to your structure, keeping your
> data model simple.)
> [Just trying to relate the rationale as I have heard it expressed many
> times.  Doesn't apply that much to config files, of course.]

While I understand that rationale, when you have a text based format 
that can be consumed by services I still think it was naive to not 
anticipate that people would want to create their own hand edited 
versions, perhaps for test purposes, and squirt them into services to 
see what happens.   From there, config files are a small step.  Indeed, 
it's also naive to not expect a successful 'thing' to be used beyond the 
scope it was originally intended for.

But that's all water under the bridge, and there's little point crying 
over it, other than to perhaps note that "anything that can be edited in 
an editor will be edited in an editor, and anything that will be edited 
in an editor should allow comments" ;-)

Pete.