Re: [heycam/webidl] BREAKING: Convert the `unrestricted` keyword into an extended attribute (#857)

As a thought experiment, we could turn everything into type-annotation:
```
                long →           [Integer32Bit] type
  unrestricted float → [UnrestrictedFloat32Bit] type
           USVString →              [USVString] type
```
As another thought experiment, we can turn all numeric types into a single type:
```
                long →           [Integer32Bit] numeric
  unrestricted float → [UnrestrictedFloat32Bit] numeric
           USVString →                    [USV] string
```

Why don't we do these things?  Intuitively bad?

I expect that we can explain why we define `X` as a separate type and why we define `[ExtAttr] X` as an annotated type (not a separate type `Y`) _based on clear guideline, policy, concept model, and/or rationale_.  At this moment, I can tell why `unrestricted float` should be `[Unrestricted] float` only from my intuitiveness, which I think we shouldn't rely on too much.

If this proposal were just a patchwork fix, I'm not convinced.  Maybe it's better to fix typedef.  Maybe it's expected that you cannot write `unrestricted TypedefName` because `unrestricted` is not a type modifier (as of now).

As long as we have consensus about the type system and it's clear what should be type and what should be annotated type, we should be able to discuss whether this proposal is aligned to the guideline/policy/etc or not.

Note that I'm not objecting to this proposal.  My intuitiveness supports this way.  But I also see lack of justification/rationale behind the proposal.

-- 
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/pull/857#issuecomment-604388055

Received on Thursday, 26 March 2020 11:55:43 UTC