Re: [Json] Regarding JSON text sequence ambiguities (Re: serializing sequences of JSON values)

Larry Masinter <masinter@adobe.com> Thu, 13 March 2014 21:44 UTC

Return-Path: <masinter@adobe.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 2AAC61A0A47 for <json@ietfa.amsl.com>; Thu, 13 Mar 2014 14:44:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001] autolearn=ham
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 Wn8CurqDgSah for <json@ietfa.amsl.com>; Thu, 13 Mar 2014 14:44:49 -0700 (PDT)
Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0183.outbound.protection.outlook.com [207.46.163.183]) by ietfa.amsl.com (Postfix) with ESMTP id E5A171A0778 for <json@ietf.org>; Thu, 13 Mar 2014 14:44:48 -0700 (PDT)
Received: from BL2PR02MB307.namprd02.prod.outlook.com (10.141.91.21) by BL2PR02MB308.namprd02.prod.outlook.com (10.141.91.24) with Microsoft SMTP Server (TLS) id 15.0.893.10; Thu, 13 Mar 2014 21:44:39 +0000
Received: from BL2PR02MB307.namprd02.prod.outlook.com ([10.141.91.21]) by BL2PR02MB307.namprd02.prod.outlook.com ([10.141.91.21]) with mapi id 15.00.0893.001; Thu, 13 Mar 2014 21:44:39 +0000
From: Larry Masinter <masinter@adobe.com>
To: Matthew Morley <matt@mpcm.com>, Nico Williams <nico@cryptonector.com>
Thread-Topic: [Json] Regarding JSON text sequence ambiguities (Re: serializing sequences of JSON values)
Thread-Index: AQHPPK1+m0ZN/rvGs0aL4VgGaA1MH5ra4iQAgAEiVACAABS3AIAAAQkAgAAFrgCAABB4gIAABUUAgANa6GA=
Date: Thu, 13 Mar 2014 21:44:38 +0000
Message-ID: <664149bc6d3941afad86684fac806a17@BL2PR02MB307.namprd02.prod.outlook.com>
References: <CAK3OfOj_XQJq-JKAjNdH-GuH0_UwZfeWntgyyizMpTLmSaWQoA@mail.gmail.com> <CAK3OfOio58+1yuxQOcvWep1CADMfE1PVC48XDid0dWvd8=SVjA@mail.gmail.com> <CAOXDeqoYb=NXz4ikMxAg3EHFA+903bFgdpR_BL-K18U2oYriXQ@mail.gmail.com> <CAK3OfOiPDfWpOZgExTmwwq6WFcuVbyi_z3C0=M9RhQveBhV_+w@mail.gmail.com> <CAHBU6iuRyRd95Wa_omGS1_T52t+s0AKjWPUW21EAh2ySHuFp=A@mail.gmail.com> <CAMm+LwjRA8x0=zXGRVDy0BqYvyOcEp7=gnUiG4vYOb1RScoyrA@mail.gmail.com> <CAK3OfOj1g_sbnhw9FBCCZtLWsFS5F+aoPX0d5AMkRxQ2fHQi0A@mail.gmail.com> <CAOXDeqpbSmEicxq_JzJa2iQDn8uJp3XkWp3FGbsbpg-_vgOiaQ@mail.gmail.com>
In-Reply-To: <CAOXDeqpbSmEicxq_JzJa2iQDn8uJp3XkWp3FGbsbpg-_vgOiaQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [192.150.10.210]
x-forefront-prvs: 01494FA7F7
x-forefront-antispam-report: SFV:NSPM; SFS:(10019001)(428001)(199002)(189002)(377454003)(24454002)(51704005)(74876001)(74502001)(46102001)(47446002)(4396001)(87266001)(74316001)(65816001)(54356001)(85306002)(56776001)(53806001)(80022001)(51856001)(69226001)(66066001)(74706001)(19300405004)(74366001)(76796001)(76786001)(47736001)(2656002)(50986001)(80976001)(85852003)(19580405001)(83072002)(19580395003)(76576001)(97336001)(79102001)(94946001)(59766001)(77982001)(97186001)(83322001)(92566001)(93136001)(33646001)(81342001)(56816005)(63696002)(95416001)(90146001)(15202345003)(31966008)(15975445006)(16236675002)(76482001)(49866001)(47976001)(86362001)(81686001)(95666003)(93516002)(81542001)(81816001)(74662001)(87936001)(94316002)(24736002)(579004); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR02MB308; H:BL2PR02MB307.namprd02.prod.outlook.com; CLIP:192.150.10.210; FPR:C867F454.A6E1F409.71DF7177.40A5F1F1.20431; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (: adobe.com does not designate permitted sender hosts)
Content-Type: multipart/alternative; boundary="_000_664149bc6d3941afad86684fac806a17BL2PR02MB307namprd02pro_"
MIME-Version: 1.0
X-OriginatorOrg: adobe.com
Archived-At: http://mailarchive.ietf.org/arch/msg/json/VxLYWXgm1H_jbjXUy-oU6MM5Cxk
Cc: Phillip Hallam-Baker <hallam@gmail.com>, Tim Bray <tbray@textuality.com>, Paul Hoffman <paul.hoffman@vpnc.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Regarding JSON text sequence ambiguities (Re: 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: Thu, 13 Mar 2014 21:44:54 -0000

I think most of i-json and also this discussion on JSON sequences would fit into a "guidelines" document. "Guidelines for use of JSON in Internet protocols".
Then it could be BCP, could cover \u2028 \u2029, string length limits, floating point, separators in sequences, and other advice.

much more straightforward. It could even cover "JSON vs alternatives" and pros and cons comparison to XML, CBOR, ASN.1 and whatever.





From: json [mailto:json-bounces@ietf.org] On Behalf Of Matthew Morley
Sent: Tuesday, March 11, 2014 11:27 AM
To: Nico Williams
Cc: Tim Bray; Phillip Hallam-Baker; Paul Hoffman; json@ietf.org
Subject: Re: [Json] Regarding JSON text sequence ambiguities (Re: serializing sequences of JSON values)

I'm not advocating for comma separators...

But having multiple top level JSON elements separated by a coma is equivalent to processing an array structure. The initial [ and the closing ] are implicitly mapped to the connection/stream/etc. start and end events.

It is just a minor token replacement at the top level between elements, which could be layered into some existing tooling. From this point of view, I would imagine the retooling is minor for either use case. It does mean tools need to be depth aware.

On Tue, Mar 11, 2014 at 2:08 PM, Nico Williams <nico@cryptonector.com<mailto:nico@cryptonector.com>> wrote:
On Tue, Mar 11, 2014 at 12:09 PM, Phillip Hallam-Baker <hallam@gmail.com<mailto:hallam@gmail.com>> wrote:
> On Tue, Mar 11, 2014 at 12:48 PM, Tim Bray <tbray@textuality.com<mailto:tbray@textuality.com>> wrote:
>>
>> Heh, I wonder if there'd be any chance of getting consensus.  I can't
>> imagine ever using anything but Object Object Object with optional
>> whitespace separator; unless we all agree on that going in I'd pessimistic
>> about anyone convincing anyone else...
>
> But JSON has comma separators, so {..}, {..}, {..} makes far more sense.
JSON text sequences would be a new Proposed Standard (if we go there)
but like JSON, there exist uses of this "new" thing already -- that
is, before we get to writing the RFC.

The uses of JSON text sequences that I know of use newlines, not
commas nor comma-and-newline.  The reason for this is that these use
cases are text logfile-like: the entries are lines, lines containing
JSON texts -- usually compact texts, i.e., with no newlines in the
text, and never more than one text per-line.

For me other uses of JSON text sequences generally result from my use
of jq, which also effectively separates texts with a newline.  Note
that jq doesn't need texts to be written compactly when parsing JSON
text sequences.  It happens though that if you write texts compactly
followed by a newline then you can implement JSON text sequences with
all existing JSON parsers.

Switching to using a comma-and-newline would require significant
retooling.  Therefore I don't see it happening.  Whereas just
separating JSON texts with newlines is in use because it's always been
the obvious thing to do.

Nico
--



--
Matthew P. C. Morley