Re: [Json] Human JSON (Hjson)

Carsten Bormann <cabo@tzi.org> Wed, 25 May 2016 08:16 UTC

Return-Path: <cabo@tzi.org>
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 B9AA412B047 for <json@ietfa.amsl.com>; Wed, 25 May 2016 01:16:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham 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 Js5qPi8USJHU for <json@ietfa.amsl.com>; Wed, 25 May 2016 01:16:09 -0700 (PDT)
Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:c:538::196]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A17F912B010 for <json@ietf.org>; Wed, 25 May 2016 01:16:09 -0700 (PDT)
Received: from mfilter10-d.gandi.net (mfilter10-d.gandi.net [217.70.178.139]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 5171C17214F; Wed, 25 May 2016 10:16:08 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mfilter10-d.gandi.net
Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter10-d.gandi.net (mfilter10-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id WXvZ-1bD-Wo7; Wed, 25 May 2016 10:16:06 +0200 (CEST)
X-Originating-IP: 93.199.242.26
Received: from nar-3.local (p5DC7F21A.dip0.t-ipconnect.de [93.199.242.26]) (Authenticated sender: cabo@cabo.im) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id BFDC317210A; Wed, 25 May 2016 10:16:05 +0200 (CEST)
Message-ID: <57455F43.6010506@tzi.org>
Date: Wed, 25 May 2016 10:16:03 +0200
From: Carsten Bormann <cabo@tzi.org>
User-Agent: Postbox 4.0.8 (Macintosh/20151105)
MIME-Version: 1.0
To: Christian Zangl <coralllama@gmail.com>
References: <9ec25767-7471-2ca3-ded5-afed67863742@gmail.com> <5744E92B.3010704@tzi.org> <aba11a1f-d81f-b9dd-84c9-c5b16df886de@gmail.com>
In-Reply-To: <aba11a1f-d81f-b9dd-84c9-c5b16df886de@gmail.com>
X-Enigmail-Version: 1.2.3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/n0gJSXTs7cgAVEErra1fcmMl4-o>
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: Wed, 25 May 2016 08:16:11 -0000

Christian Zangl wrote:
>> Can't be.  YAML *contains* JSON.
>> If you like JSON, you already like YAML, because every JSON file is a
>> YAML file.
> 
> Hjson *contains* JSON, every JSON file is also a Hjson file, so you must
> like Hjson?

Since you ask what I like:

HUMANS SHOULD NOT BE WRITING JSON *), so, no, I don't like JSON as a
configuration file format.

The people I have met who didn't know about YAML usually liked
.ini-style **) configuration file formats, as exemplified by TOML ***).

Since my experience is that every configuration file format turns more
and more complex over time, I prefer to base them on a powerful generic
format such as YAML.  YAML is also pretty good in noise reduction.
(And, as I noted, if you are really itching to write JSON, or have some
JSON data that you just want to paste in, you can do so in YAML.)

As another data point, CBOR diagnostic notation is based on JSON.
Ouch; this is actually meant to be written and read by humans.
The CDDL draft then goes ahead and defines an extended diagnostic
notation to reduce some of the hurt (not needed for CDDL itself, but it
helps for notating CBOR examples, e.g., in the COSE draft).

Grüße, Carsten

*) https://mumble.org.uk/blog/2014/09/23/json-and-the-arguments/ and a
million other people have found that out...

**) https://en.wikipedia.org/wiki/INI_file

***) https://github.com/toml-lang/toml