Re: [Json] JSL: Clarifying purpose, and renaming it to JDDF

"Manger, James" <James.H.Manger@team.telstra.com> Mon, 02 September 2019 01:45 UTC

Return-Path: <James.H.Manger@team.telstra.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 7EB8E1200F6 for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 18:45:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=team.telstra.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 pWTXJAf0r2ST for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 18:45:56 -0700 (PDT)
Received: from ipxdno.tcif.telstra.com.au (ipxdno.tcif.telstra.com.au [203.35.82.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B907F12003F for <json@ietf.org>; Sun, 1 Sep 2019 18:45:53 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.64,457,1559484000"; d="scan'208";a="152552757"
X-Amp-Result: SKIPPED(no attachment in message)
Received: from unknown (HELO ipcbni.tcif.telstra.com.au) ([10.97.216.204]) by ipodni.tcif.telstra.com.au with ESMTP; 02 Sep 2019 11:45:50 +1000
Received: from wsmsg3705.srv.dir.telstra.com ([172.49.40.203]) by ipcbni.tcif.telstra.com.au with ESMTP; 02 Sep 2019 11:45:50 +1000
Received: from wsapp5585.srv.dir.telstra.com (10.75.3.67) by WSMSG3705.srv.dir.telstra.com (172.49.40.203) with Microsoft SMTP Server (TLS) id 8.3.485.1; Mon, 2 Sep 2019 11:43:49 +1000
Received: from wsapp5584.srv.dir.telstra.com (10.75.131.20) by wsapp5585.srv.dir.telstra.com (10.75.3.67) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 2 Sep 2019 11:43:47 +1000
Received: from AUS01-ME1-obe.outbound.protection.outlook.com (10.172.229.126) by wsapp5584.srv.dir.telstra.com (10.75.131.20) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 2 Sep 2019 11:43:47 +1000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jvDK+w25P7cObWTQj6ly5Wmq0qXwj8fCqhDLtxVlot8DrODkHChH1YetjFdQGRJ00GOyW9ktt85fWWPPPE3yqCjlFyz8PHV08p7pRlp0iTw8VddU3vQw0EmdN5XoxdMhPX75ZVv2zEqJpNeXD+7j5yoGtpoFB/YBBwueEyoQkAe6/Vt8k+r9UNIJvQsSSo2HtNDRiisx0aHxCQ1DGD4z3PbllzHxet5s44qKxzpgtx9YqZcImFrc1iVard0ImihLewwNShRIuW+RaNhQR+pos4rjSGQO5F1VcuNZrbT7QHPEkzlaFzJayWSUVIXVRVBWo5rkyGvrGdINrZR75zn8PQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=42drhMml6HW5/y3AiotSTVWNX7cgJi7CZcLLxX+Q+sI=; b=B3Ndj+Usz43nOI6AcD8ilV/yjdECiuwMZH5D2VmiPuezCnvq5Ge7pjjeLmp2Cg6/77U37FDT3wADKk4k2NSZFLt/7XSn/c/nI21Uj2oONY7e6WFaEvRpilMvROOmmoZCP5ZDG/70Ai/ELcArwFl2NVS5VZoMv4h3Z38qUNqBHlYSkoeVDOOm1ZAUttt9thwkFIiLFG4wI6xsAJNdwdJ8seTne+KDxjaH2cdU+DatFfw4ppQ4jOzIdTNIrOW+QmYZsil0KeyKFmudFHZ674ExOOZU2DKYn+ZCzliSNS7vBB5vs7yNNFKMeT4Dnj9xX8dTcmn2vOa/ZsvydpJz5bbupQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=team.telstra.com; dmarc=pass action=none header.from=team.telstra.com; dkim=pass header.d=team.telstra.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=team.telstra.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=42drhMml6HW5/y3AiotSTVWNX7cgJi7CZcLLxX+Q+sI=; b=MQ6a91um7MnFddpPCYq9yhqi6EPtKv/CInpBqXV6yBPbSVN/xm/YyrKHZLmrC90YTTai2y6AqcOkMZX9MxKC6p8peHPWDk+KUq14nV5vloaxEEqnRUYnpMfiM8Ix8uf207fpnM4yx5vvxZsi84bgzIHy7UGwkYsN1Q2g6d/APvc=
Received: from ME2PR01MB2753.ausprd01.prod.outlook.com (52.134.205.148) by ME2PR01MB4066.ausprd01.prod.outlook.com (52.134.222.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.20; Mon, 2 Sep 2019 01:43:46 +0000
Received: from ME2PR01MB2753.ausprd01.prod.outlook.com ([fe80::49ef:3e0b:cfc9:e613]) by ME2PR01MB2753.ausprd01.prod.outlook.com ([fe80::49ef:3e0b:cfc9:e613%7]) with mapi id 15.20.2220.021; Mon, 2 Sep 2019 01:43:46 +0000
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Ulysse Carion <ulysse@segment.com>
CC: JSON WG <json@ietf.org>
Thread-Topic: [Json] JSL: Clarifying purpose, and renaming it to JDDF
Thread-Index: AQHVXdry9oK6lPp0d0O1tpBiqjOWTKcRrocAgAW8c4CAACijUA==
Date: Mon, 02 Sep 2019 01:43:46 +0000
Message-ID: <ME2PR01MB27539FF21FFFF4CD23993258E5BE0@ME2PR01MB2753.ausprd01.prod.outlook.com>
References: <CAJK=1Rj6zW_MffKvsOiQh28KY5yDeoALGSYqve+vGj52s1Owag@mail.gmail.com> <SY2PR01MB2764EDAB3DD01417A95A26D5E5A20@SY2PR01MB2764.ausprd01.prod.outlook.com> <CAJK=1RhFnTqa+9b5M_WrPiEVg_+Prkv_+pazg8y1vACD7PXAkw@mail.gmail.com>
In-Reply-To: <CAJK=1RhFnTqa+9b5M_WrPiEVg_+Prkv_+pazg8y1vACD7PXAkw@mail.gmail.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
dlp-product: dlpe-windows
dlp-version: 11.1.100.23
dlp-reaction: no-action
authentication-results: spf=none (sender IP is ) smtp.mailfrom=James.H.Manger@team.telstra.com;
x-originating-ip: [203.35.9.32]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 8f319b16-ddc5-4526-ed1c-08d72f46ff00
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:ME2PR01MB4066;
x-ms-traffictypediagnostic: ME2PR01MB4066:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <ME2PR01MB4066455DF29DE04ECDB5DB0DE5BE0@ME2PR01MB4066.ausprd01.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 01480965DA
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(199004)(189003)(478600001)(6916009)(86362001)(14454004)(11346002)(71190400001)(486006)(33656002)(446003)(74316002)(6436002)(102836004)(229853002)(305945005)(256004)(476003)(7696005)(7736002)(76176011)(71200400001)(2906002)(9686003)(55016002)(6506007)(6306002)(14444005)(66066001)(316002)(53936002)(66446008)(8676002)(6246003)(64756008)(66556008)(66476007)(81166006)(81156014)(3846002)(66946007)(4326008)(8936002)(26005)(76116006)(99286004)(25786009)(186003)(5660300002)(52536014)(6116002); DIR:OUT; SFP:1102; SCL:1; SRVR:ME2PR01MB4066; H:ME2PR01MB2753.ausprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:1;
received-spf: None (protection.outlook.com: team.telstra.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: TLnp6yf2amAA3siOyW3rfWfKx3LENzAPkO2A8b2+km5WVu5gi2PXAg7/LNepVVtIrlMZkmAw4oVdma5b1oZf3B2cXFruMYhdMEXGLzXf0NldPPGmp/cQG535hdsaQqSEO0geWcQOVVodeDL+7Sp7nxJbBDoDbiKT6uHC59gaTyaXhy0t9j3BnAnT2lldkExlr/MDHrhagpL2GNb+zAJimd8M0z4srh3QuFaZQLfijyl9E8HRUE+rTKyckybZMY0/dRe4cHarHgqQF2ZJYF8E1Vq/Pw3Ahb552PQrO69l1eiGSnSDDfm5r66EqA9iOx24gTZGgBTPxM4DuZBTdgwWC4n1FeNsZ+PTJ9SHiTG89D8s7D4WC7iFQU3ZwvZq4kaUY3z6gemsMBmyxOBjNq83acuMjLVyHTvFJHi/OK1nb5c=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 8f319b16-ddc5-4526-ed1c-08d72f46ff00
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2019 01:43:46.7502 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 49dfc6a3-5fb7-49f4-adea-c54e725bb854
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: nskmPEoXzGX8jDjqbgrfDDL9ZptPTtaA4dn88ecHMh1utjsexOvaL2DKWHIeDlvw/vp80bAhHkwxs+zV8OjrVwht53AlzzyWVWz3YDQKLbE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: ME2PR01MB4066
X-OriginatorOrg: team.telstra.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/UGp8t7l6x3N4RgVSj36gLuflv-k>
Subject: Re: [Json] JSL: Clarifying purpose, and renaming it to JDDF
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 02 Sep 2019 01:46:00 -0000

>> JDDF offers "type":"uint8" but very common languages, such as Java, don't have an unsigned 8-bit type. So code generation might use a short (16-bit signed integer) to handle the [0, 255] range. That seems to put the code in a very similar situation to using a long when the JDDF says "int54". In both cases the native type can hold values that the schema doesn't allow, requiring extra parse/stringify functions if you really want to enforce the schema's rules.

>This isn't quite right. Yes -- Java only has "byte", but by convention you can store both signed and unsigned 8-bit numbers in these bytes.
>Protobufs does this:

That is certainly 1 reasonable choice for a code generator.

>Furthermore, the Java standard library has methods that explicitly let you do the conversion of a Java byte-as-uint8 into a Java int or long:
>
>https://docs.oracle.com/javase/8/docs/api/java/lang/Byte.html#toUnsignedInt-byte-
>https://docs.oracle.com/javase/8/docs/api/java/lang/Byte.html#toUnsignedLong-byte-
>
>If bytes-as-uint8 weren't conventional, then why does java.lang.Byte have methods that enable such a style?

Did you notice the "Since 1.8" annotation on those methods? This support for byte-as-uint8 was only added in Java 8.
And even these additions don't make Java's standard sorting or printing work for uint8. Generated code cannot merely using byte for uint8; it also needs to add code so a byte-as-uint8 is serialized differently to a normal byte-as-int8.

Short-as-uint8 has different properties: sorting & serializing works as "normal", but it takes twice as much memory.

If I saw uint8 in JDDF, I'd almost certainly want control over whether it became a byte or short in my Java code, depending on the situation.


>> * "type": "intString" ...
>> * "type": "uintB64u" ...
>> * "type": "bytesB64" ...
>> * "type": "bytesB64u" ...

> I think I'm opposed to this suggestion. Adding support for arbitrary binary data is going to be challenging. I think I prefer that we just stick to {"type":"string"}, and then folks can write their own extensions to JDDF to achieve their specific needs. After awhile, the community may perhaps converge on common extensions, or patterns may arise and we can update the JDDF spec.
>
>Anything we add to the spec now would have to be supported by all implementations. So I'd prefer we give out a minimal spec to the world, and see where the real world takes it. If we try to solve all problems right away, we may make it too hard for implementations to crop up, ultimately solving no problems for anyone.

But if the spec is too minimal it isn't worthwhile.

--
James Manger