proposal-first-class-protocols
proposal-first-class-protocols copied to clipboard
a proposal to bring protocol-based interfaces to ECMAScript users
This proposal is already stage 1, isn't it?
I'd like to suggest a different approach for this proposal: instead of a class to implement protocols on declaration it will implement different protocols in a different statement for each...
Barring static types, it would be nice to have checks ensuring that if a protocol intends a field to be a method that an implementation _at least_ defines is as...
@justinfagnani's [mixins proposal](https://github.com/justinfagnani/proposal-mixins) fits somewhere in the same problem space as protocols, but presents a very different mechanism. How should we decide between these two proposals, something in the middle,...
Kind of like how classes have constructors to run on initialization, it'd be nice to add a way to run code "on implement", since interfaces/protocols might wish to have their...
I think that the fact that protocols are also a kind of mixins is problematic. First, because they are a naive kind of mixins and, secondly, because I think it...
Often it makes sense for a protocol to have optional fields that can be omitted entirely (but considered when they're used) but still included conceptually as part of the protocol....
I have some questions about this example: ```js protocol A { a; } protocol B extends A { b; } class C implements B { [A.a]() {} [B.b]() {} }...
First, thank you for publishing the proposal. I think it's quite interesting language feature. I generally like to design code with protocols, e.g. type class in Haskell or trait in...