Re: Should binding section be rewritten more algorithmically?

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:  

https://github.com/darobin/webidl.js    
  
> 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