W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

Re: Should binding section be rewritten more algorithmically?

From: Marcos Caceres <w3c@marcosc.com>
Date: Fri, 23 Mar 2012 19:03:12 +0000
To: Travis Leithead <travis.leithead@microsoft.com>
Cc: Marcos Caceres <marcosscaceres@gmail.com>, public-script-coord <public-script-coord@w3.org>
Message-ID: <4ACC43962D644C0D9F6324F079BA1D76@marcosc.com>

On Friday, March 23, 2012 at 6:53 PM, Travis Leithead wrote:

> > -----Original Message-----
> > From: Marcos Caceres [mailto:marcosscaceres@gmail.com]
> >  
> > Is anyone else on this list implementing WebIDL? If so, I'm wondering if
> > you would have an opinion as to whether the binding sections should be
> > rewritten as algorithms (and more closely follow the style of ECMAScript5).
> By "implementing" are you implementing the binding part or the syntax parsing part?
The binding part… the syntax part is a different matter. The syntax part is much more clear (though it would have been nice if it would have been written for a parser), but the only proper parser I've seen has issues in that it's machine generated:  

> As I've mentioned before, IE9 used an earlier draft of WebIDL as the basis for our new JavaScript engine binding language for the DOM. It worked out pretty well, but there were a number of things we had to add as extensions to WebIDL for our own purposes.
> > For example:
> >  
> > Implementing an IDL exception is done as follows:
> >  
> > 1. Let IDL be the IDL fragment to be implemented.
> > 2. Let E be a new Function object.
> > 3. If the [NoInterfaceObject] extended attribute was not used with IDL:
> > __x. Let identifier be the identifier of IDL.
> > __x. On the global object, call [[DefineOwnProperty]] with identifier, and
> > Property Descriptor {[[Value]]: E, [[Writable]]: true, [[Enumerable]]:
> > false, [[Configurable]]: true }, false.
> >  
> > and so on…
> >  
> > or am I the only person who is struggling to implement the spec in its
> > current form?
> WebIDL _could_ be re-worked as an algorithmic spec, but after a few readings, I think the current format works well enough--you quickly learn where you need to go to look something up, and it's well organized from that perspective.  
> In other words, I don't have any complaints with the current format.
I agree that for specification writing, the first half of the spec works great. I've used it for the last year on an almost daily basis and it's just gotten better and better… but now, implementing the bottom part… not so good for me at least.  
Received on Friday, 23 March 2012 19:03:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:06 UTC