Re: [Json] Kicking Off JSONbis

"Joe Hildebrand (jhildebr)" <jhildebr@cisco.com> Wed, 11 November 2015 21:31 UTC

Return-Path: <jhildebr@cisco.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 E48DD1B3A7C for <json@ietfa.amsl.com>; Wed, 11 Nov 2015 13:31:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.211
X-Spam-Level:
X-Spam-Status: No, score=-14.211 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_DKIM_WL=-7.5] 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 np81bRp6du42 for <json@ietfa.amsl.com>; Wed, 11 Nov 2015 13:31:11 -0800 (PST)
Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 56DF91B3A72 for <json@ietf.org>; Wed, 11 Nov 2015 13:31:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3900; q=dns/txt; s=iport; t=1447277471; x=1448487071; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=RtayIeEOS4BpWmL+7PaC1WX5TrzeWCvOyMz21weTHGU=; b=iR1AzSHe/H/XEo+b2IXFJ7aajVL/uC/bH3ZTK34HNL9jtWD4jMCF5vCJ Biw/MNBuoBb5PolhOPV612m05t+CFk7IIt38wcVoc4nTHzER7iLEx+Iin mnPy0Qr3Q9X4a3SB7LZelKw0Xg4th14PAASxnDSoHFYQ5vS4qAbavOk74 E=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0BHBQDvskNW/5NdJa1eDoMtU28GviaBZSWFawIcgS46EgEBAQEBAQGBCoQ1AQEDASMRRRACAQgaAiYCAgIfERUQAgQBDQWIGQMKCA2zeowDDYRjAQEBAQEBAQEBAQEBAQEBAQEBAQEBGIEBhVOCEIJuglOCBoMcL4EVBZZIAYUcgnCDJIF1gVuEQI5Xh1IBKAU2ghEdgRg+cgGEToEHAQEB
X-IronPort-AV: E=Sophos;i="5.20,277,1444694400"; d="scan'208";a="49688055"
Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Nov 2015 21:31:10 +0000
Received: from XCH-RTP-002.cisco.com (xch-rtp-002.cisco.com [64.101.220.142]) by rcdn-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id tABLVA0s000436 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 11 Nov 2015 21:31:10 GMT
Received: from xch-rtp-001.cisco.com (64.101.220.141) by XCH-RTP-002.cisco.com (64.101.220.142) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Wed, 11 Nov 2015 16:31:09 -0500
Received: from xch-rtp-001.cisco.com ([64.101.220.141]) by XCH-RTP-001.cisco.com ([64.101.220.141]) with mapi id 15.00.1104.000; Wed, 11 Nov 2015 16:31:09 -0500
From: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>, "Martin J. Dürst" <duerst@it.aoyama.ac.jp>, Carsten Bormann <cabo@tzi.org>
Thread-Topic: [Json] Kicking Off JSONbis
Thread-Index: AQHRF6V8wbG58cqRTk2NlHPfs03MdJ6NciuAgAalzoCAAbOhAIABdCOA
Date: Wed, 11 Nov 2015 21:31:09 +0000
Message-ID: <313EF0F9-0DC4-432B-9904-1E8B4C483EA9@cisco.com>
References: <DB74C466-D542-42D6-95B0-690A564435A9@cisco.com> <CAC4RtVD3cKThDTr_eS-QCUhKqZkMS0y+nPS5HxCk3f1RQ7VyJQ@mail.gmail.com> <CAHBU6iv_w_O95Nq-bU1z2GOKgouuGrMbZP4Uwio25pPtFCc3UQ@mail.gmail.com> <CALaySJ+==5_mstrgHEd7bUGzSo85Er9VR_zEaJ+gh-O+zSpK=w@mail.gmail.com> <88A80A45-E673-4D0A-995B-3872874C23AE@cisco.com> <CALaySJJ01gEoHqZ4ehVHzv8mqD1CXKV3Ave3yQPrgrAGe4yckg@mail.gmail.com> <CAHBU6iuxBvn3ug9LwcK9gvrQDLr1uz=3NCrcrZaejF2iUwiLVA@mail.gmail.com> <CAChr6SzuxZrCJ+Gfc9LkKX88SetAOTp3GpxpxVF1CmmT3j5MoQ@mail.gmail.com> <56241BFE.5080609@tzi.org> <2DB105A8-AB80-4386-915D-D9AD1FBF77AD@cisco.com> <56342E23.6000509@tzi.org> <563B15AD.3070309@it.aoyama.ac.jp> <563B17FF.5050002@gmail.com> <FF6B7829-0FA5-42D5-848D-B279069376C8@cisco.com> <56421902.8040001@gmail.com>
In-Reply-To: <56421902.8040001@gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/0.0.0.151105
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.19.203.19]
Content-Type: text/plain; charset="utf-8"
Content-ID: <14A5C9CA2383CB4690E40230F744DB62@emea.cisco.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/IWw2FNWi7RdJ2FNmfS8-eulTcU8>
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Kicking Off JSONbis
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: <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, 11 Nov 2015 21:31:13 -0000

On 11/10/15, 9:19 AM, "Anders Rundgren" <anders.rundgren.net@gmail.com> wrote:



>On the creation side there is nothing special to do in an ES6 environment.  In a non-ES6 JSON toolbox, you only need to use an ordered dictionary like LinkedHashMap in Java to get things right. 

I understand that I *could* write code to generate keys in the same order, but I don't understand why I would bother, when the specified order is:

(from: http://www.ecma-international.org/ecma-262/6.0/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys)


- Integer keys in numeric order (ok, makes sense for array-like things, but seems mostly moot for JSON)
- String keys in *creation* order

I don't yet see how creation order is useful to preserve.

>Well, numeric properties would need something else but that appears to be an edge-case, not worth bothering with.   For those who disagree with that, strict creation order does in no way rule out numeric property order, it only requires a bit more care by the programmer :-)

Please focus on the interoperability benefits.

>>   On the parse side, I *guess* you might want to know that there is an information signal retained by the order of properties.  That could be used as a steganographic channel, for instance.  It doesn't seem specific to ES, though.
>>
>> I think there maybe some other reason why ES's property order logic might be interesting to you though - can you say more, please?
>>
>
>My target application has since mid-2013 been a JSONesque counterpart to XML's enveloped signatures but without getting bogged down by complex, stand-alone canonicalizers.  The latest developments seem to verify that the most difficult part of JSON (Numbers), also are properly canonicalized by the majority (but not all) ES6 implementations.  This enables very simple and efficient "in-object" JavaScript and JSON signatures which only rely on standard JavaScript for creating and manipulating objects and the built-in JSON parse/stringify methods for parsing and serialization respectively:
>
>https://mailarchive.ietf.org/arch/msg/jose/s5TdEtfOdQ0z3Qmtij2yXemZW-A

Oh!  You're relying on the parsing and serializing code to be parallel, such that the parser maintains order, and the serializer repeats that order on output.

Interesting.  However, that would be a major change to the JSON spec (that would necessitate changes to LOTS of existing code, at a performance or memory penalty). It also took me a good amount of time to track down even in the ECMAscript doc - so I don't think you can expect most folks reading ECMA-404 to figure this out either.  If you really want interoperability, there's nothing stopping you from doing something like I-JSON that says an ordered-json is JSON, except for some other constraints.

-- 
Joe Hildebrand