Re: [Json] Human JSON (Hjson)

Christian Zangl <coralllama@gmail.com> Fri, 27 May 2016 20:46 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 C318012D8EB for <json@ietfa.amsl.com>; Fri, 27 May 2016 13:46:49 -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 SrRyzZraQZ6Z for <json@ietfa.amsl.com>; Fri, 27 May 2016 13:46:48 -0700 (PDT)
Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 37B6012D8DF for <json@ietf.org>; Fri, 27 May 2016 13:46:48 -0700 (PDT)
Received: by mail-wm0-x234.google.com with SMTP id n129so6004543wmn.1 for <json@ietf.org>; Fri, 27 May 2016 13:46:48 -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=EQg/JSVjL+fbu+J84nB11AqBrJ59g9tPhTpzzt9Ro9M=; b=B1jiAiou//nshdJVo0yp8W3QQE2xOgq9yA+P3lKCoowG0oJOKsGLE85qOYboyF//fP yZKhh47JhL3T7up6WIkriNiU27FZEb96XFWqGyrTySB0bObaN9AK32jsurmBc79qvkSj NGSQuBdZFVG/VKSWY7Y2dhFw0Bami7sk2Blyiy/ecEfclSIAEYUWZqWeKnS8L3XkPIgT /WL36X9XKIMUQxEni37q27GHpnDVn98OsJun7f+4gOH7U+WYeeOpzWkexI2WhUz39D5P HzT6p01u0bDjEM6JxFOC/1ObWfMHGCrV0Ci9p97HhnY4Dp+Oqy8QU3Zn2MY+Z1RayYcQ FP7Q==
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=EQg/JSVjL+fbu+J84nB11AqBrJ59g9tPhTpzzt9Ro9M=; b=KOrNR8a6HWlz+Nsm19wOJQ8rY0O8oKQeolYzxSFdWJGeuHjgNQPi+2pHFO4Q2lJcPf p8g2AKvE2szuWvexXaBeL/7rvC8TkVCj7083gpj5qiGAfRK2ohPKLpATboDF19Ni/Vku ojAD821gEnv+yl9a7ykZ3+tAkf3lwhlzL50YEX6PVW/rEUkn1KZoaHaLj84VpIWB/Qze 8F9UwZRI7MULvi8qE7KqE14rBid3TKsAaRwbvWIZ801BlosSe6Ur2ljnb9+NfR7bHmDp 5TM/CvfxwkrrwLjX17kJ9rhw5gjc4mP0SgTKj9B2DInLeyn4JREe43Koup9F0TnBVGCJ xV0A==
X-Gm-Message-State: ALyK8tIcJdEmfM/YTRDHUpKkF2vHVrgAGc5QJ/r+61/2YV2kvJK/mIoKymRumL1BO5gyog==
X-Received: by 10.194.242.65 with SMTP id wo1mr16076778wjc.54.1464382006757; Fri, 27 May 2016 13:46:46 -0700 (PDT)
Received: from [192.168.1.181] (178.112.50.109.wireless.dyn.drei.com. [178.112.50.109]) by smtp.googlemail.com with ESMTPSA id dd7sm21079997wjb.22.2016.05.27.13.46.45 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 13:46:46 -0700 (PDT)
To: Carsten Bormann <cabo@tzi.org>, 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> <3902e167-6a07-9311-4569-484f015f08be@gmail.com> <CAMm+Lwhh=h0DfWR4LFPgKVLpz-vg8RvFDLfm5DCUxv5tdC-=_g@mail.gmail.com> <2a9060c3-7f2a-6675-2eba-9a14dc823138@gmail.com> <57482236.2030402@tzi.org>
From: Christian Zangl <coralllama@gmail.com>
Message-ID: <f221714b-6f52-790d-b25b-d41246a0ca6c@gmail.com>
Date: Fri, 27 May 2016 22:46:43 +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: <57482236.2030402@tzi.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/Cl9pthrei6J55GlyXigdSXgB2Ck>
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: Fri, 27 May 2016 20:46:50 -0000

On 2016-05-27 12:32, Carsten Bormann wrote:
>>> I don't like quoteless strings with spaces. I think they are going to
>>> cause serious problems.
>>
>> Please explain.
>
> They sure work very well in YAML.
> But the rules for what you can and cannot do there are sometimes
> perceived as complicated (why do you need quotes here? Oh, the colon.):
>
>     title: "6LoWPAN: the Wireless Embedded Internet"

If you look at the syntax it says "Because the punctuator characters 
{}[],: are used to define the structure of the Hjson text, you need to 
use quotes [..] if your string starts with a punctuator"

so your example is valid without quotes, after the first character 
anything is allowed.

      title: 6LoWPAN: the Wireless Embedded Internet


> But then YAML has additional, more powerful quoting mechanisms, such as:
>
>     title: >-
>       Information Technology -- ASN.1 encoding rules:
>       Specification of Basic Encoding Rules (BER), Canonical Encoding
>       Rules (CER) and Distinguished Encoding Rules (DER)

This is similar to Hjson's multiline except that Hjson will keep all LFs 
while YAML eats them sometimes.