Re: [Json] JSON for Internet messages

Tim Bray <tbray@textuality.com> Wed, 03 July 2013 17:31 UTC

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 D84B621F9A05 for <json@ietfa.amsl.com>; Wed, 3 Jul 2013 10:31:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.976
X-Spam-Level:
X-Spam-Status: No, score=-2.976 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
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 tI0owy9GQd0E for <json@ietfa.amsl.com>; Wed, 3 Jul 2013 10:31:26 -0700 (PDT)
Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by ietfa.amsl.com (Postfix) with ESMTP id ECB0B21F9A29 for <json@ietf.org>; Wed, 3 Jul 2013 10:31:22 -0700 (PDT)
Received: by mail-ve0-f173.google.com with SMTP id jw11so363991veb.32 for <json@ietf.org>; Wed, 03 Jul 2013 10:31:22 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=OAe4oF7XzHBVx5xwEMNiE38gVru3MkGIv50IsAh8qeo=; b=flIhCsZPCd/PPc5782XGkM60HTSWbTu0i0qfDZjkjTXzbjPmT859z/Pw9UjYyZGnFu Tcve1UfWwRPmhac6w5vYNPJXHxouG6XiihpRU0jGtkNGjcfVU74u4sg5sfYOjh79nocQ QH26rH/GrxXAz/q5Drx61ppNNsAup0gg9eY7c94HXhIuOTBAaf8kf7Y4OPgtmYIDF+BJ oXGeE0Z7A/fqYkf/Sm+9PhUk+uDiD63JLH9ZukmHnnz3p+t0lRmapU6h/y6otI3WtAHl hUjCHdiPtAvLerVKL14Ehh1eSWLK0nH8WNp7kWCYG+F5Y0MXIdzHGHwYWBGqfbP/9vfc EGGg==
MIME-Version: 1.0
X-Received: by 10.220.41.77 with SMTP id n13mr597945vce.36.1372872682226; Wed, 03 Jul 2013 10:31:22 -0700 (PDT)
Received: by 10.220.219.200 with HTTP; Wed, 3 Jul 2013 10:31:22 -0700 (PDT)
X-Originating-IP: [209.121.225.216]
In-Reply-To: <20130703171547.GH32044@mercury.ccil.org>
References: <CAHBU6it55C5vCNLBki1LvjpWd4fANY8LdC4fzxj3a2G_+q=qSA@mail.gmail.com> <20130703171547.GH32044@mercury.ccil.org>
Date: Wed, 03 Jul 2013 10:31:22 -0700
Message-ID: <CAHBU6ist_Zq=-jY3C2C4m7EiJTv6JgHOCxGntvpg-jgKQ1D04g@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: John Cowan <cowan@mercury.ccil.org>
Content-Type: multipart/alternative; boundary="047d7b3a90ee8bd75604e09ed4ab"
X-Gm-Message-State: ALoCoQkqHVEWqhEkgISiJ3Hb5+5+wcSImYmzJLO+KusLpl6fftvps94tve4E0o5NX++WMSEj3mpc
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] JSON for Internet messages
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: Wed, 03 Jul 2013 17:31:32 -0000

On Wed, Jul 3, 2013 at 10:15 AM, John Cowan <cowan@mercury.ccil.org> wrote:

> Tim Bray scripsit:
>


> > Also, I’ve never encountered a scenario where the messages were of
> > sufficient size that anyone gave a rat’s ass about streaming.
>
> Well, at least eight programmers have taken the trouble to write
> such parsers


Fair enough. If they can’t write them in such a way as to avoid duplicates,
they are NOT USABLE for application-level message passing, because the only
use for JSON objects is sending a hash-table (or equivalent) from my
computer to a hash-table (or equivalent) on yours, and if there are dupes,
that's either a serious bug or a malicious attack on, for example, a JOSE
header where they’re trying to fake out the algorithm selection. So parsers
that potentially emit dupes can’t comply with the RFC that I want to
exist.  Acceptable cost.



> > - All JSON messages MUST be encoded in valid UTF-8.
> > - All numbers MUST be of precision < 2**53 (use strings for your big
> crypto
> > numbers)
>
> Better: All numbers MUST be representable as IEEE 754:2008 binary
> 64-bit floats.
>

I think my expression of the constraint is more readable, but I agree that
yours is isomorphic.


>
> > - All JSON objects MUST have unique keys
> > - All JSON messages MUST be either arrays or objects
> > - Software receiving something violating any of these MUSTs has
> encountered
> > conclusive evidence of serious upstream breakage and MUST NOT trust the
> > contents nor act upon them.
>
> The trouble with all this is that They Break Data.


I care -Inf about this.  In my application domain, we cook these up in
memory, we send them, we unpack them at the other end.   I agree, that if
if we impose a new set of rules in a new RFC, previously-existing JSON
might not pass muster as “Internet JSON” or whatever we choose to call it.
It’s still JSON Classic.  Fair trade-off.  -T