[heycam/webidl] Consider syntactic changes to WebIDL to make it more "JavaScript-y" (#485)

WebIDL's syntax derives from the history of OMG and CORBA, though it has been gradually deviating from that. There are still several superficial changes that could be made to try to make WebIDL more intuitive for JavaScript programmers, such as:
- Write `class` instead of `interface` for exposed interfaces
- Replace `:` with `extends`
- Use getter/setter method syntax instead of `attribute`
- Consider other syntax for optional, e.g., `= undefined` after a parameter
- Consider `value : Type` instead of `Type value`, a la TypeScript/Flow (not actually JS but many developers are familiar)
- Rename some types, e.g., DOMString => String
- Provide some common aliases, e.g., unrestricted double => Number
- Extended attributes in square brackets looks like computed property names, and similar syntax has been rejected for addition in JS due to ambiguity in an LR(1) grammar; consider some other syntax for extended attributes, such as `@attribute(arg)`
- And probably more things

This is potentially a lot of changes, and I'm not sure if they would "pay for themselves" given the complexity of implementing them across tooling. However, they could make WebIDL more accessible for ordinary JavaScript developers and improve interaction between developers, spec authors and implementers.

I believe there are open bugs for some of these, but I haven't looked them up yet; please feel free to edit and add cross-references.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/485

Received on Tuesday, 5 December 2017 16:33:35 UTC