Re: [Json] Seeking more input on draft-ietf-json-text-sequence

Stefan Drees <stefan@drees.name> Sun, 18 May 2014 09:48 UTC

Return-Path: <stefan@drees.name>
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 C80391A02C0 for <json@ietfa.amsl.com>; Sun, 18 May 2014 02:48:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.55
X-Spam-Level:
X-Spam-Status: No, score=-1.55 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
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 StO1r82soY_w for <json@ietfa.amsl.com>; Sun, 18 May 2014 02:48:13 -0700 (PDT)
Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA256 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 17C461A02BC for <json@ietf.org>; Sun, 18 May 2014 02:48:13 -0700 (PDT)
Received: from newyork.local.box ([80.187.96.163]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MVu1U-1WF5oA0zhQ-00X4Pv for <json@ietf.org>; Sun, 18 May 2014 11:48:10 +0200
Message-ID: <537881D9.3080001@drees.name>
Date: Sun, 18 May 2014 11:48:09 +0200
From: Stefan Drees <stefan@drees.name>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
MIME-Version: 1.0
To: json@ietf.org
References: <20140509173159.28855.94523.idtracker@ietfa.amsl.com> <A89181FF-2FAB-4C17-86AC-685D09AD0CA4@vpnc.org> <537875D8.1080807@drees.name>
In-Reply-To: <537875D8.1080807@drees.name>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:qgyyGVnNTLKzW6VVq0EupKkSykNkhNC6SpfB+J+uO/cDzgz9tPA fFNgCzZK1PedmyGXiYyChkmkmT9WWNY++yYNPdNlS3DXNjXlv/xoMPes2c34BrqoXbxl8s6 OYcmksftdMB+a/HiOlZQAz9VzyAnqfQLvCwS1axgm8Fa9XqCRGFYkqs+2ATBDhdVBn2w01V BBBB4iQUB3tBvNLqI+1vA==
Archived-At: http://mailarchive.ietf.org/arch/msg/json/eGNAKnKs3CeiAGyMMRcVNt6ZLJ4
Subject: Re: [Json] Seeking more input on draft-ietf-json-text-sequence
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: stefan@drees.name
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: Sun, 18 May 2014 09:48:15 -0000

On 2014-05-18 10:56 +01:00, Stefan Drees sent during streaming read 
session of draft-02:
> On 2014-05-14 20:32 +01:00, Paul Hoffman wrote:
>> Greetings again. Wearing my chair hat, I encourage people in the
>> group(especially you quiet types) to review this WG draft and let the
>> WG know
>> what you think. The idea of JSON text sequences has many applications,
>> and folks have invented things like this in the past for their own
>> internal purposes. We would like to make sure that this document covers
>> as many use cases as possible.
>>
>> --Paul Hoffman
>
> I like to understand grammars also bottom up - which might qualify as a
> lexer's perspective - overlapping rules like the one for ws1 and ws2 in
> the suggested grammar do not really make things clearer for me.
> Additionally the reader will benefit from the expressed clear
> assumption, how these ws(''|1|2) relate to each other.
>
> So, I suggest to change (as found in draft-02):
>
> # --- 8< ----
> 2.  JSON Text Sequence Format
>
>     The ABNF [RFC5234] for the JSON text sequence format is as follows:
>
>       JSON-sequence = *ws1 *(JSON-text *ws2 %x0A *ws1)
>       ws1 = %x20 / %x09 / %x0A / %x0D
>       ws2 = %x20 / %x09 / %x0D
>       JSON-text = <given by RFC7159>
>
>                       Figure 1: JSON text sequence ABNF
>
> # --- 8< ----
>
> into either:
>
> # --- 8< ----
> 2.  JSON Text Sequence Format
>
>     The ABNF [RFC5234] for the JSON text sequence format is as follows:
>
>       JSON-sequence = *(ws-no-nl
>                         / nl) *(JSON-text *ws-no-nl nl *(ws-no-nl / nl))
>       nl = %x0A
>       ws-no-nl = ( %x20 / %x09 / %x0D )
>       JSON-text = <given by RFC7159>
>
>                       Figure 1: JSON text sequence ABNF
>
>     When combining the grammars, the rule for ws in the JSON-text is
>     therefore equivalent to *( ws-without-newline / newline )
>
> # --- 8< ----
>
> or less cryptic but wrapped some more:
>
> # --- 8< ----
> 2.  JSON Text Sequence Format
>
>     The ABNF [RFC5234] for the JSON text sequence format is as follows:
>
>       JSON-sequence = *(
>          ws-without-newline /
>          newline ) *( JSON-text *ws-without-newline newline *(
>              ws-without-newline / newline ) )
>       newline = %x0A
>       ws-without-newline = ( %x20 / %x09 / %x0D )
>       JSON-text = <given by RFC7159>
>
>                       Figure 1: JSON text sequence ABNF
>
>     When combining the grammars, the production for ws in the JSON-text
>     is therefore equivalent to *( ws-without-newline / newline )
>
> # --- 8< ----

*preferred* (cf. below)

>
>   ... but I am *not* passionate about this.

Given the short length, focused style of the document, I think these 
changes do form a good contribution towards clarity and readability.

>
> It is just that the mix of optional sets, where one is a proper subset
> of the other to me smells very implicit, where being explicit (choosing
> a direct decomopsition like "X/x and x" to me reads well and is not that
> much longer.
>
> What do the others think?
>
> PS: If the parentheses in the simple rules do not match our current
> styleguide, just remove them, it is the decomposition I am interested in.

and of course adapt accordingly figure 2 located in section "3.  Use for 
Logfiles, or How to Resynchronize Following Truncated entries"

from the current:

# --- 8< ----
     boundary = endchar *ws2 %0xA *ws1 startchar
     endchar = ( "}" / "]" / %x22 / "e" / "l" / DIGIT )
     startchar =  ( "{" / "[" / %x22 / "t" / "f" / "n" / "-" / DIGIT )
# --- 8< ----

to the (short version):
# --- 8< ----
     boundary = endchar *ws-no-nl nl *(ws-no-nl / nl) startchar
     endchar = ( "}" / "]" / %x22 / "e" / "l" / DIGIT )
     startchar =  ( "{" / "[" / %x22 / "t" / "f" / "n" / "-" / DIGIT )
# --- 8< ----

or *preferred* (more explicit version):
# --- 8< ----
     boundary = endchar *ws-without-newline newline *(
                    ws-without-newline / newline) startchar
     endchar = ( "}" / "]" / %x22 / "e" / "l" / DIGIT )
     startchar =  ( "{" / "[" / %x22 / "t" / "f" / "n" / "-" / DIGIT )
# --- 8< ----

Note: Aliasing %0xA with a readable term lke newline to me shines as a 
service to the reader, emphasizing the special role this token has in 
the recommendation which is so nicely stated in:

# --- 8< ----
    Requirements:

    o  JSON text sequence encoders MUST emit a newline after any JSON
       text.
# --- 8< ----

So the longer versions presented above are the ones, I would prefer.
(those with "newline" instead of "nl").

Sorry for streaming feedback mode,
Stefan.

> All the best,
> Stefan
>
>> On May 9, 2014, at 10:31 AM, internet-drafts@ietf.org wrote:
>>
>>>
>>> A New Internet-Draft is available from the on-line Internet-Drafts
>>> directories.
>>> This draft is a work item of the JavaScript Object Notation Working
>>> Group of the IETF.
>>>
>>>         Title           : JavaScript Object Notation (JSON) Text
>>> Sequences
>>>         Author          : Nicolas Williams
>>>     Filename        : draft-ietf-json-text-sequence-02.txt
>>>     Pages           : 10
>>>     Date            : 2014-05-09
>>>
>>> Abstract:
>>>    This document describes the JSON text sequence format and associated
>>>    media type.
>>>
>>>
>>> The IETF datatracker status page for this draft is:
>>> https://datatracker.ietf.org/doc/draft-ietf-json-text-sequence/
>>>
>>> There's also a htmlized version available at:
>>> http://tools.ietf.org/html/draft-ietf-json-text-sequence-02
>>>
>>> A diff from the previous version is available at:
>>> http://www.ietf.org/rfcdiff?url2=draft-ietf-json-text-sequence-02
>>
>>
>> _______________________________________________
>> json mailing list
>> json@ietf.org
>> https://www.ietf.org/mailman/listinfo/json
>>
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json