Re: [Json] Human JSON (Hjson)

Christian Zangl <coralllama@gmail.com> Fri, 27 May 2016 10:06 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 086DC12D0ED for <json@ietfa.amsl.com>; Fri, 27 May 2016 03:06:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 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, WEIRD_QUOTING=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 0h6cSHqWjkIr for <json@ietfa.amsl.com>; Fri, 27 May 2016 03:06:10 -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 BB5C712D609 for <json@ietf.org>; Fri, 27 May 2016 03:06:09 -0700 (PDT)
Received: by mail-wm0-x22f.google.com with SMTP id a136so65065114wme.0 for <json@ietf.org>; Fri, 27 May 2016 03:06:09 -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=GP5/FwcVN/uEg38YKMRZXli+8wRMr1ar1bLodPDWVg0=; b=pIorsRrMycfhxX5yDmmIHtTZqkGaF4QENk2MvPvFdd00oVnMaFWWlw+YiQrHrxPQ/O wxbp8UA5Bl5lPhBbe9FIISmKU/0S14LsNWRX18rhA9cy+qWEaQOuHYUp5jX7JavheM8J HKWKs6HR9hX/3VPBCM7jIInCQ5lNSCTlXrINLl26XmSCGzyGAfijeEge5jbboKV39oMK rCspIZYtHU4mbyDDWLKQfXfYTr/v9pdTakBJ9eAIOqrx0ZP6Ws4FX49smwEvXwg31Gzr +wzsreniMp++6XDBoDFesahzaXtVQ1R04Nem1opDJ79SEqGUlUipSO1OUvEFoJMMbiOn vyGg==
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=GP5/FwcVN/uEg38YKMRZXli+8wRMr1ar1bLodPDWVg0=; b=bY/r/af3hVeSaarVO/aQa5LOer0G+dS+vxEE4YClE1FWPUozFZYmo+ErbuW9LDIRIQ FB4t3zj6PyDLRg0o4O5aItLydum87UNk+k3wgNwx5Bry1qX0oAfV1RD7eWtV9IPH8AAu /l4qKYy63IiFjU7Xd55sWLe1rVFOMby3aLY3QeuBW7jyx5uyysowrMTAdwpXPRCpnZua 3bSltQuU3S+aqbaBl+JlQx/5eW5qPDBQ1rW5ChCSzY1FT5D88vouTyuqrsBndyNSp1Ps BsmrMYh9lXu0Pgg2JYeCtw6OG24OMF4G55G4oUqno36qKpa+6lUpD8VyuCZdAGB64cJL qHTQ==
X-Gm-Message-State: ALyK8tLXWNvbvYnr2Pi77lQJ74aclyiw7QlzoK4lJHgEgf+xBkW57w+oa4I0riMaw3EY8A==
X-Received: by 10.28.153.147 with SMTP id b141mr8285869wme.90.1464343568344; Fri, 27 May 2016 03:06:08 -0700 (PDT)
Received: from [10.246.233.15] ([212.152.161.90]) by smtp.googlemail.com with ESMTPSA id o4sm18611511wjx.45.2016.05.27.03.06.07 for <json@ietf.org> (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 03:06:07 -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> <3902e167-6a07-9311-4569-484f015f08be@gmail.com> <CAMm+Lwhh=h0DfWR4LFPgKVLpz-vg8RvFDLfm5DCUxv5tdC-=_g@mail.gmail.com>
Message-ID: <2a9060c3-7f2a-6675-2eba-9a14dc823138@gmail.com>
Date: Fri, 27 May 2016 12:06:07 +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+Lwhh=h0DfWR4LFPgKVLpz-vg8RvFDLfm5DCUxv5tdC-=_g@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/9gzFtzVHRQzxsID3u2iqWeXjWFw>
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 10:06:12 -0000

On 2016-05-27 00:07, Phillip Hallam-Baker wrote:

>     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.
>
>
> I don't like quoteless strings with spaces. I think they are going to
> cause serious problems.

Please explain.

> What I suggest instead is using the convention Windows itself uses, the
> 'verbatim string literal'.
>
> var path = @"C:\Users\Phillip\OneDrive\Repositories\Dalek Plans"
>
> is equivalent to:
>
> var path = "C:\\Users\\Phillip\\OneDrive\\Repositories\\Dalek Plans"
>
> The big limitation on @ strings is that the only escape you are left
> with is for quotes which are doubled up:
>
> "quoted" is written """quoted"""

@"" does not help readability. Not having quotes is IMO more elegant, 
makes copy&pasting easier and requires no explanation.