Re: [Json] [Technical Errata Reported] RFC8259 (7617)

Guillaume Fortin-Debigaré <guillaume.fortin@debigare.com> Fri, 25 August 2023 06:42 UTC

Return-Path: <guillaume.fortin@debigare.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 091FAC151089 for <json@ietfa.amsl.com>; Thu, 24 Aug 2023 23:42:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.106
X-Spam-Level:
X-Spam-Status: No, score=-7.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=pobox.com header.b="opnYbgVr"; dkim=pass (1024-bit key) header.d=debigare.com header.b="ID7hT8xW"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MUUsS5D3TzYs for <json@ietfa.amsl.com>; Thu, 24 Aug 2023 23:42:19 -0700 (PDT)
Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7E1BCC14CE54 for <json@ietf.org>; Thu, 24 Aug 2023 23:42:19 -0700 (PDT)
Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 8E289349A2 for <json@ietf.org>; Fri, 25 Aug 2023 02:42:18 -0400 (EDT) (envelope-from guillaume.fortin@debigare.com)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:cc:content-type; s=sasl; bh=v7e8T/pDUxzrt9R8NiryjFCna293oNLy Vk864cKBgaI=; b=opnYbgVrTfQfWLpzh7UrIT9DuwwZAAW9Xhpk08Dm8zfkWHMh J20wKDOyMi79KXCOed1ChTup6gK78i6XqmAtfh41oRmi+iLFeg0maPhbNnQDcmL+ ykP4zKuSiWzloUJCszTnq1GdU/UOgefUVcEPd0V7CARvzLXXy7vAUZxpEYI=
Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 85C7F349A1 for <json@ietf.org>; Fri, 25 Aug 2023 02:42:18 -0400 (EDT) (envelope-from guillaume.fortin@debigare.com)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=debigare.com; h=mime-version:references:in-reply-to:from:date:message-id:subject:to:cc:content-type; s=2017-10.pbsmtp; bh=v7e8T/pDUxzrt9R8NiryjFCna293oNLyVk864cKBgaI=; b=ID7hT8xWKtKdIikxME4Ekl2cN/HpZAvIoOsLrhl+GIGg+cE9g9A1zaC8nJwkxEzBg9P9bR5LGZs4hwbiIXzTNrYuPcD1g1jhwy990rdCo3ejSoLYSK9dsO64RGOjP6fsKeQSGmHUqIC1pLCRIY0wmgsSTiByolFqSL+OOXrYQnw=
Received: from mail-yb1-f170.google.com (unknown [209.85.219.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 795033499E for <json@ietf.org>; Fri, 25 Aug 2023 02:42:15 -0400 (EDT) (envelope-from guillaume.fortin@debigare.com)
Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-d66f105634eso573951276.1 for <json@ietf.org>; Thu, 24 Aug 2023 23:42:15 -0700 (PDT)
X-Gm-Message-State: AOJu0Yxn3MNY1evd2H31oO7bBJXyxW4/PGTFde1Jn3qgGX51up1iaRSn ssa9mZfoUAqA+lFeOGMA4ep2roK9XXoYed0pXbI=
X-Google-Smtp-Source: AGHT+IFoVuVraPFbAnCUO0fc1ypgyNRwvjmTgErB8mcd7sgEITscshaymkdNTww0435pe5AWMHdaZmHAHr0Dr7Nsp8I=
X-Received: by 2002:a25:1c2:0:b0:d43:604f:9de1 with SMTP id 185-20020a2501c2000000b00d43604f9de1mr17196453ybb.17.1692945733647; Thu, 24 Aug 2023 23:42:13 -0700 (PDT)
MIME-Version: 1.0
References: <20230825043204.35FABAFB45@rfcpa.amsl.com> <CAChr6Sxjs_vhOVbt7_tdZ3tDC+E6TXfbdc0vEwZPyEEYphTqkw@mail.gmail.com>
In-Reply-To: <CAChr6Sxjs_vhOVbt7_tdZ3tDC+E6TXfbdc0vEwZPyEEYphTqkw@mail.gmail.com>
From: Guillaume Fortin-Debigaré <guillaume.fortin@debigare.com>
Date: Fri, 25 Aug 2023 02:42:03 -0400
X-Gmail-Original-Message-ID: <CAEESY01u+uDKYtSLhLFXgFPD4Oku89z_sp4688OHasis1C+nhA@mail.gmail.com>
Message-ID: <CAEESY01u+uDKYtSLhLFXgFPD4Oku89z_sp4688OHasis1C+nhA@mail.gmail.com>
To: Rob Sayre <sayrer@gmail.com>
Cc: RFC Errata System <rfc-editor@rfc-editor.org>, tbray@textuality.com, superuser@gmail.com, francesca.palombini@ericsson.com, linuxwolf+ietf@outer-planes.net, json@ietf.org
Content-Type: multipart/alternative; boundary="0000000000001404b20603b9a520"
X-Pobox-Relay-ID: 87649D7C-4312-11EE-88F0-F515D2CDFF5E-52997449!pb-smtp20.pobox.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/pc72tB9coWZUDnPQxZZoTKHZ-So>
Subject: Re: [Json] [Technical Errata Reported] RFC8259 (7617)
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.39
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: Fri, 25 Aug 2023 06:42:24 -0000

>
> I don't think this is a problem with the JSON RFC. The dispute here is
> about JSON.stringify(), part of the ECMAScript specification. Consult:
>
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
>
> There are many such choices in there:
>
> JSON.stringify({test: 0})
> '{"test":0}'
> JSON.stringify({test: -0})
> '{"test":0}'
> JSON.stringify({test: Infinity})
> '{"test":null}'
>

You just made me realize that JavaScript parses "-0" as negative zero,
despite stringifying the latter as "0". The fact that it is not
interoperable with itself is quite ironic.

That said, I only mentioned JavaScript as an example of
non-interoperability. My point is that even when software implements IEEE
754 binary64, it may not be interoperable due to this edge case.

The document does say "A number is represented in base 10 using decimal
> digits."
>

It does. but that wording is vague. For example, I had a discussion with my
work colleague the other day where they argued that the "e" part in a JSON
number may be parsed differently whether it is in uppercase or lowercase,
which would require special support in our product. This seems unlikely to
me outside of a parsing bug, but I've seen stranger things. A more likely
interoperability issue also arises when dealing with whether trailing zeros
should count as significant figures or not, which may matter for physicists
and data scientists. The negative zero case however is the only one that I
have noticed that actually contradicts the current text however, hence this
report.

In any case, I figured that since this issue was caused by incomplete
interoperability guidance that it would be a good opportunity to clarify
other potential interoperability issues with numbers at the same time, just
like you guys did with the parsing of surrogate characters in the previous
update.