Re: [Json] About JSON equality

Francis Galiegue <fgaliegue@gmail.com> Tue, 19 February 2013 23:19 UTC

Return-Path: <fgaliegue@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 820DC21F8AD8 for <json@ietfa.amsl.com>; Tue, 19 Feb 2013 15:19:55 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.474
X-Spam-Level:
X-Spam-Status: No, score=-3.474 tagged_above=-999 required=5 tests=[AWL=0.125, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fKU17lKwipFX for <json@ietfa.amsl.com>; Tue, 19 Feb 2013 15:19:54 -0800 (PST)
Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) by ietfa.amsl.com (Postfix) with ESMTP id 8D7D121F8952 for <json@ietf.org>; Tue, 19 Feb 2013 15:19:54 -0800 (PST)
Received: by mail-ee0-f47.google.com with SMTP id e52so3604910eek.6 for <json@ietf.org>; Tue, 19 Feb 2013 15:19:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=aIXa3J8XTWXShwzIMXgnG/2YDbEOLuPDclXx8mFE30U=; b=ri73tVCrwlVddHGQKGUipcQrd42E8oHow14A3pGujD7kXkvz0aEVqxpOBtwYw7ugJd QuG8zdBd0joykER3tlNgJVNkhEUbx7dzJHMb9/oIquapDy+n5CzU6xu5TLIExBBVIbvL ZkClxL9roLCQS1XBYExxE2idAzpPumQIXUAF4gSpJiVPtwcBOuygm/PAvnnfzQxEg/dQ /hpwA+JsOmTOOPZDegUMCspxDXId+jJFQWKZ33AL6lCxko01RZaPOCtIjbKbSgm1YmUR 9N9SILKWYkzSQlfYhkarmhbEUHLgozGo51hGuJ4kAWF5n/khTvmLMfnpYFUn4yoVrK93 hHEg==
MIME-Version: 1.0
X-Received: by 10.14.183.67 with SMTP id p43mr61817876eem.10.1361315993780; Tue, 19 Feb 2013 15:19:53 -0800 (PST)
Received: by 10.14.1.7 with HTTP; Tue, 19 Feb 2013 15:19:53 -0800 (PST)
In-Reply-To: <A723FC6ECC552A4D8C8249D9E07425A70F8980FE@xmb-rcd-x10.cisco.com>
References: <CALcybBAqONQ+UAzcnJFkphsQk=qSpLwdEoYR-6YETY2GP_EN6w@mail.gmail.com> <A723FC6ECC552A4D8C8249D9E07425A70F8980FE@xmb-rcd-x10.cisco.com>
Date: Wed, 20 Feb 2013 00:19:53 +0100
Message-ID: <CALcybBCaLQcrE8hYdTgnmthcc884JMyBA+V4kS+SKONt4_xAfg@mail.gmail.com>
From: Francis Galiegue <fgaliegue@gmail.com>
To: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
Content-Type: text/plain; charset="UTF-8"
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] About JSON equality
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Discussion related to JavaScript Object Notation \(JSON\)." <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/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: Tue, 19 Feb 2013 23:19:55 -0000

On Wed, Feb 20, 2013 at 12:10 AM, Joe Hildebrand (jhildebr)
<jhildebr@cisco.com> wrote:
> Are you proposing that this be added to 4627bis, or that it be in a
> separate document?
>

That is what I am asking. I believe the more JSON is used, the more
people will want to "compare" JSON values, whatever they may be (and a
hint again: please make RFC 4627bis allow to transfer _any_ JSON
value, not just arrays and objects).

There are two problems here: strings and numbers.

For strings, Unicode code points and their representation in whatever
encoding should be considered equal, and parsers should be able to
handle whatever they are fed with.

For numbers, there is the much more annoying limitation that all
humanly representable numbers just cannot be represented in
programming languages, and that JSON (at least to my eyes) should not
feel compelled to represent NaN (since it is, essentially, language
dependent) nor infinity (since it is an abstract concept and not even
a number).

But both of these problems can be at least formulated as being present
-- the JSON Schema validation spec does. The real question becomes,
will future uses of JSON rely on value equality?

-- 
Francis Galiegue, fgaliegue@gmail.com
Try out your JSON Schemas: http://json-schema-validator.herokuapp.com