W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: Writing spec algorithms in ES6?

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 12 Jun 2015 08:49:30 +0200
Message-ID: <CADnb78jvqpLk-5dUG+VVO4jEaEscM40tC4sxQ=ZJB1Rmcw1Ajg@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: WebApps WG <public-webapps@w3.org>
On Thu, Jun 11, 2015 at 10:41 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/11/15 4:32 PM, Dimitri Glazkov wrote:
>> I noticed that the CSS Color Module Level 4 actually does this, and it
>> seems pretty nice:
>> http://dev.w3.org/csswg/css-color/#dom-rgbcolor-rgbcolorcolor
>
> I should note that the ES code there produces semantics that don't match the
> IDL in this spec (or is complete nonsense, depending on how literally you
> choose to read it).

I think we should pick the complete nonsense interpretation as we try
to be precise.

If you use IDL you cannot use ES since the pipeline is ES -> IDL ->
prose that operates on IDL values -> IDL -> ES. Skipping IDL
altogether might be okay, but the infrastructure is not there yet, and
it's way more difficult to get things right.


> I would actually prefer some sort of pseudocode that is _not_ JS-looking,
> just so people don't accidentally screw this up.

If we had more resources I could imagine IDL 1) matching ES-syntax
more and 2) define a bunch of abstract operations that specifications
can use to define their features.


-- 
https://annevankesteren.nl/
Received on Friday, 12 June 2015 06:49:57 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC