Re: [heycam/webidl] Add typed ReadableStream<type> and WritableStream<type> (#951)

> In particular, the problem here is that you could write `ReadableStream<bool>` in your IDL, or `ReadableStream<ReceiveStream>`; it wouldn't matter.

@domenic Except it would, because WebIDL is normative, whereas comments are (probably?) not.

In a perfect world where every API is backed by a precise algorithm, this might not matter, but that's not always the case.

> There's nothing in the spec infrastructure, or implementation infrastructure, to enforce that your ReadableStream contains a given type.

Verification in bindings seems harder to do for outputs than inputs, yet there's [precedence](https://github.com/heycam/webidl/issues/382#issuecomment-315553336) for using WebIDL to normatively specify aspects of outputs even when they can't be enforced.

Specifically, the webrtc-stats spec uses `required` in output dictionaries like [RTCRtpStreamStats](https://w3c.github.io/webrtc-stats/#streamstats-dict*) to denote members user agents MUST implement, even though this isn't easily enforceable by WebIDL infrastructure.

Limiting what we can declare in WebIDL based on tooling's ability to enforce it today seems backwards to me, because WebIDL would appear to have declarative value even without any bindings at all.

> We're actually discussing perhaps removing the <T> syntax for promises as well, since we've discovered that implementations don't seem to do anything with it: see #943 and #782.

That seems unfortunate. Is there a link for this discussion? Maybe implementations should do something about it instead?

-- 
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/951#issuecomment-767915892

Received on Wednesday, 27 January 2021 00:16:17 UTC