Re: [Json] Generators

Marcos Caceres <w3c@marcosc.com> Mon, 10 June 2013 10:10 UTC

Return-Path: <w3c@marcosc.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 11FBF21F8A85 for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 03:10:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 Qvj3AAX9KYZR for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 03:10:40 -0700 (PDT)
Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) by ietfa.amsl.com (Postfix) with ESMTP id E6B1221F885A for <json@ietf.org>; Mon, 10 Jun 2013 03:10:39 -0700 (PDT)
Received: by mail-wi0-f179.google.com with SMTP id hj3so542950wib.0 for <json@ietf.org>; Mon, 10 Jun 2013 03:10:39 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition:x-gm-message-state; bh=hqAoKx0yjKGWEWovY8V2n0z7DijPLA6bHx/NWLmjoDY=; b=JFPkIUt4YtZCXvldIsN5bVEFLFY4wUP7YlPh4n9hMwFn0lNobif9H91lFs/pQSGZ6P DoBomYf4wJAKDG7zsheH5MfhkL7Z9+CmfZGnyXvJ/TiUn8pge8740ivqUR0QwTh0iDJf ZtsGgmmqQ92BjlIew+idLEn7IT9JUMhS9f3Xk4xtHfEJossMA7JOwWFxNmbC422xXLfh vyKwhs0LZUQ2B7/VqGE9wwpg5HZZ+3+jXGA3wCFMwBnvO+rNzGaD0qly5wZgx1LMFK5t yZbWgaz9pXV8JJ6P/1ddRWEyjtkNpnn38spPjy5Abz2XMkveOXqsJIfdX67YBXYBzjmr KPjg==
X-Received: by 10.180.183.40 with SMTP id ej8mr2848208wic.37.1370859038965; Mon, 10 Jun 2013 03:10:38 -0700 (PDT)
Received: from [192.168.1.65] (bl11-16-70.dsl.telepac.pt. [85.244.16.70]) by mx.google.com with ESMTPSA id fu14sm10272168wic.0.2013.06.10.03.10.36 for <json@ietf.org> (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 03:10:38 -0700 (PDT)
Date: Mon, 10 Jun 2013 11:10:31 +0100
From: Marcos Caceres <w3c@marcosc.com>
To: json@ietf.org
Message-ID: <60EAB36FA95E40A180330B3D7F8377F5@marcosc.com>
In-Reply-To: <51b5a11d.0881440a.629d.68d4SMTPIN_ADDED_BROKEN@mx.google.com>
References: <51B58261.5040808@drees.name> <51b5a11d.0881440a.629d.68d4SMTPIN_ADDED_BROKEN@mx.google.com>
X-Mailer: sparrow 1.6.4 (build 1178)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
X-Gm-Message-State: ALoCoQmPcQaf7lwrq5Wa8+v57utFSWHJXfw+j2Beztqs0LO92c4Cru3EnjtUSQo83UPymZSjBJzs
Subject: Re: [Json] Generators
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: Mon, 10 Jun 2013 10:10:41 -0000

On Monday, 10 June 2013 at 10:49, 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.
>  

Please try to avoid "wish list" style conformance requirements. If you want "strictly" conforming documents generated (whatever that may mean), then please write the algorithm to produce such documents. For example:

"When generating JSON, as JSON generator MUST run the steps to generate JSON text.

The steps to generate JSON text are given by the following algorithm:  
1. …
2. …  
"

> >  
> > 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.
>  

I agree. The above "if they can avoid [it]" if pretty lousy spec text. Please define the algorithm instead to produce the results you want.  

For excellent examples of how to write a specification using step-based conformance, please see the ES6 spec. See the parsing algorithm for JSON here - you basically want a language neutral version of that, right?:

http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.12.2

HTH,  
Marcos Caceres