Re: [Json] Generators

Stefan Drees <stefan@drees.name> Mon, 10 June 2013 11:26 UTC

Return-Path: <stefan@drees.name>
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 DE29421F86FB for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 04:26:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.086
X-Spam-Level:
X-Spam-Status: No, score=-2.086 tagged_above=-999 required=5 tests=[AWL=0.163, BAYES_00=-2.599, HELO_EQ_DE=0.35]
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 uzJHQpCt2ihR for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 04:26:54 -0700 (PDT)
Received: from mout.web.de (mout.web.de [212.227.15.14]) by ietfa.amsl.com (Postfix) with ESMTP id 6E00421F8717 for <json@ietf.org>; Mon, 10 Jun 2013 04:26:52 -0700 (PDT)
Received: from newyork.local.box ([93.129.126.10]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LlniO-1UCfQd0NXc-00ZsSx; Mon, 10 Jun 2013 13:26:47 +0200
Message-ID: <51B5B7F6.20609@drees.name>
Date: Mon, 10 Jun 2013 13:26:46 +0200
From: Stefan Drees <stefan@drees.name>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version: 1.0
To: Markus Lanthaler <markus.lanthaler@gmx.net>
References: <51B58261.5040808@drees.name> <00d201ce65bf$bd7edd50$387c97f0$@lanthaler@gmx.net>
In-Reply-To: <00d201ce65bf$bd7edd50$387c97f0$@lanthaler@gmx.net>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:mba2uU8mSmeL7a2BmT5ejal/OMPSZ8ByESfzXUH/6Ng qHhZRjLpBt8DHEQzur8J62LrWzRgFueuinfx3FU3UGhQdD5+H1 qNYoGIoNtqLOcZmiCzcYjH1U7KWQNHQle/9WxTwXXIORBSLiVf XSeHGElhN6EifJozj+PLhypS9wZ6YpmsBQaGruKjVJJQWBBouK YzNAGQGFnjwrm3W+PQiDw==
Cc: json@ietf.org
Subject: Re: [Json] Generators
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: Mon, 10 Jun 2013 11:27:00 -0000

On 2013-06-10 11:49 CEST, Markus Lanthaler wrote:
> On Monday, June 10, 2013 9:38 AM, Stefan Drees wrote:
>> 5.  Generators
>>
>>      A JSON generator produces JSON text that MUST strictly conform to
>>      the JSON grammar.
>>
>>      Generators MUST NOT duplicate names in objects if they can avoid or
>>      detect such duplication.
>>
>> """
> [...]
>> This "MUST NOT duplicate ... if" reads pretty soft for implementers,
>> but should be the only consensual non-breaking way out of the
>> historical dilemma of not enforcing it for generators in the first place.
>
> The "if" makes the MUST NOT conditional which is at odds with its definition
>
> """
> 1. MUST   This word, or the terms "REQUIRED" or "SHALL", mean that the
>     definition is an absolute requirement of the specification.
> """

that depends. If we act with care, we have to respect many boundary 
conditions. One is: There is only one term Generators in the spec we 
update minimally, but in reality many polarizing use cases drove 
implementations of such generators into existence (please also cf. [1] 
esp. where listing some of these and further motivate the concurrently 
proposed "UPPERCASE lowercase" selection).
So the if effectively offers a subclassification we are not allowed to 
enforce by say inventing a second class citizen like eg. a 
DupesGenerator ...

> I would suggest to just drop the if-statement but can see why people would
> disagree with that. ...

I personally would really wish to allow for trailing commas in arrays 
and objects, but our job - as I understand it - is to update the JSON 
RFC **and** keep the grown ecosystem intact thus defend the RFCs 
coolness, brevity and embracing functionality for all existing 
implementations of Generators, Parsers and combinations thereof. Some of 
these terms may not appear in the charter of the json wg, but might 
match those actually in there ;-)

All the best,
Stefan.