[Json] Adding integers to JSON (Re: JSON Schema Language)

Carsten Bormann <cabo@tzi.org> Wed, 08 May 2019 17:00 UTC

Return-Path: <cabo@tzi.org>
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 620AA120164 for <json@ietfa.amsl.com>; Wed, 8 May 2019 10:00:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=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 HCAb1g0pUUOb for <json@ietfa.amsl.com>; Wed, 8 May 2019 09:59:58 -0700 (PDT)
Received: from smtp.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 31157120189 for <json@ietf.org>; Wed, 8 May 2019 09:59:58 -0700 (PDT)
Received: from [192.168.217.106] (p54A6CC75.dip0.t-ipconnect.de [84.166.204.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 44zjQ362RhzyNF; Wed, 8 May 2019 18:59:54 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <20190508160740.GU21049@localhost>
Date: Wed, 08 May 2019 18:59:54 +0200
Cc: JSON WG <json@ietf.org>
X-Mao-Original-Outgoing-Id: 579027591.743409-5396a9c1703ba3cb3e1837f1a47a80ae
Content-Transfer-Encoding: quoted-printable
Message-Id: <ACD9A0A2-A75E-4B6E-9E9B-165DC222781B@tzi.org>
References: <CAHBU6itE8kub1qtdRoW8BqxaOmzMv=vUo1aDeuAr3HX141NUGg@mail.gmail.com> <77994bdb-a400-be90-5893-b846a8e13899@gmail.com> <20190507154201.GP21049@localhost> <CEF72901-5077-4305-BA68-60624DCE952D@bzfx.net> <69ea0c99-e983-5972-c0aa-824ddeecb7c4@dret.net> <CAMm+LwjyVjnJuWE4+a9Ea=_X1uuEGuK+O4KojzN3uVQ+s+HqUQ@mail.gmail.com> <058f58a3-dd27-998e-5f54-4874aff5f2f0@dret.net> <20190507221726.GR21049@localhost> <CAJK=1Rj7PBD-bbwvsqgjQQzp4Aoidb-W2q5Lj6asMHHDHaTVYQ@mail.gmail.com> <702ee54b-9465-7ca8-b521-2a88c1a47785@gmail.com> <20190508160740.GU21049@localhost>
To: Nico Williams <nico@cryptonector.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/dM2yMQWynwJrxkYtuYWuy2w-rmk>
Subject: [Json] Adding integers to JSON (Re: JSON Schema Language)
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: Wed, 08 May 2019 17:00:01 -0000

On May 8, 2019, at 18:07, Nico Williams <nico@cryptonector.com> wrote:
> 
> That's an interop bug.  They should fix it.

It also nicely demonstrates the law of inevitable extensibility.

JSON was designed not to provide extensibility.  Ever.
Radical, but a well motivated idea at the time.

Now people did not want to accept that.
They wanted to extend the JSON data model with the distinction between two number types.

The law of inevitable extensibility says:

# If you don’t provide an extension point, somebody will.
# They will shove their extension into any crevice available.
# (And your up to now rock-solid design breaks.)

The crevice here was that there are many ways to express the number 3: 3, 3.0, 3e0, 0.03e2, 300e-2 etc.  We can give some of these expressions different semantics than the other.  Voila.  Extensibility achieved.  Brittleness added.

I have seen the law of inevitable extensibility applied to:

— duplicate map keys for adding comments to JSON.  Some people believe:

  { “postcode”: “This is a comment about the post code 4711”,
    “postcode”: 4711 }

  is a valid way to extend JSON with comments.  (Because their implementation happens to ignore map keys that are invalidly used again later, which is not a given.)

- unnecessary escaping for ascribing some special semantics.  Say, if a string starts with “\u0073” and not with the equivalent “s”, this is supposed to mean the string has some different semantics (e.g., the rest is a base64url encoded byte string as opposed to what would normally be a text string, or a type tag, or…).

— millions of ways of interpreting whitespace or the lack thereof.  I’ve lost count.


I do not think any longer that anything that is meant to see significant usage can be designed without designing in extensibility points from the start.  At least if it is supposed to last.

Grüße, Carsten