Re: [Json] JSON irritants

Christian Zangl <coralllama@gmail.com> Wed, 03 August 2016 05:45 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 75D5C12D8D0 for <json@ietfa.amsl.com>; Tue, 2 Aug 2016 22:45:57 -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 2-HePOd_AKEt for <json@ietfa.amsl.com>; Tue, 2 Aug 2016 22:45:55 -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 5B2A612B020 for <json@ietf.org>; Tue, 2 Aug 2016 22:45:55 -0700 (PDT)
Received: by mail-wm0-x22c.google.com with SMTP id q128so433832108wma.1 for <json@ietf.org>; Tue, 02 Aug 2016 22:45:55 -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=rHFjTeDMFtVB0HoB+nxIsWJhJgJO6z3zY9wG30zXXBM=; b=EzlcDIhZYvX79JizCVRM7A2Jt5Vo/BMG9b9/jw4QHYDg1MIM82FPvGCLq9DfYQqJ14 IrrSzc2Iv1anwe5A/oaG7xP4BU92OGnatuLPq1DsBSJafr9q0uBqQ1OyghYcR3aket0k h7P3yZGdOiuTJ1vSPLFnftJOEPziplfzz9nUcqaq2As0PTzhiVWmEcpqIJ0WvZnn8yPZ kUABdR5492A1C8oRy+8wWzdDvQgOqDMPC1l8ILVJgJuTR5PKWxUh75gjlgdA4eWz8Lkn LirSbIZtipfp/a3czSMxv3pt3ceV1JNmPl0x6RD96ZxVsdwRgsH9cFvcDZ+6JUAoVrh7 lzRg==
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=rHFjTeDMFtVB0HoB+nxIsWJhJgJO6z3zY9wG30zXXBM=; b=ITxYQzlZsF2SPoyFtezJ4N2Hzc5NyvSqIWXtYYdZuInbGhpDmEg9Epein0oYfRNHte YH25nRLAOL9L8d2F3G0byGYCKuMF9R9llmbCyUeLWYqRiacsBQGfO2EAAjFYUCVVri6k e6CfZGQCW3n0+rvqHMlgqjkht7CFFihHePjGzc5VDwI6pFarGngBhczRoAxGPIu2M4ik 1ZJJEeuxNN2Qpdp6L3qL0yA0enwQREGJAhEAoqIokK0hTO9IeIOV4CTC/PM4FSbHgu9d 25M8q2x/xf7X4OikZUiyFR1iSW5llHUNgS0g4WwI+qmE03dAX+wDEuyIBPnle/xCj5wq Esbg==
X-Gm-Message-State: AEkoout5ze8zT43jTEs26KVVaAxjDB6LQfTBBDli5v4VvQTutoVtXaUtknmzagKQF/ZHvA==
X-Received: by 10.28.157.214 with SMTP id g205mr22967481wme.34.1470203153784; Tue, 02 Aug 2016 22:45:53 -0700 (PDT)
Received: from [192.168.1.181] (178.112.120.140.wireless.dyn.drei.com. [178.112.120.140]) by smtp.googlemail.com with ESMTPSA id u125sm25222092wmg.22.2016.08.02.22.45.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Aug 2016 22:45:53 -0700 (PDT)
To: Tim Bray <tbray@textuality.com>, "json@ietf.org" <json@ietf.org>
References: <CAHBU6iv+S5=bxh62G+ybcgUWzQLUngVSti8X1ptENn0fA=i3ng@mail.gmail.com>
From: Christian Zangl <coralllama@gmail.com>
Message-ID: <d09068fc-cba3-6761-a9a9-fcbe7a25cc5e@gmail.com>
Date: Wed, 03 Aug 2016 07:45:51 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <CAHBU6iv+S5=bxh62G+ybcgUWzQLUngVSti8X1ptENn0fA=i3ng@mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/KIjzT1S0oPTZeAGwypw54_bkRl0>
Subject: Re: [Json] JSON irritants
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, 03 Aug 2016 05:45:57 -0000

For hand-editing JSON you may want to take a look at Hjson 
(http://hjson.org).

On 2016-08-03 07:17, Tim Bray wrote:
> I have recently been doing an unreasonable amount of JSON work, what
> with editing the drafts here, helping design AWS’s CloudWatch Events
> service [1], and now working on an interesting JSON DSL that with any
> luck will decloak later this year.
>
> I have encountered the following irritants:
>
> 1. When hand-editing JSON, it is unreasonably difficult to get the
> commas right.
> 2. When using JSON numbers, the sender *always* knows whether integers
> or floats are intended, but there’s no way to communicate this information.
> 3. There is no timestamp literal.
>
> Then I realized that the comma is not necessary to the grammar, it’s
> only there for JavaScript compatibility.  Bah.  Anyhow, here’s the
> example object from RFC7159:
>
>    {
>      "Image": {
>          "Width":  800,
>          "Height": 600,
>          "Title":  "View from 15th Floor",
>          "Thumbnail": {
>              "Url":    "http://www.example.com/image/481989943",
>              "Height": 125,
>              "Width":  100
>          },
>          "Animated" : false,
>          "IDs": [116, 943, 234, 38793]
>        }
>    }
>
> Here’s a version with a couple more fields and the irritants removed:
>
>   {
>      "Image": {
>          "Width":  i800
>          "Height": i600
>          "Title":  "View from 15th Floor"
>          "Thumbnail": {
>              "Url":    "http://www.example.com/image/481989943"
>              "Height": i125
>              "Width":  i100
>          }
>          "Location": {
>              "Latitude": f49.399673
>              "Longitude": f-123.508437
>          }
>          "Animated" : false
>          "Capture Time": @2016-08-01T18:15:00Z
>          "IDs": [i116 i943 i234 i38793]
>        }
>    }
>
>
> I thought of a friendly acronym and bought a domain name and wrote an
> I-D too, but I thought it might be polite and useful to test the waters
> here, example first.
>
> [1] http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CloudWatchEventsandEventPatterns.html
>
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>