Re: [Json] Human JSON (Hjson)

Christian Zangl <coralllama@gmail.com> Thu, 26 May 2016 21:44 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 5FEB012DB70 for <json@ietfa.amsl.com>; Thu, 26 May 2016 14:44:26 -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 o_4udWj2EcPE for <json@ietfa.amsl.com>; Thu, 26 May 2016 14:44:25 -0700 (PDT)
Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 CB19412D75C for <json@ietf.org>; Thu, 26 May 2016 14:44:24 -0700 (PDT)
Received: by mail-wm0-x22c.google.com with SMTP id n129so115352558wmn.1 for <json@ietf.org>; Thu, 26 May 2016 14:44:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=E2MeCYNkWVsQgCiP5p75wa7bVxOekBvvfAqmj/7SOsc=; b=LPTjwIta4RbBbiThgRhZT9Ed29zVBNI49rU6IUltB7DbHmFPzKPj7lU2SP4qPODvbD QzzTlSBQFlRHhyPnaPzk6wm89Gpk+SiYVEKMO6lHlgSfJi4lIgDFVAGXc/rEqr5NU4BM LAyTgxzH5XhecWUVmhg8FlPYzBIXgmVrgxXbgXq8HB6yv65Of1K99KLW3O8pbhGXZWUp YiBQ0JnJ8jpncNS+DsSdNjrQZlxlKX5mJl+klpHqxfazG/r3UhvxV1xfV7Apfz/wMw89 JzQqyZyHv2PNGrj1tbRINnDzv4Hrl0xvEraQv/z46fW9VRWBLit54UcEKbaqdPV8mdkh KL+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=E2MeCYNkWVsQgCiP5p75wa7bVxOekBvvfAqmj/7SOsc=; b=l6N2qb3Qw74bI/LK6OFQWsbkX5oeT3WRRHXaKW4pEqqyRa9O41dJL7SayZNdcf8hv4 p1q+M6lTMl0yUkHRS4CbZXq5JDTPW52P5GW5E173C1zDrUlMi64K7jaUO6p+pZJb6lWF zVI/Kivk8LRogjCjXpb8gWzbvQEkT1mM8bHlZ5KnDkEf+rh8iFy9C/n5h2qq9/xtqcUo yLxfz2RccqDBzdU3TEYt74r4aJraN63ACQ/dguqb9lQAs5uFry8Eg/7NpgjruCV0lvXz BMVe7k2JosrRqv/nkldzO7JjLGUQbUj3yC6kDtK+zPGGw15pXb8QBcwUfdcB+uPRqEA+ aGcA==
X-Gm-Message-State: ALyK8tLflXo7dNSd5HppxBpc5luY1GubkQdim7RYW49FJ7WKUi3EyhlXZdKov+wWs3DDrA==
X-Received: by 10.194.186.200 with SMTP id fm8mr11442161wjc.174.1464299063437; Thu, 26 May 2016 14:44:23 -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 a81sm5437572wma.16.2016.05.26.14.44.22 for <json@ietf.org> (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 14:44:22 -0700 (PDT)
From: Christian Zangl <coralllama@gmail.com>
To: json@ietf.org
References: <9ec25767-7471-2ca3-ded5-afed67863742@gmail.com> <82b2ba3f-a6c2-c98b-b365-b698ab285149@codalogic.com> <CAMm+Lwjw-FgrH1yED5B98=3vsx_KjX_VANn=7efPVoD_yPcC1w@mail.gmail.com>
Message-ID: <b749e3f3-bdd1-5256-0819-379f3e26ede6@gmail.com>
Date: Thu, 26 May 2016 23:44:21 +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: <CAMm+Lwjw-FgrH1yED5B98=3vsx_KjX_VANn=7efPVoD_yPcC1w@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/M50TA_8wenkVJa1tskBb1dbXU6Q>
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:44:26 -0000

On 2016-05-26 16:01, Phillip Hallam-Baker wrote:

> A superset of JSON encoding optimized for human input makes a lot of
> sense. In particular it should be possible for a single parser to read
> data in either strict JSON or JSON-x. Which is what I did with JSON-B,
> JSON-C and JSON-D.
>
> I suggest the following additions:
>
> 1) Comments
>
> 2) Use of quotes on labels is optional if the label conforms to C-like
> rules (does not start with a digit or contain white space, control or
> punctuation marks.
>
> 3) Allow trailing comas
>
> 4) Punctuation optional in situations it is not ambiguous.

You still have a problem with the backslash in strings. On Windows you 
can't just copy&paste a path because all \ need to be escaped. Also 
config files sometimes contain regular expressions and having to escape 
the \ makes them unreadable.

That's why Hjson has quoteless strings that are raw strings ending at LF.