Re: [Json] What is a JSON-text? [REVISITED]

Nico Williams <nico@cryptonector.com> Thu, 03 October 2013 18:34 UTC

Return-Path: <nico@cryptonector.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 4B7D121E80DE for <json@ietfa.amsl.com>; Thu, 3 Oct 2013 11:34:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 NxizsYIYSlbP for <json@ietfa.amsl.com>; Thu, 3 Oct 2013 11:33:57 -0700 (PDT)
Received: from homiemail-a96.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145]) by ietfa.amsl.com (Postfix) with ESMTP id BCC4F21F8D62 for <json@ietf.org>; Thu, 3 Oct 2013 11:24:18 -0700 (PDT)
Received: from homiemail-a96.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a96.g.dreamhost.com (Postfix) with ESMTP id 70B6E3B8076 for <json@ietf.org>; Thu, 3 Oct 2013 11:24:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=29s4JY1b9IjC7P6RoDem 57wgdvs=; b=xF+eQyp2gyID0cxfO502Ehr6mMFd+BbdEWGDbfAbfJt9BqAaJsyu /3DBG0k1aQZsAxhp/8F8yZtLRNpCrvzBZWEP+kR/3wdjdZhPFSrwNLaPMC4W/tx2 j4co93sgfyxln6JPxzzXLUTiWtcj3ZhGKd/wC4f5cO9TbmEu2l0OPWU=
Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a96.g.dreamhost.com (Postfix) with ESMTPSA id 18FBE3B8077 for <json@ietf.org>; Thu, 3 Oct 2013 11:24:17 -0700 (PDT)
Received: by mail-wg0-f49.google.com with SMTP id l18so2887875wgh.28 for <json@ietf.org>; Thu, 03 Oct 2013 11:24:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1w/vwYB5LTZ5G8ifUD7amragrRzaX0NgUxDr7e0jpXo=; b=i86kjjn/G1F7a1zVxks36bjR4/JHeqNKWofSC7wU7uwDa2p0ML3DTqTQt5u2JRi7wo 0CWfhTJxQpJiBIJ5Evfaw9IKm32rrgVnwzsom4WcDVRabTCQBoBkbFxE+M1mKhbAo+v+ rg8Y1cv0nq8BMZj54FDUexqrfD89TzUJwkvEXII1BrV2TNUfqcbgc/UT1TcbrICUqNBb MmIKZancZm5WsUW4p5hlsc0F+TCd7bvDXUrM02iO8fejgImRx5Kzlsn5YA59EOoarW+b e7WjtHT8vIARa9WV85YVjq+7UeWiCHUgCSeODr5Ks27H1UDsYpD4M5XxZ1dy+W4Xzp3h eVzQ==
MIME-Version: 1.0
X-Received: by 10.194.172.103 with SMTP id bb7mr2417160wjc.69.1380824655807; Thu, 03 Oct 2013 11:24:15 -0700 (PDT)
Received: by 10.216.165.5 with HTTP; Thu, 3 Oct 2013 11:24:15 -0700 (PDT)
In-Reply-To: <524DAEBF.1020509@drees.name>
References: <BF7E36B9C495A6468E8EC573603ED9411EF2B583@xmb-aln-x11.cisco.com> <CAHBU6iv7gT8nebFnz_mHQVZ3z8Kz+Pb8VRrSkMf44QRqWL8QjA@mail.gmail.com> <524DAEBF.1020509@drees.name>
Date: Thu, 03 Oct 2013 13:24:15 -0500
Message-ID: <CAK3OfOhRCCfNWHD-qSXOmswE7DL+QFefE_pvQO5g24NJ9q07hg@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: "stefan@drees.name" <stefan@drees.name>
Content-Type: text/plain; charset="UTF-8"
Cc: "Matt Miller (mamille2)" <mamille2@cisco.com>, Tim Bray <tbray@textuality.com>, JSON WG <json@ietf.org>
Subject: Re: [Json] What is a JSON-text? [REVISITED]
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: Thu, 03 Oct 2013 18:34:09 -0000

On Thu, Oct 3, 2013 at 12:51 PM, Stefan Drees <stefan@drees.name> wrote:
> Me also very strongly against "non-container" top-level entities.
>
> Additional rationale:
> - Add two bytes to wrap the serialized/transported value into array or
>   say six bytes and use eg. {"d":my_top_level_value} should be cheap
>   for the benefit of producing a JSON-text.

That's very lame; see below for rationale.

> Even if value is king, values like strings, numbers, true, false or null
> just wrapped into "no clothes" make me wonder why one would serialize (or
> forward) them as advertised JSON-text in the first place.

Because JSON isn't always used to transport values across networks
(where it'd be silly to send scalar values with all the overheade of
HTTP and TCP/IP, say).  JSON is often used for interop between local
components, where the overhead that would make laughable the use of
scalar values at the top-level just doesn't apply.  E.g., the Python
bindings to libjq.  Indeed, here your suggestion that I call "lame"
*adds* undesirable overhead.

"But JSON is an interchange format for networking" is not a good
answer to that.  It's a good interchange format, full stop.  The train
with JSON used for local interchange purposes left the station.  This
is why parsers commonly have an option to accept scalar values at the
top-level.

Nico
--