Re: [Json] Human JSON (Hjson)

Christian Zangl <coralllama@gmail.com> Thu, 26 May 2016 21:52 UTC

Return-Path: <coralllama@gmail.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 8C4B712D1A1 for <json@ietfa.amsl.com>; Thu, 26 May 2016 14:52:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 i-cErb08RVq2 for <json@ietfa.amsl.com>; Thu, 26 May 2016 14:52:36 -0700 (PDT)
Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 05CEF12D1B4 for <json@ietf.org>; Thu, 26 May 2016 14:52:35 -0700 (PDT)
Received: by mail-wm0-x22f.google.com with SMTP id n129so115533684wmn.1 for <json@ietf.org>; Thu, 26 May 2016 14:52:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=VIq6gMT64ws7gxX91hHjEod90IJq+rHe3HUkTaIh1r4=; b=fgBeusB51NBiqGLsDGC9uG4JZLuJoMNBZYdWrTMF0zjJ0cByYBYL+Ck1Shtf1j4VAO 89k3eszp4YlY3UFUqSKM8WvuqY6qft0leyJxwPdMq/e1qm2qk9vNxMlNTH4id9ajr4CY WyU/Rix+byVedIPCynBOd6NfA2m6ocVexEoiAYM/43kge30RGozODixVAsyb7jYD4+2Y S6C4Z56CPcwVvw8mxPAFMK3tdg1BwCH9LqN2nVwkzRDJ/kdyc3W5YOmNa9HDcw6MX/m9 VhUcK6L0eK1Qy24TsDSiHSaPW1l6odAN/NpAoY+XLB3FGXHND2TF8zGJqjw0RZtWZELY jFjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=VIq6gMT64ws7gxX91hHjEod90IJq+rHe3HUkTaIh1r4=; b=RyNZPhALoAMWJldhSH+sNee8yAEBsTxQupFDVcJmOWFE3iXXuxVx5/Ze8vhT4oe5/J GV8xJgWAT1eyu/FNZJjPvbktd0+nTunbTN0JitlGj3C7CPtuuC6GGUxDibcN5mDORISj C+EXaxyGTKps9or1WX6NIz4PJ0leWlIZ5jRvmy+IDA03a2RIE8ruMEhsLYetiAKOE354 mPrzMIs8IsN+1iNau04+N0ZKOQqozchKAMDFmjuVSRqtDa7RDOGb0I8p8h+ORP2ZWE2J tEDuxycRL2/L/qWwysDPzXkGUT5oJrC6SAdFIW7m/3FetFXw23LkstL07kYk1KWcKx4l n+ig==
X-Gm-Message-State: ALyK8tJ7EUyNLu1AeYIDSeR5DkckcOMROoFspX9ZfAofYdOQo7zhz16ts0tC8C6yLzeH+A==
X-Received: by 10.28.213.137 with SMTP id m131mr5956031wmg.24.1464299554366; Thu, 26 May 2016 14:52:34 -0700 (PDT)
Received: from [192.168.1.181] (77.116.171.9.wireless.dyn.drei.com. [77.116.171.9]) by smtp.googlemail.com with ESMTPSA id lr9sm16202484wjb.39.2016.05.26.14.52.32 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 14:52:33 -0700 (PDT)
To: Peter Cordell <petejson@codalogic.com>, json@ietf.org
References: <9ec25767-7471-2ca3-ded5-afed67863742@gmail.com> <82b2ba3f-a6c2-c98b-b365-b698ab285149@codalogic.com>
From: Christian Zangl <coralllama@gmail.com>
Message-ID: <c927eb34-ca63-3b8c-448b-640a9c8f33da@gmail.com>
Date: Thu, 26 May 2016 23:52:31 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0
MIME-Version: 1.0
In-Reply-To: <82b2ba3f-a6c2-c98b-b365-b698ab285149@codalogic.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/n2pO36WZ-2vCfIZv9eHNwNg2cT0>
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 21:52:39 -0000

You are quite right that there are a lot of solutions to this problem. 
The most known ones are JSON5 and maybe CSON. Others are not that easy 
to find though I remember at least three variants that shared some 
syntax with Hjson. Most of them, including Hjson, were started because 
there was no recommended format to be found.

On 2016-05-26 13:03, 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.  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.
>
> I'd love something that is more flexible than JSON, but less complicated
> than YAML.  While I might quibble about some of the choices in this
> proposal, the fact that it can be described as JSON with 7 lines of
> variations is a big win.
>
> What I find frustrating in this space is that protocols and
> specifications are the bread and butter of IETF.  And yet the IETF has
> put very little effort into developing 'tools' for this area (*).  And
> the really sad thing is that the reason is not because this is a
> difficult problem, but more that it is such a simple problem that
> everyone comes up with their own pet solution and they'd rather have no
> solution instead of someone else's solution.  As a result we end up with
> other groups second hand goods like XML and JSON.
>
> So I'd welcome it going forward in a form that would allow experience
> with working with the format and would be simple for a working group to
> adopt and put on standards track if they felt it was useful.  Perhaps as
> an AD shepherded individual RFC that can just be 're-badged' to put it
> on standards track if the desire arose.
>
> (* OK, we have ABNF, but that's the assembly language of protocol design
> and we should really be aspiring to higher levels of abstraction in this
> day and age.)
>
> Pete Cordell
> Read & write XML in C++, http://www.xml2cpp.com
>
> On 24/05/2016 22:36, Christian Zangl wrote:
>> JSON is used in a lot of places and has helped improve things like data
>> exchange and data storage. It is also used in areas it's less suited
>> for, like configuration files. People seem to prefer JSON for
>> configuration over YAML and other config formats.
>>
>> I started Human JSON (Hjson) because I found the experience frustrating
>> (for example missing/trailing comma problems, no comments). With Hjson
>> you get a superset of JSON that allows you to
>>
>> - add #, // or /**/ comments,
>> - omit quotes for keys,
>> - omit quotes for strings (terminated by LF, no escapes),
>> - omit braces for the root object,
>> - omit the comma at the end of a line
>> - add trailing commas and
>> - use multiline strings with proper whitespace handling.
>>
>> These changes should make it easer to read and write configs while still
>> preserving the power of JSON.
>>
>> Joe Hildebrand approached me with an idea to publish Hjson as a RFC. You
>> can find the draft here: http://hjson.org/rfc.html There are also syntax
>> diagrams and more at http://hjson.org/syntax.html
>>
>> Thoughts?
>>
>> _______________________________________________
>> json mailing list
>> json@ietf.org
>> https://www.ietf.org/mailman/listinfo/json
>> .
>>
>