Re: [Json] Consensus call: establishing name equality

Jacob Davies <jacob@well.com> Fri, 21 June 2013 23:55 UTC

Return-Path: <cromis@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 3AE0321F9EF3 for <json@ietfa.amsl.com>; Fri, 21 Jun 2013 16:55:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.885
X-Spam-Level:
X-Spam-Status: No, score=-1.885 tagged_above=-999 required=5 tests=[AWL=0.093, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CXgnH8MXve9G for <json@ietfa.amsl.com>; Fri, 21 Jun 2013 16:55:08 -0700 (PDT)
Received: from mail-qc0-x229.google.com (mail-qc0-x229.google.com [IPv6:2607:f8b0:400d:c01::229]) by ietfa.amsl.com (Postfix) with ESMTP id 7CCB921F9EE0 for <json@ietf.org>; Fri, 21 Jun 2013 16:55:08 -0700 (PDT)
Received: by mail-qc0-f169.google.com with SMTP id c10so5171679qcz.28 for <json@ietf.org>; Fri, 21 Jun 2013 16:55:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=b6iD5yCRbK4KxEeUWsPzfdvhcdN8P4yayknsUyjpK0g=; b=ZZrw3Z6YOSfrSFElEklwMLQvrg7J+DDiXo76jI8+MbGA6M4fUDtP63EwncSfghcnSQ rUXrkS/vTgsqWf29eeaz/rlSqnlcAcz8dcAE6pgoLK7l8yQkooAXSNKRWlaguVpPqYBb m3lI0XCi1PhRBUTIBw6yyZuc32ZHdQUYRJBJxTGdU74sEJKvcBKP+DZp5LgxI7UJS836 eRbIyzUP3NQwuXovCBpqptrG9fG03CR/X9fmJWHhSCGVjwC0MWR1UA3+2yaBbY7AVbw1 kBYTu7wAyK/EPlRIMFvHuhnU7Yw6tOBuUEILWfNEY2Jy7heqTg8x0RJM8wPEYmciQPpx KpfQ==
X-Received: by 10.49.116.79 with SMTP id ju15mr17231747qeb.2.1371858907879; Fri, 21 Jun 2013 16:55:07 -0700 (PDT)
MIME-Version: 1.0
Sender: cromis@gmail.com
Received: by 10.49.76.42 with HTTP; Fri, 21 Jun 2013 16:54:47 -0700 (PDT)
In-Reply-To: <CAHBU6is5OVK6jVB_=Lu1W0RPEF1+f0wG1GZU44OQ1vbgP8vGgw@mail.gmail.com>
References: <DB211AD8-6BBA-4D95-9B6E-F00AA69E584E@vpnc.org> <6BCAAC4F-2B45-43BA-A40B-96F3369A5851@tzi.org> <CAO1wJ5SzsOvj2voaeM83G2FxmEwBSREHP5YtE5T8G-mgoM4jNw@mail.gmail.com> <CAHBU6iv8wGJQGpsswSf0GgkN6uQAXP8XFRbabjzWnNSJoifQzw@mail.gmail.com> <CAO1wJ5S7gvqJUydhfUkweffOxm+DcnEgZVciUVvnzj2gHYrAow@mail.gmail.com> <CAHBU6is5OVK6jVB_=Lu1W0RPEF1+f0wG1GZU44OQ1vbgP8vGgw@mail.gmail.com>
From: Jacob Davies <jacob@well.com>
Date: Fri, 21 Jun 2013 16:54:47 -0700
X-Google-Sender-Auth: _LTzDGEpOW9mYtYTJa_iPrWncDM
Message-ID: <CAO1wJ5TV1f0G-WHKnO33TAjSVa2v77vm2kX=otTycyUFZf66pw@mail.gmail.com>
To: Tim Bray <tbray@textuality.com>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Cc: Carsten Bormann <cabo@tzi.org>, Paul Hoffman <paul.hoffman@vpnc.org>, JSON WG <json@ietf.org>
Subject: Re: [Json] Consensus call: establishing name equality
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: <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: Fri, 21 Jun 2013 23:55:09 -0000

Well, even given those givens, what about this:

http://www.unicode.org/versions/Unicode6.2.0/ch03.pdf
>From Section 3.2:

C6 A process shall not assume that the interpretations of two
canonical-equivalent character sequences are distinct.

• The implications of this conformance clause are twofold. First, a
process is never required to give different interpretations to two
different, but canonical-equivalent character sequences. Second, no
process can assume that another process will make a distinction
between two different, but canonical-equivalent character sequences.

• Ideally, an implementation would always interpret two
canonical-equivalent character sequences identically. There are
practical circumstances under which implementations may reasonably
distinguish them.

---

That argues pretty strongly against specifying name normalization
behavior for implementations, I would think.

Back on the point of what this is for: yes, JSON names in objects are
likely used as hash keys. But the specification itself does not
*require* that they be unique (it advises, yes) and therefore no
absolutely unambiguous definition of what "unique" means is necessary
within the specification.

The specification is already clear that a name is a string, and that
backslashed characters in JSON-encoded strings are to be interpreted
in certain ways to produce a native string; how to hash and compare
strings is really a platform function, not a decoding function. It
seems unnecessary to say that the four given strings for the slash
character are equivalent: if you have followed the instructions on
interpreting strings, they already will be by the time you get around
to comparing them.



On Fri, Jun 21, 2013 at 4:21 PM, Tim Bray <tbray@textuality.com> wrote:
>
> On Fri, Jun 21, 2013 at 4:15 PM, Jacob Davies <jacob@well.com> wrote:
>>
>>
>> Is this definition of equality needed elsewhere in the document though? Standing alone it seems a little odd - there's no discussion how to compare two numbers, two objects, or two lists for equality, so why are strings-used-for-names special?
>
>
> Because
> - We talk about duplicates so it's important to define what duplicate means
> - they are, in effect, hash-table keys, so comparison really matters
>