Re: [Json] serializing sequences of JSON values

Phillip Hallam-Baker <hallam@gmail.com> Mon, 10 March 2014 20:10 UTC

Return-Path: <hallam@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1CABC1A02E6 for <json@ietfa.amsl.com>; Mon, 10 Mar 2014 13:10:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hm--8-T_SQaS for <json@ietfa.amsl.com>; Mon, 10 Mar 2014 13:10:00 -0700 (PDT)
Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) by ietfa.amsl.com (Postfix) with ESMTP id A7B041A024B for <json@ietf.org>; Mon, 10 Mar 2014 13:09:59 -0700 (PDT)
Received: by mail-la0-f46.google.com with SMTP id hr17so4977368lab.19 for <json@ietf.org>; Mon, 10 Mar 2014 13:09:53 -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=q2MrgwEJA8Ozzw6V0kwlbB6eRSYfk1pjPvBOk9knh6Q=; b=R64m9AOI/4rOqxHLYvjx08Y9i+1eZ2uY+X2mqk8LM1d3+149e2U5Qu138VP55Z1bqa SBLdPDIvBcezbKfavkh1IB4WnDmWVtVLw/M7dqQYQjUZWm0CsyyqSs4FWx5sjl/nDJLO 175Fnz3sjcoGRi/KzQH++c3cJJjBg0rPuvD1WlaSuTcG23SOabK27kz9NB2eOcNI5Q2K 0Dvj5LysQXNsxSPeJBVkQ9zKhWEntr2TRc2K+LIbbCsls57ARB/LrrxRBtz2w8jIqgQG Q7CG1VqHvVEZfM4jpipHoEvrmOVct2JvKOwNnp0wgy0zYSaIyR1Te4ZgM7ZtHQjQwRkb a3iA==
MIME-Version: 1.0
X-Received: by 10.152.234.130 with SMTP id ue2mr24577331lac.0.1394482193559; Mon, 10 Mar 2014 13:09:53 -0700 (PDT)
Received: by 10.112.37.168 with HTTP; Mon, 10 Mar 2014 13:09:53 -0700 (PDT)
In-Reply-To: <em2c025504-6532-4513-a339-3d71c4cdfbda@helsinki>
References: <CAMm+Lwg9ZCBQ8QsAE4+8rbywFUPpB9tEDzdb3C34J7cBfqu_Qw@mail.gmail.com> <em2c025504-6532-4513-a339-3d71c4cdfbda@helsinki>
Date: Mon, 10 Mar 2014 16:09:53 -0400
Message-ID: <CAMm+Lwj4XzdRzUJ4tNvipFbPwX4dFizqoHtTgrOw98gFGFH0rg@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: "Paul E. Jones" <paulej@packetizer.com>
Content-Type: multipart/alternative; boundary=001a113484bccaf50004f4462f6c
Archived-At: http://mailarchive.ietf.org/arch/msg/json/_yOE07jtaexuggQsh25UuowUZGs
X-Mailman-Approved-At: Mon, 10 Mar 2014 13:10:32 -0700
Cc: Tim Bray <tbray@textuality.com>, Pete Resnick <presnick@qti.qualcomm.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, Paul Hoffman <paul.hoffman@vpnc.org>, Larry Masinter <masinter@adobe.com>, "json@ietf.org" <json@ietf.org>, Jacob Davies <jacob@well.com>, "Joe Hildebrand \(jhildebr\)" <jhildebr@cisco.com>, "Matt Miller \(mamille2\)" <mamille2@cisco.com>, Nico Williams <nico@cryptonector.com>, Barry Leiba <barryleiba@computer.org>, "rfc7158@schmorp.de" <rfc7158@schmorp.de>
Subject: Re: [Json] serializing sequences of JSON values
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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: Mon, 10 Mar 2014 20:10:02 -0000

On Mon, Mar 10, 2014 at 3:35 PM, Paul E. Jones <paulej@packetizer.com>wrote;wrote:

>  Why would sequences of objects not be preferred for logging.  If I were
> writing to a log file, that would definitely be my preference.  One reason
> is that log files tend to have a number of pieces of information to convey
> per entry, thus they can fit well into a JSON object (even if it is a
> simple object).
>

I can't see why I would log sequences of anything other than sequences of
objects. But the choice here is between one of the following forms:

A) [ {..}, {..}, {..} ]
B) {..}, {..}, {..}
C) {..} {..} {..}

Form A is not acceptable as it makes adding data to an append-only log much
more complex. We can't just rely on the O/S atomic append operation. We
have to manage locks etc. That is very very expensive when more than one
process is allowed to write.

Forms B and C are equally acceptable but C looks more like a legal JSON
value.

To parse B I have to write a separate parser, to parse C I use my existing
JSON parser but start it in a different production. Instead of the top
level production being 'object', the top level production is
'array-entries'.


-- 
Website: http://hallambaker.com/