
From nobody Sat Jul 14 01:39:54 2018
Return-Path: <anders.rundgren.net@gmail.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 D4088130DDB for <json@ietfa.amsl.com>; Sat, 14 Jul 2018 01:39:52 -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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 xji5eOs4eGtf for <json@ietfa.amsl.com>; Sat, 14 Jul 2018 01:39:51 -0700 (PDT)
Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4A9541277C8 for <json@ietf.org>; Sat, 14 Jul 2018 01:39:51 -0700 (PDT)
Received: by mail-wm0-x231.google.com with SMTP id s14-v6so11353899wmc.1 for <json@ietf.org>; Sat, 14 Jul 2018 01:39:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=4D8wWiJOMMJisaJUTs092DXOZ2A8wNb5nMw+c9zwmCE=; b=a0z7d6gZ09TNo5oXvZvpRgfu9qbrwnhVITK20KhjT/cEd+Bi2d8hOUXo/tikm1+6Mw zWgRiPjY16bMNa4hsmL3GB2c8aEDy/WzLK/tg6fvzFp3uZ6M06R1fXvgQH/ya4OYxEFk diVqR/rE2C8L6gxJmcDwu0ORKK/qqCT6o8qN0LKChm0JvOb4LqguGlTZKI7uwP56bnQJ jn0nNOXc/thyqYSwCmaFYvL7TQrAS0UH8jp8rywRI+Jr4OJcF9gniLrFZVpjL2kYM7QY e56mv+rMwIOHRDsugraGs1RvpNXX4LuokyuGkcpVii9BvaG+UY/SOpx2HipgtPougqmE 1f1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4D8wWiJOMMJisaJUTs092DXOZ2A8wNb5nMw+c9zwmCE=; b=lKOsnjlIqHnN6h72TT6F3MEGL2oictNz7rxVoXdMNf+LUZ+rQl/tp7NxhS6NGFma8i kRhpOhhmtc4+Ho1n28WKqXCWVDOKC/cWGmfsZpUGJ8upNJRADnOUmPSS828TAbkUAhr5 Rtm/FqlAVLnC0vBHI3JNI9HGDwdi7DNaM8arN2vXH7aqQYDoZrrY3T2QNtnaNC8ZWMXW dwc0WYWyE6dLsrt4HnMTNlL+rKkXqP3uTw/fgotRNH/W+Hp479ydOnVu5bFC6XaBgR77 DdCSbUN+UkYUhmKWWR6Agn4TfzakNeuMU5VgD1Ml/w0efu9Pw0VEycW3T0GG9pIv1axk gjKQ==
X-Gm-Message-State: AOUpUlHXPx7LBke2LDcOQr9BX8Yb+Ao1WLrOR0/+F2XgzIXCgfM4mfDC TPjKFPfD5ppFgLwhldBc0dEgAA==
X-Google-Smtp-Source: AAOMgpe2orbiHOpYvoIHyLEBKzKFXf4y6ENcmPxGHMnCP5+4H8pbmOoBXn2tJ2GGlf0XjkD5uXNpgQ==
X-Received: by 2002:a1c:1182:: with SMTP id 124-v6mr5637150wmr.75.1531557589365;  Sat, 14 Jul 2018 01:39:49 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id l127-v6sm24082252wma.41.2018.07.14.01.39.47 for <json@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jul 2018 01:39:47 -0700 (PDT)
References: <24301400-0250-e0a4-5152-42f29ad2b2c5@gmail.com>
To: "json@ietf.org" <json@ietf.org>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
X-Forwarded-Message-Id: <24301400-0250-e0a4-5152-42f29ad2b2c5@gmail.com>
Message-ID: <6e28cd00-a18e-cbba-d546-1cb1228178bf@gmail.com>
Date: Sat, 14 Jul 2018 10:39:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <24301400-0250-e0a4-5152-42f29ad2b2c5@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/jrRpnqXro7a9SW7Xg9ETufyWT6w>
Subject: [Json] JSON support for BigInt in Chrome/V8
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.27
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: Sat, 14 Jul 2018 08:39:53 -0000

var small = BigInt("5");
var big = BigInt("5555555555555555555555555500003");
JSON.stringify([big,small]);
VM330:1 Uncaught TypeError: Do not know how to serialize a BigInt
      at JSON.stringify (<anonymous>)
      at <anonymous>:1:6

JSON Number serialization has apparently reached a new level (of confusion).

Personally I don't see the problem.  XML did just fine without hard-coded data types.

The JSON type system is basically a relic from JavaScript.  As such it has proved to be quite useful.
However, when you are outside of that scope, the point with the JSON type system gets pretty much zero since you anyway need to map extended types.

Oracle's JSON-B solution which serializes small values as Number and large values as String rather than having a unified serialization based on the underlying data type seems like a pretty broken concept although indeed fully conforming to the JSON specification. "Like the Devil reads the Bible" as we say in Scandinavia :-)

Adding a couple of double quotes is a major problem?  If so, it seems like a way more useful project making quotes optional for keys (named in a specific way), like they already are in JavaScript.

Yeah, and of course adding support for comments.

Anders


From nobody Sat Jul 14 15:24:27 2018
Return-Path: <tbray@textuality.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 2D226126CC7 for <json@ietfa.amsl.com>; Sat, 14 Jul 2018 15:24:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level: 
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=textuality-com.20150623.gappssmtp.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 YIlj77_dRxKK for <json@ietfa.amsl.com>; Sat, 14 Jul 2018 15:24:23 -0700 (PDT)
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7EB08130E6E for <json@ietf.org>; Sat, 14 Jul 2018 15:24:23 -0700 (PDT)
Received: by mail-ed1-x531.google.com with SMTP id i20-v6so14190901eds.12 for <json@ietf.org>; Sat, 14 Jul 2018 15:24:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=scFvdeoQgZQvUwCnXv2xHXmvmhU4hi3IFWXYJ0vzBtg=; b=Q4XzQ4njIqn4N4R6JRXSA2OKuud8TswI8nyTwh18Qg0CDfpJl6ZGC249Pu2TDEnrgA +bxDKBiY+T2AAU4fjR+aFLdAuudC1RHUO8mI5odijn+1JQ/hBQbptIEJYRx7rXM7f3UY pbdSPIrEa9RK8sBQWMrSClizdo2eRW2en0ek5sp8fDdJl4+c405pG5RljDz2f1wigAdR QKT1XjYbd0VmiOeAKShHAmaTcw70iI/xDMoTrfqC4fRju/nLSf6WgcRJX9NGZPyhAs28 wuPrxXsgTKFk71e6SQ7FHfPNWFz7M/xA5qbLhoYx6PXucGCIi4XMqQM77pYNL/EhfYk3 DE9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=scFvdeoQgZQvUwCnXv2xHXmvmhU4hi3IFWXYJ0vzBtg=; b=D/ERVNfF/e0XHbIRjVzSeEihXYWzIvmDWN56vNNwBygiuaguIjAE70VJtA2dJLDmxl FbQyxgCyywfB22Hjt+SlSWWJ/ol/oB4CFGAEcMffdDo/SaAFvaheroDcyotdYQhWMAUp fu3EX2UzDsvl9TKyDiYc8SXkJuXWkumjL3y/T3YusNc95PAxfv8dAOxTiJwN3sqwwxUD ZQaHTULV/qoA/AR49eNL4kAeMUzkl/ozbbbDr9bKa6VVrMFeL9o1+wOopkyIBKMBe23z kcDJMInni1wVi5qUjoz2QbxX+c85QnbFMocInWh21Y+I3zvkeYyb+rbEI2n36iZCxw1C 49dQ==
X-Gm-Message-State: AOUpUlENj77RewRfcpJNeeHfyTRQBGeLIdu2pOnqAFOOTsk5bKfUC6ZJ /axXzFg0ab9Z5jbdN3L+21RBod/CZMOL6xnKIC3wdCiT1I8=
X-Google-Smtp-Source: AAOMgpdAMqczriJg8398ZwS/Zn43JlrIZh8xjV4+JSb7CAxni1P+UZT72Gk8Uz4R6dRc9r8uCqwjWhZekU9kTFr6rcI=
X-Received: by 2002:a50:adaa:: with SMTP id a39-v6mr11884222edd.194.1531607061961;  Sat, 14 Jul 2018 15:24:21 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a50:8f45:0:0:0:0:0 with HTTP; Sat, 14 Jul 2018 15:24:01 -0700 (PDT)
X-Originating-IP: [24.86.156.110]
In-Reply-To: <6e28cd00-a18e-cbba-d546-1cb1228178bf@gmail.com>
References: <24301400-0250-e0a4-5152-42f29ad2b2c5@gmail.com> <6e28cd00-a18e-cbba-d546-1cb1228178bf@gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Sat, 14 Jul 2018 15:24:01 -0700
Message-ID: <CAHBU6itfQKRjJU761=o-qbW1kvqwWXmREf7d55jwrNdhciK9mA@mail.gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
Cc: "json@ietf.org" <json@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000dd2f210570fd0ecf"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/8SCgZYMOHpP3qSskYE8XCSl-qpI>
Subject: Re: [Json] JSON support for BigInt in Chrome/V8
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.27
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: Sat, 14 Jul 2018 22:24:26 -0000

--000000000000dd2f210570fd0ecf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hmm, this error makes me smile.  Something being a Bigint is a powerful
signal that any such quantity encoded into a JSON number is a likely source
of interoperability problems, as is made quite clear in RFC8259.

Or am I missing something?

On Sat, Jul 14, 2018 at 1:39 AM, Anders Rundgren <
anders.rundgren.net@gmail.com> wrote:

> var small =3D BigInt("5");
> var big =3D BigInt("5555555555555555555555555500003");
> JSON.stringify([big,small]);
> VM330:1 Uncaught TypeError: Do not know how to serialize a BigInt
>      at JSON.stringify (<anonymous>)
>      at <anonymous>:1:6
>
> JSON Number serialization has apparently reached a new level (of
> confusion).
>
> Personally I don't see the problem.  XML did just fine without hard-coded
> data types.
>
> The JSON type system is basically a relic from JavaScript.  As such it ha=
s
> proved to be quite useful.
> However, when you are outside of that scope, the point with the JSON type
> system gets pretty much zero since you anyway need to map extended types.
>
> Oracle's JSON-B solution which serializes small values as Number and larg=
e
> values as String rather than having a unified serialization based on the
> underlying data type seems like a pretty broken concept although indeed
> fully conforming to the JSON specification. "Like the Devil reads the
> Bible" as we say in Scandinavia :-)
>
> Adding a couple of double quotes is a major problem?  If so, it seems lik=
e
> a way more useful project making quotes optional for keys (named in a
> specific way), like they already are in JavaScript.
>
> Yeah, and of course adding support for comments.
>
> Anders
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>



--=20
- Tim Bray (If you=E2=80=99d like to send me a private message, see
https://keybase.io/timbray)

--000000000000dd2f210570fd0ecf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:small">Hmm=
, this error makes me smile.=C2=A0 Something being a Bigint is a powerful s=
ignal that any such quantity encoded into a JSON number is a likely source =
of interoperability problems, as is made quite clear in RFC8259.</div><div =
class=3D"gmail_default" style=3D"font-size:small"><br></div><div class=3D"g=
mail_default" style=3D"font-size:small">Or am I missing something?</div></d=
iv><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sat, Jul 14=
, 2018 at 1:39 AM, Anders Rundgren <span dir=3D"ltr">&lt;<a href=3D"mailto:=
anders.rundgren.net@gmail.com" target=3D"_blank">anders.rundgren.net@gmail.=
com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">var small =3D B=
igInt(&quot;5&quot;);<br>
var big =3D BigInt(&quot;5555555555555555555555<wbr>555500003&quot;);<br>
JSON.stringify([big,small]);<br>
VM330:1 Uncaught TypeError: Do not know how to serialize a BigInt<br>
=C2=A0=C2=A0=C2=A0=C2=A0 at JSON.stringify (&lt;anonymous&gt;)<br>
=C2=A0=C2=A0=C2=A0=C2=A0 at &lt;anonymous&gt;:1:6<br>
<br>
JSON Number serialization has apparently reached a new level (of confusion)=
.<br>
<br>
Personally I don&#39;t see the problem.=C2=A0 XML did just fine without har=
d-coded data types.<br>
<br>
The JSON type system is basically a relic from JavaScript.=C2=A0 As such it=
 has proved to be quite useful.<br>
However, when you are outside of that scope, the point with the JSON type s=
ystem gets pretty much zero since you anyway need to map extended types.<br=
>
<br>
Oracle&#39;s JSON-B solution which serializes small values as Number and la=
rge values as String rather than having a unified serialization based on th=
e underlying data type seems like a pretty broken concept although indeed f=
ully conforming to the JSON specification. &quot;Like the Devil reads the B=
ible&quot; as we say in Scandinavia :-)<br>
<br>
Adding a couple of double quotes is a major problem?=C2=A0 If so, it seems =
like a way more useful project making quotes optional for keys (named in a =
specific way), like they already are in JavaScript.<br>
<br>
Yeah, and of course adding support for comments.<br>
<br>
Anders<br>
<br>
______________________________<wbr>_________________<br>
json mailing list<br>
<a href=3D"mailto:json@ietf.org" target=3D"_blank">json@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/json" rel=3D"noreferrer" t=
arget=3D"_blank">https://www.ietf.org/mailman/l<wbr>istinfo/json</a><br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><d=
iv>- Tim Bray (If you=E2=80=99d like to send me a private message, see <a h=
ref=3D"https://keybase.io/timbray" target=3D"_blank">https://keybase.io/tim=
bray</a>)</div></div></div>
</div>

--000000000000dd2f210570fd0ecf--


From nobody Sat Jul 14 21:39:31 2018
Return-Path: <anders.rundgren.net@gmail.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 AD3E1130F32 for <json@ietfa.amsl.com>; Sat, 14 Jul 2018 21:39:29 -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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 1jYzPpB67dWH for <json@ietfa.amsl.com>; Sat, 14 Jul 2018 21:39:27 -0700 (PDT)
Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 18431130DC7 for <json@ietf.org>; Sat, 14 Jul 2018 21:39:27 -0700 (PDT)
Received: by mail-wm0-x235.google.com with SMTP id c14-v6so1742934wmb.4 for <json@ietf.org>; Sat, 14 Jul 2018 21:39:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=VkAzYxjJkcbWgh9Dt7HD4aOHc8/gg3eH6uK2DiWj3wk=; b=IjwDU7Z8SZ/Hoz2kxiPkTycdJyXIosEGJIwBCWh4kfmcuma00CewsADi9cNSQO/Cc7 Aic3+YtPko2XV0KjO9/2E5cQ7L8c4CNNIIH8ZyFcRa41tN0hDj2/IlNADBq5E6Rqiqk1 3x1mbr94/sPgf18qouRIi8kJaNYaMrDCQ146kv7gdv6Wf/N+tk0JxcMvSJcPdEwAivKc Aq7XYKF2RxMpOCsYcAC+bdSAd4GOvjtr+EBETOmZhc2kZyeMYSvEVHqYhj8aEbNgT4Bn oH2xgwRn1k9zNeoCtBUS1E90I/gQ/GoiKRlbp679Q5N32LbiSCHwBGSXWqkh+rdZJtAL BQKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VkAzYxjJkcbWgh9Dt7HD4aOHc8/gg3eH6uK2DiWj3wk=; b=rXl0Yl1ZLHdZ1ACQwOMZTsGYTY6CbMtsuWlu37C5S78LJzKhk4lkyzUZgeEaYOsE4Z yQKQ8MEC9xdsshNZuISC/ec8Lshbr5rTsfSKNRDAbIRHlqeSPdqqlWl+we0z+fuzPNlR aL8bOsL3axp4R+InWzqOkhcWY1hiTbzetvtJwzDlW0XMZypfffDB/fzHf8M3EeU8fbYY DOOLmHukYwQkYVwEOoaS4YOrKAh9oSRZJOGOo2ib+Z8T8WqEUbMG3iBfhsl+yB8SKMZZ HyuJT5S6X74LvkTkgjdsqDWy2i7duRVaYwwVfQ1Vsp42UfgadBELI5EPkyXOg/i+2I1x h5Sg==
X-Gm-Message-State: AOUpUlEZZDwmjHMIpdJs2RyA7tpAgmJHJTEZq+o8VdM/NL6JcFdC1jzb yousSXSWNh+FIHmSMjKziVpW1w==
X-Google-Smtp-Source: AAOMgpeMa8fYbIDXY6HhtoXFyYkJCKRtR9Cjjql+1HxNq2cWMh7jCDsSKi3lTTrZ+JZNVHnWozq6wg==
X-Received: by 2002:a1c:e3d5:: with SMTP id a204-v6mr6777354wmh.20.1531629564893;  Sat, 14 Jul 2018 21:39:24 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id t13-v6sm22770808wrr.74.2018.07.14.21.39.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jul 2018 21:39:23 -0700 (PDT)
To: Tim Bray <tbray@textuality.com>
Cc: "json@ietf.org" <json@ietf.org>
References: <24301400-0250-e0a4-5152-42f29ad2b2c5@gmail.com> <6e28cd00-a18e-cbba-d546-1cb1228178bf@gmail.com> <CAHBU6itfQKRjJU761=o-qbW1kvqwWXmREf7d55jwrNdhciK9mA@mail.gmail.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <2d6c5a6d-5a96-72e8-105a-d4780447e375@gmail.com>
Date: Sun, 15 Jul 2018 06:39:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <CAHBU6itfQKRjJU761=o-qbW1kvqwWXmREf7d55jwrNdhciK9mA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/YsMPDy4oauS2yFFJgBuEq9SmmG0>
Subject: Re: [Json] JSON support for BigInt in Chrome/V8
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.27
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: Sun, 15 Jul 2018 04:39:30 -0000

On 2018-07-15 00:24, Tim Bray wrote:
> Hmm, this error makes me smile.  Something being a Bigint is a powerful signal that any such quantity encoded into a JSON number is a likely source of interoperability problems, as is made quite clear in RFC8259.
>
> Or am I missing something?

Well, ECMAScript is probably the only language/platform in existence that cannot JSON-serialize all of its intrinsic data types.

The reason for that is not because it is difficult (application developers have done this since ages back), but because the JSON community lacks direction (standards) for dealing with big numbers.

Anders

>
> On Sat, Jul 14, 2018 at 1:39 AM, Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
>
>     var small = BigInt("5");
>     var big = BigInt("5555555555555555555555555500003");
>     JSON.stringify([big,small]);
>     VM330:1 Uncaught TypeError: Do not know how to serialize a BigInt
>          at JSON.stringify (<anonymous>)
>          at <anonymous>:1:6
>
>     JSON Number serialization has apparently reached a new level (of confusion).
>
>     Personally I don't see the problem.  XML did just fine without hard-coded data types.
>
>     The JSON type system is basically a relic from JavaScript. As such it has proved to be quite useful.
>     However, when you are outside of that scope, the point with the JSON type system gets pretty much zero since you anyway need to map extended types.
>
>     Oracle's JSON-B solution which serializes small values as Number and large values as String rather than having a unified serialization based on the underlying data type seems like a pretty broken concept although indeed fully conforming to the JSON specification. "Like the Devil reads the Bible" as we say in Scandinavia :-)
>
>     Adding a couple of double quotes is a major problem?  If so, it seems like a way more useful project making quotes optional for keys (named in a specific way), like they already are in JavaScript.
>
>     Yeah, and of course adding support for comments.
>
>     Anders
>
>     _______________________________________________
>     json mailing list
>     json@ietf.org <mailto:json@ietf.org>
>     https://www.ietf.org/mailman/listinfo/json <https://www.ietf.org/mailman/listinfo/json>
>
>
>
>
> -- 
> - Tim Bray (If you’d like to send me a private message, see https://keybase.io/timbray)


From nobody Wed Jul 18 02:24:41 2018
Return-Path: <anders.rundgren.net@gmail.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 08B95130DCD for <json@ietfa.amsl.com>; Wed, 18 Jul 2018 02:24:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level: 
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 XPwr-ZFpWD1g for <json@ietfa.amsl.com>; Wed, 18 Jul 2018 02:24:37 -0700 (PDT)
Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2F9D1128BAC for <json@ietf.org>; Wed, 18 Jul 2018 02:24:37 -0700 (PDT)
Received: by mail-wm0-x22b.google.com with SMTP id v25-v6so2074265wmc.0 for <json@ietf.org>; Wed, 18 Jul 2018 02:24:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;  h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cdQqKIKwrC8e7S1/baJ9d4V1l1N443J+JR7oZkks6FM=; b=UUMK1HqHYUGfM+BkKv5ZPH8aMtVCpWse2+U+UchS3FlQiOL+UfgxPOtG5ql00dhvTy nKFs6QKCw6Be+96AKouwtsB09pVV5LC+tnDtPbRdfpD3UUzun/XPPKz+GS03mv8tVgdF 4thgAb8EHUF6WdAwQLDte6weaGJU9n6y7LJAloVXtKaBAwrz9HNLDFaADA8eefkjNNCy yx0JdfT865+5ASkeTXJ0ihNQchTOkrSFI8TQd4kET2VB9l94Kx6wzWckZU1j42Z7xwM+ ABB9CJ5iEhi7qG88kFCQ0jnZHacEGaK9QyR8OUmoSC7du1lBFBsRZFOvv+S7O6bTIkJY Fv3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cdQqKIKwrC8e7S1/baJ9d4V1l1N443J+JR7oZkks6FM=; b=iM2dduppSZeeSOwSfDfX8GwY3PGlUqGzGSI6muUXmVVqkTpa1+cw4xKCdP7aDiFYMB lrOkSKQei6kWLf08aMDN13C/quoQSNcwPYmdmEPze9vqx8P1jsSOYZfZi7kFxyrtGYfP EVMTJch8dCKulzwpKGbEDBJht/bbEFVCQCul9W22zypyHVqK97+Y/9rq5N3FkyhpRZvv Jh9h2zisfBYX3NGvos1wpVmf6OscIHGSxWrvwe0JkVQi00eqB6z7tulf+Bs/6ZZqYK2q wFpU0X49YqB9+hA4atlYGSWDHZRhFPEngP0Amy0a6xUbwmY+yiwtkDdtmL9PWf5ATbOf KP5Q==
X-Gm-Message-State: AOUpUlHpfOGBFEp7YKLVUsoGRqOY6zqRFKRGaIMHHkh7a8z8OP8OC9Tu iU+wwCNWY+awYbTRjETHe6XCKg==
X-Google-Smtp-Source: AAOMgpcfcmaH/S7whTKkAUHC0cYFNeioZ3oPY7a7hlJzpVOuMgyoWfevqkQqLFyTAR+yW+VlcYmBQg==
X-Received: by 2002:a1c:a691:: with SMTP id p139-v6mr1060480wme.42.1531905875088;  Wed, 18 Jul 2018 02:24:35 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id 189-v6sm2810478wmd.17.2018.07.18.02.24.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 02:24:34 -0700 (PDT)
To: Tim Bray <tbray@textuality.com>
Cc: "json@ietf.org" <json@ietf.org>
References: <24301400-0250-e0a4-5152-42f29ad2b2c5@gmail.com> <6e28cd00-a18e-cbba-d546-1cb1228178bf@gmail.com> <CAHBU6itfQKRjJU761=o-qbW1kvqwWXmREf7d55jwrNdhciK9mA@mail.gmail.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <4c43b09e-b173-0d21-3813-b75a44d0850a@gmail.com>
Date: Wed, 18 Jul 2018 11:24:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <CAHBU6itfQKRjJU761=o-qbW1kvqwWXmREf7d55jwrNdhciK9mA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/4XpTCJ9hpBBENwpc_gYQQTny6Fo>
Subject: Re: [Json] JSON support for BigInt in Chrome/V8
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.27
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, 18 Jul 2018 09:24:40 -0000

On 2018-07-15 00:24, Tim Bray wrote:
> Hmm, this error makes me smile.  

There will be more things to smile about; a bunch of folks are seriously proposing taking JavaScript's recent 'n' notation to JSON {"big":6565656565656565656565656565n}


> Something being a Bigint is a powerful signal that any such quantity  > encoded into a JSON number is a likely source of interoperability problems,
> as is made quite clear in RFC8259.

Well, it is rather treated like a "footnote" by most implementers since there is no RECOMMENDED, MAY, SHOULD or MUST there.

Anders

> 
> Or am I missing something?



> 
> On Sat, Jul 14, 2018 at 1:39 AM, Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
> 
>     var small = BigInt("5");
>     var big = BigInt("5555555555555555555555555500003");
>     JSON.stringify([big,small]);
>     VM330:1 Uncaught TypeError: Do not know how to serialize a BigInt
>           at JSON.stringify (<anonymous>)
>           at <anonymous>:1:6
> 
>     JSON Number serialization has apparently reached a new level (of confusion).
> 
>     Personally I don't see the problem.  XML did just fine without hard-coded data types.
> 
>     The JSON type system is basically a relic from JavaScript.  As such it has proved to be quite useful.
>     However, when you are outside of that scope, the point with the JSON type system gets pretty much zero since you anyway need to map extended types.
> 
>     Oracle's JSON-B solution which serializes small values as Number and large values as String rather than having a unified serialization based on the underlying data type seems like a pretty broken concept although indeed fully conforming to the JSON specification. "Like the Devil reads the Bible" as we say in Scandinavia :-)
> 
>     Adding a couple of double quotes is a major problem?  If so, it seems like a way more useful project making quotes optional for keys (named in a specific way), like they already are in JavaScript.
> 
>     Yeah, and of course adding support for comments.
> 
>     Anders
> 
>     _______________________________________________
>     json mailing list
>     json@ietf.org <mailto:json@ietf.org>
>     https://www.ietf.org/mailman/listinfo/json <https://www.ietf.org/mailman/listinfo/json>
> 
> 
> 
> 
> -- 
> - Tim Bray (If you’d like to send me a private message, see https://keybase.io/timbray)

