Re: [Json] Regarding JSON text sequence ambiguities (Re: serializing sequences of JSON values)

Nico Williams <> Tue, 11 March 2014 17:10 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id AC8001A0640 for <>; Tue, 11 Mar 2014 10:10:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.378
X-Spam-Status: No, score=-1.378 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id TycqlfRNQWOw for <>; Tue, 11 Mar 2014 10:10:26 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 9DFD91A0481 for <>; Tue, 11 Mar 2014 10:10:26 -0700 (PDT)
Received: from (unknown []) by (Postfix) with ESMTP id 150E628420 for <>; Tue, 11 Mar 2014 10:10:21 -0700 (PDT)
Received: from (localhost []) by (Postfix) with ESMTP id C25FD21DE6A for <>; Tue, 11 Mar 2014 10:10:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type:content-transfer-encoding; s=; bh=X3UJsO4jaNknF2jduwfVUh+quEg=; b=XlJ4bmnUDUd MMck8ln+Thp+k2o63pc8MVUj4kBTbxxyfzkPDOv/TjXwwwQ06mKxnhTSAkwn/rNW pn9KId2vpqbPyU1heaPFJrPLsZdZIzNIaCyKj3jDvGgZRUgcwjX43wXbeQ6/4pXS Vfo2R+uHkcvjJ2UH6ZPK1wNdDIMi5FXo=
Received: from ( []) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 6506521DE58 for <>; Tue, 11 Mar 2014 10:10:20 -0700 (PDT)
Received: by with SMTP id w61so10442006wes.1 for <>; Tue, 11 Mar 2014 10:10:19 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=v1QjCEcX0WDKE8S93MQiw6ZcqXNymom+qPQ01xNBsoM=; b=cQ67esC8jze3p43Ji6QJEOmazc7/7ZrVHiUL6ITyjvox6gI0Dd0T3zqzjAmz+GhWXV E1YMJPfhxW8ehbfAHW7WqCVIT+DgwK8acuagwvF43gkq5D8IitiHKkLb9kMBseNmXmgm BLLiEXAiLRW8o+HQkVPQb9esJIElUpdlGSFJm7GOP9gGJe5HHrYr8p7t8lXDSVOP2t2b ePRCJFghv4GOcfyo8fle/nfFeLLNMfyUt1mD5BIjDs/hKNzmqAsv9aiH4iI1JQ3tDRXZ p1yxJW2TKegU1/7CK798l38v+Km+JdpMUlyFexe956JdQmMtLH+nnuoofi0pR5H8tOqr o1pw==
MIME-Version: 1.0
X-Received: by with SMTP id l15mr14982510wjq.40.1394557819345; Tue, 11 Mar 2014 10:10:19 -0700 (PDT)
Received: by with HTTP; Tue, 11 Mar 2014 10:10:19 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <> <>
Date: Tue, 11 Mar 2014 12:10:19 -0500
Message-ID: <>
From: Nico Williams <>
To: Tim Bray <>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: "" <>, Matthew Morley <>, Paul Hoffman <>
Subject: Re: [Json] Regarding JSON text sequence ambiguities (Re: serializing sequences of JSON values)
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 11 Mar 2014 17:10:27 -0000

On Tue, Mar 11, 2014 at 11:48 AM, Tim Bray <> wrote:
> Heh, I wonder if there’d be any chance of getting consensus.  I can’t
> imagine ever using anything but Object Object Object with optional
> whitespace separator; unless we all agree on that going in I’d pessimistic
> about anyone convincing anyone else...

As I recall you opposed as strenuously the top-level value type change
in the RFC you edited.  And yet look where we are...

Alright, let's talk examples.  Suppose I have a JSON text sequence,
all of them objects.  And I want to extract a number from each, to be
output in a sequence, natch.  Why would I?  Because I'm processing
data in a sequence of filters, and one stage will be applying some
statistical analysis to just those numbers.  What's wrong with that?
It's perfectly natural to do that with -you see it coming, I know- jq.

Anyone who is adept/experienced with the Unix shell pipeline concept
will tend to like this approach.  (It's one reason I like jq.)

But more importantly, what do you care?!  Why should your lack of a
use for anything other than a sequence of objects constrain me to the
same?  On what principle?  Once you agree to the optional whitespace
and make it required when following an otherwise ambiguous value
(true, false, null, numeric), we're there, we have agreement.  You can
stick to object sequences, and I can use sequences of numbers if it be
convenient for me.

Perhaps you might say that the separator whitespace ought to be
optional always, and that fundamentally limits sequences to arrays,
objects, and strings.  That'd be a principle we could argue about
(whether to adopt it or not), but even that wouldn't justify limiting
sequences to objects.

I'm struggling to think of a principle that would justify your
favorite constraint, and I can't think of one.  What am I missing?