Re: [Json] Allow any JSON value at the top level

Tatu Saloranta <tsaloranta@gmail.com> Tue, 11 June 2013 18:41 UTC

Return-Path: <tsaloranta@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 9383521F94E1 for <json@ietfa.amsl.com>; Tue, 11 Jun 2013 11:41:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.473
X-Spam-Level:
X-Spam-Status: No, score=-2.473 tagged_above=-999 required=5 tests=[AWL=0.126, BAYES_00=-2.599, HTML_MESSAGE=0.001, 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 eW0XNJp8qHDn for <json@ietfa.amsl.com>; Tue, 11 Jun 2013 11:41:17 -0700 (PDT)
Received: from mail-we0-x22c.google.com (mail-we0-x22c.google.com [IPv6:2a00:1450:400c:c03::22c]) by ietfa.amsl.com (Postfix) with ESMTP id 95E3D21F9476 for <json@ietf.org>; Tue, 11 Jun 2013 11:41:16 -0700 (PDT)
Received: by mail-we0-f172.google.com with SMTP id q56so6262785wes.31 for <json@ietf.org>; Tue, 11 Jun 2013 11:41:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VxYsvajAyXJopJB/ElPS2bqOgIz+Egzm7uyquIJ0AUY=; b=s3OXwEnJehodINIxgQsYRUEXCOSGnWZekWXbjk6ZmNr10y3v8mwAHzjEYP8Ut97nYF giEgop8e7nUyxC8ytmtsdi2+hVCoAJNKV/69nfrS1omwZYoM6wZ69RU3UYvrcz9mXdIP 3yl8UgjaI2JIsoFku9fbEIXO3/77tSQM7zG5c7ltSjw6M/ODOpofOfR8a7EoyRVL7ZiM m2IOP/9XxvNfXvo+1ytPZHc8WcoYxM4AbtCBSrY+K9AFGsSKW/8MtFF6ZJ0xUJBm2uw/ OZSN3FexgxMDQQk7t1Zv8oJcsiwUNi2cZau+nAjNcT/j2YcFeTLpmOj+DsRvncXN9gLa XFjw==
MIME-Version: 1.0
X-Received: by 10.180.211.233 with SMTP id nf9mr1950273wic.55.1370976075738; Tue, 11 Jun 2013 11:41:15 -0700 (PDT)
Received: by 10.227.72.74 with HTTP; Tue, 11 Jun 2013 11:41:15 -0700 (PDT)
In-Reply-To: <DA9A52D2-6956-4E6C-AE96-7F1C05AE3E57@tzi.org>
References: <255B9BB34FB7D647A506DC292726F6E1151B21F9A9@WSMSG3153V.srv.dir.telstra.com> <A2D3D8F3-1EB3-4CD6-A331-4EDCDB7F9798@tzi.org> <CAGrxA27z-tqgKWcyKNc7ojoUi3Z==hReETrddfYMVxTfVEAhhQ@mail.gmail.com> <DA9A52D2-6956-4E6C-AE96-7F1C05AE3E57@tzi.org>
Date: Tue, 11 Jun 2013 11:41:15 -0700
Message-ID: <CAGrxA278XnWEAnJ3WT2YHdYixcvHDPzx7365K6WCWh6ZtLiECA@mail.gmail.com>
From: Tatu Saloranta <tsaloranta@gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Content-Type: multipart/alternative; boundary=001a11c338d0fda21204dee53dc9
Cc: "Manger, James H" <James.H.Manger@team.telstra.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Allow any JSON value at the top level
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: Tue, 11 Jun 2013 18:41:17 -0000

On Tue, Jun 11, 2013 at 2:25 AM, Carsten Bormann <cabo@tzi.org> wrote:

> On Jun 7, 2013, at 19:54, Tatu Saloranta <tsaloranta@gmail.com> wrote:
>
> >> Apart from the (intellectually nicely challenging, but practically
> irrelevant) auto-detection thing,
> >
> > Irrelevant based on what? I thought this is what any half-decent JSON
> parser did; unless platform does not expose byte sequence as input, case
> for some scripting languages.
> > I have written multiple parsers (json, xml) that do just this, and know
> that others exist as well.
>
> It is true that there are parsers that implement autodetection.
> Lots of code is written that is then never exercised.
>

If by lots of code you mean "less than 100 lines", yes.


>
> > I don't know what leads to assumption of irrelevancy here, and it should
> be fully spelled out.
>
> This is irrelevant in practice as JSON is used with UTF-8 in practice.
>

My main concern is with UTF-16. My understanding is that for "Big 5"
languages its use make sense, from efficiency perspective. I do not have
data on this; in XML space document test sets had non-trivial amount of
content in various encodings.

If UTF-16 is not widely used then I can see why this would be considered of
little significance.


> The main job that the text in section 3 seems to do is to convince people
> not to send a BOM in front of their UTF-8 JSON.  Now that is a good
> thing...  Unfortunately, some JSON parsers have been "fixed" to accept BOMs.
>
>
Yes. That takes about 50 more lines of code to add, to work around oddities
of generators by a certain big Redmond-based software company.

-+ Tatu +-