Re: [Json] Generators

Marcos Caceres <w3c@marcosc.com> Mon, 10 June 2013 11:27 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 993DF21F85BF for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 04:27:59 -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 07Iso05sLEKg for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 04:27:58 -0700 (PDT)
Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) by ietfa.amsl.com (Postfix) with ESMTP id 89DA621F84A1 for <json@ietf.org>; Mon, 10 Jun 2013 04:27:58 -0700 (PDT)
Received: by mail-we0-f180.google.com with SMTP id w56so4701235wes.39 for <json@ietf.org>; Mon, 10 Jun 2013 04:27:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition:x-gm-message-state; bh=DAjRQN8KnVrlNEtzka9IWu/yGr0XFmEWeq2YfkZ60zY=; b=CajAMARhOjYpGQdiaPZ03E7sEB6M+jAPTybN3S1IH7ywDx6uCkC+ezKsbcsaatV8wt CWtsbjBJbje+m2G2FpoG7+u8hsjsSRTU3vdOzvEuXOYEOwK12WcwVSmyeYAl4bcDu01P QTVrZGmpB7e06k7rzU9otWrM5Fy0pIanEiW1axpIdiOj7voCaTs88b9XgzxQFl/d2bcD uPj2F4Rp0wsGf9IIqECINdpn42SFwFuEp9fz5d3DYeO4uFbhj183MVlr07ymz3g47Dvs GTwZOSj6hS9Q/qKACLX1u4VAVhViWKoTTbi8g2MdbgnH8Z6PWzbHrOKO/V5m+R9S4YwV yrtQ==
X-Received: by 10.194.158.194 with SMTP id ww2mr5524936wjb.3.1370863677679; Mon, 10 Jun 2013 04:27:57 -0700 (PDT)
Received: from [172.16.0.7] (bl11-16-70.dsl.telepac.pt. [85.244.16.70]) by mx.google.com with ESMTPSA id f8sm10433939wiv.0.2013.06.10.04.27.55 for <multiple recipients> (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 04:27:56 -0700 (PDT)
Date: Mon, 10 Jun 2013 12:27:54 +0100
From: Marcos Caceres <w3c@marcosc.com>
To: Carsten Bormann <cabo@tzi.org>
Message-ID: <8BD6412FBAD444A393B55D3CE2D80B00@marcosc.com>
In-Reply-To: <CB545934-DB9A-42AC-9457-F46BF925E84B@tzi.org>
References: <51B58261.5040808@drees.name> <51b5a11d.0881440a.629d.68d4SMTPIN_ADDED_BROKEN@mx.google.com> <60EAB36FA95E40A180330B3D7F8377F5@marcosc.com> <CB545934-DB9A-42AC-9457-F46BF925E84B@tzi.org>
X-Mailer: sparrow 1.6.4 (build 1178)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Gm-Message-State: ALoCoQmDCtiCAkMfmns/ulI4vzMknp6DIGbwRljfUdUI6dGk0UUyw4CSOLzHqPa2huS4tI5v54Ej
Cc: json@ietf.org
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 11:28:00 -0000

On Monday, June 10, 2013 at 11:24 AM, Carsten Bormann wrote:

> On Jun 10, 2013, at 12:10, Marcos Caceres <w3c@marcosc.com (mailto:w3c@marcosc.com)> wrote:
> 
> > please write the algorithm
> 
> hixiefy (vt): 
Personal attacks are not cool. I kindly ask that you refrain from doing that.  
> Make a specification less useful but more apparently
> "precise" by down-compiling readable English text that makes use of
> some structure and certain unstated assumptions into barely readable,
> ambiguous pseudo code based on the same unstated assumptions, but now
> leaving recognizing the structure as an exercise to the reader.

This was not what I was suggesting. It's why I pointed to ES6. It's algorithms are very clear and easy to follow for implementers. If you haven't already, I encourage you to read some ES6 - it's actually quite a delight to read and follow along to, even for someone that is not an expert (and certainly does not exhibit the language issues you mentioned above). Having said that, yes, the HTML5 spec is hard to read in places, but I would not blame any one individual for that - HTML5 is a very complex system that was specified from the messy organic growth of the Web: trying to standardize it with English is hard, but at least we have something that works fairly well now across user agent. 
> I'm well aware that you sometimes have to give up writing an
> interoperability specification and instead actually specify an 
> algorithm, but that should be a last resort, never the approach 
> from the outset.

I don't understand? the end result of these specifications is code in some system (i.e., all specs are "interoperability specifications"). We want the code to be the same no matter what system it is run in (i.e., interoperable). Having a list of steps provides clear guidance for people to follow, and lets the implementer know exactly where and how to apply error handling (e.g., in the case of duplicate property names). It also helps users (developers) understand what is going on inside the system*. 

Having clear steps also allows for the creation of a more precise test suite: one can write a test for each step in the algorithm - thus getting more precise specification verification. 

*Having said that, it is not a requirement that implementers follow the specification as the algorithm is written - so long  as the end result is indistinguishable from that which would be achieved by following a given algorithm. 

-- 
Marcos Caceres