Re: [Json] serializing sequences of JSON values

Nico Williams <nico@cryptonector.com> Sat, 15 March 2014 00:50 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B829F1A021C for <json@ietfa.amsl.com>; Fri, 14 Mar 2014 17:50:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.378
X-Spam-Level:
X-Spam-Status: No, score=-1.378 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=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 frMPPFRKFkFB for <json@ietfa.amsl.com>; Fri, 14 Mar 2014 17:50:51 -0700 (PDT)
Received: from hapkido.dreamhost.com (hapkido.dreamhost.com [66.33.216.122]) by ietfa.amsl.com (Postfix) with ESMTP id F392E1A022E for <json@ietf.org>; Fri, 14 Mar 2014 17:50:30 -0700 (PDT)
Received: from homiemail-a30.g.dreamhost.com (unknown [69.163.253.160]) by hapkido.dreamhost.com (Postfix) with ESMTP id 2E0128CB5A for <json@ietf.org>; Fri, 14 Mar 2014 17:50:24 -0700 (PDT)
Received: from homiemail-a30.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a30.g.dreamhost.com (Postfix) with ESMTP id DC95021DE6F for <json@ietf.org>; Fri, 14 Mar 2014 17:50:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type:content-transfer-encoding; s= cryptonector.com; bh=WuRefI6K92bguw5Bxght7JkZs1s=; b=dSjBZZd+TFT fW5QZQoMtEP5LAZkwKayA5esFdfAj4LD2MwXw0i/gwJUEL2awuw5aXecJcQiUbiV uRvm4zjFVVJXPzEWN9oBIW/0jfeYjAGtXVEOH3EWhgHRjCg6AvJp1gEs6NcFhPaC YvEpjxfCYLEo/Q4Loucyr/kYMC1dwr6Y=
Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a30.g.dreamhost.com (Postfix) with ESMTPSA id 7E5B221DE6A for <json@ietf.org>; Fri, 14 Mar 2014 17:50:23 -0700 (PDT)
Received: by mail-wg0-f48.google.com with SMTP id l18so2727126wgh.31 for <json@ietf.org>; Fri, 14 Mar 2014 17:50:22 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=MsNGdqj3Q2uTZOr2g/O64K0tZPHJ0WLBhIQXuRLCZPs=; b=Cz8cfuYhcYZg+KoR0uSnK6aRoMbfTGzU770QAN5ylR9EOWnEPQnZnszRF04gK5bLm4 +WKmx9P5DAwdDwp/HvIbhXzONXP5uPggIagsnjTNHNwcdJM+yFEizmzvG5dbfS2X3zwM s36nqewdLkssyp0gKnZCbLH+LmsRpWWUINRvEwuV5O5m1NyYu9XzxwMqxdaq68F0N+sH i4iUcYx8Go6W5OJChLZ153+LV7LohduqRzBSzcc0SYaBAIij1vO9NM3Jndc82TqNXEbB EaOvvPB/CFlrRrfimHR0IM89TqMxllmg0mrsHPu+Aa8f6oU+d0Kzm9AQA6yqiEjbx4g2 AnlQ==
MIME-Version: 1.0
X-Received: by 10.194.62.206 with SMTP id a14mr9267787wjs.26.1394844622183; Fri, 14 Mar 2014 17:50:22 -0700 (PDT)
Received: by 10.216.199.6 with HTTP; Fri, 14 Mar 2014 17:50:22 -0700 (PDT)
In-Reply-To: <CAMm+Lwi9_ifrMAcugCtBgatZ6nsZ62nuOKX=7vHy-sKe_BB19w@mail.gmail.com>
References: <em2c025504-6532-4513-a339-3d71c4cdfbda@helsinki> <5FC8412F-30E5-4F80-AB63-6715B1053098@vpnc.org> <58a4b20f768b484c94a850c4eba71ec5@BL2PR02MB307.namprd02.prod.outlook.com> <53222FFC.8070204@cisco.com> <5322714F.6080508@it.aoyama.ac.jp> <CAGrxA26HRqa+R580qfEMXU_JGid-UDzwwmQigOkOW0OWuA9mpg@mail.gmail.com> <CAK3OfOier6uQ4nVuuCP+uWV+eRbYh8qqAi4FVdWqNLHOh94L+A@mail.gmail.com> <CAGrxA275TwvbUkAT7tp9NtgTDN1WwPNP33aKmAZdB7QJkSY0CA@mail.gmail.com> <CAK3OfOj3e7pqj5R-ggHhXfaN5p1CG+6djiLizaRE2nJnF1ivGA@mail.gmail.com> <CAK3OfOhYxRR1ii3=eezXAmUR1ArpZDmAzbjRdHL2ASQ7Y1deDw@mail.gmail.com> <CAGrxA270ARHz-XepgY-4PpTGqJG+4xGbFQ15kWYXPs_52vHtEg@mail.gmail.com> <3DE14AC0-BF6F-4BFB-AF47-53BD3513BA05@tzi.org> <CAHBU6itS2tuXFh+5aq2Ms2JNd_4kAegW_MnKw558RiBDC7ECqw@mail.gmail.com> <CAMm+Lwi9_ifrMAcugCtBgatZ6nsZ62nuOKX=7vHy-sKe_BB19w@mail.gmail.com>
Date: Fri, 14 Mar 2014 19:50:22 -0500
Message-ID: <CAK3OfOiFE03hWMoEMo4FT1+o_9JKZrrvW3GNfNNaAq1B6c7ycQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Phillip Hallam-Baker <hallam@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/json/nzYtMAaV9A6iAqpiGeqR575lGew
Cc: Tatu Saloranta <tsaloranta@gmail.com>, Carsten Bormann <cabo@tzi.org>, "json@ietf.org" <json@ietf.org>, Tim Bray <tbray@textuality.com>, Matt Miller <mamille2@cisco.com>
Subject: Re: [Json] serializing sequences of JSON values
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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: Sat, 15 Mar 2014 00:50:53 -0000

On Fri, Mar 14, 2014 at 7:32 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
> On Fri, Mar 14, 2014 at 7:20 PM, Tim Bray <tbray@textuality.com> wrote:
>>
>> I’m strongly negative about requiring people to avoid newlines in their
>> JSON in order to be able to string chunks of JSON together into a stream.
>> JSON is unambiguously and easily parsable.  To talk in abnf, I don’t think
>> we should be satisfied with anything less than this:
>>
>> JSON-sequence = JSON-text *(text-separator JSON-text)
>> text-separator = 1*(  %x20 / %x09 / %x0A / %x0D )
>>
>
> JSON-sequence = JSON-text *(text-separator JSON-text)
> text-separator = 1*(  %x20 / %x09 / %x0A / %x0D / %2C)

It's much better to say that a separator must follow every text, since
then there's no need to concern ourselves as to ambiguities.  It also
permits parsers to produce values for texts like 'true ' or '1 ' as
soon as the separator is read rather than waiting for a separator (or
EOF) that might take a while to arrive.

  JSON-sequence = *(JSON-text 1*(text-separator))
  text-separator = %x20 / %x09 / %x0A / %x0D / %2C

I see no value in adding a comma (%2C) to the above.

Nico
--