Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-08-23 Thread Douglas Gregor via swift-evolution
> On Jun 16, 2017, at 11:21 AM, Tino Heth via swift-evolution > wrote: > > The described problem might be one of the most famous itches of the language, > but imho the bar for new keywords* should be higher than that — and there are > alternatives: > > First, I

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Xiaodi Wu via swift-evolution
On Fri, Jun 16, 2017 at 14:42 Paul Cantrell wrote: > On Jun 16, 2017, at 2:26 PM, Xiaodi Wu wrote: > > On Fri, Jun 16, 2017 at 14:06 Paul Cantrell via swift-evolution < > swift-evolution@swift.org> wrote: > >> On Jun 16, 2017, at 1:14 PM, Erica Sadun via

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Paul Cantrell via swift-evolution
> On Jun 16, 2017, at 2:26 PM, Xiaodi Wu wrote: > > On Fri, Jun 16, 2017 at 14:06 Paul Cantrell via swift-evolution > > wrote: >> On Jun 16, 2017, at 1:14 PM, Erica Sadun via swift-evolution >>

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Xiaodi Wu via swift-evolution
On Fri, Jun 16, 2017 at 14:06 Paul Cantrell via swift-evolution < swift-evolution@swift.org> wrote: > On Jun 16, 2017, at 1:14 PM, Erica Sadun via swift-evolution < > swift-evolution@swift.org> wrote: > > On Jun 16, 2017, at 8:44 AM, David Hart wrote: > > Okay, I

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Adrian Zubarev via swift-evolution
I’ve already mentioned this in this thread. This is one of the missing features from the generics manifesto, however it’s (almost) a syntactic sugar only. It means that if we would enforce default in Swift 4, then having default implementation directly inside protocols would be really a

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Adrian Zubarev via swift-evolution
I’d support the breaking change here to allow the language to evolve properly instead of introducing halve baked opt-ins and workarounds for issues that totally deserve a fix. The first thought that I had when reading the proposal the first time was, that extend does not add any benefit to the

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Paul Cantrell via swift-evolution
> On Jun 16, 2017, at 1:14 PM, Erica Sadun via swift-evolution > > wrote: > >> On Jun 16, 2017, at 8:44 AM, David Hart > > wrote: >> >> Okay, I undertand. I’m just worried that

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Erica Sadun via swift-evolution
> On Jun 16, 2017, at 12:21 PM, Tino Heth <2...@gmx.de> wrote: > > The described problem might be one of the most famous itches of the language, > but imho the bar for new keywords* should be higher than that — and there are > alternatives: > > First, I guess many would like to see this to be

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Tino Heth via swift-evolution
The described problem might be one of the most famous itches of the language, but imho the bar for new keywords* should be higher than that — and there are alternatives: First, I guess many would like to see this to be valid Swift: protocol Foo { func bar() {

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Erica Sadun via swift-evolution
> On Jun 16, 2017, at 8:44 AM, David Hart wrote: > > Okay, I undertand. I’m just worried that the proposal is a net negative if > the keywords stay optional. I’ll mention it in more detail once we get to the > review period. > > Thanks for the work on the proposal!!

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread David Hart via swift-evolution
Okay, I undertand. I’m just worried that the proposal is a net negative if the keywords stay optional. I’ll mention it in more detail once we get to the review period. Thanks for the work on the proposal!! > On 16 Jun 2017, at 16:33, Erica Sadun wrote: > > As we say in

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Erica Sadun via swift-evolution
As we say in our introduction, we're pitching the most conservative approach. The proposal was designed for minimal language impact. It chooses a conservative approach that can be phased in first over time and language release over more succinct alternatives that would impact existing code

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread David Hart via swift-evolution
Erica, any thoughts on only having default and making it an error in a future version of Swift like was discussed on this thread? The idea seems to have a few supporters. > On 16 Jun 2017, at 15:33, Erica Sadun via swift-evolution > wrote: > > >> On Jun 14, 2017,

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-16 Thread Erica Sadun via swift-evolution
> On Jun 14, 2017, at 11:46 PM, Dave Abrahams via swift-evolution > wrote: > > > on Wed Jun 14 2017, Chris Lattner wrote: > >>> On Jun 14, 2017, at 10:11 AM, Erica Sadun via swift-evolution >>> wrote: >>> >>>

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-15 Thread Philippe Hausler via swift-evolution
I too really like this proposal; personally I can attest to how it probably would have saved some time and headache with the Foundation overlay as well as swift-corelibs-foundation (specifically when adopting Collection and friends for types) Would it be reasonable to have this apply to

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Dave Abrahams via swift-evolution
on Wed Jun 14 2017, Chris Lattner wrote: >> On Jun 14, 2017, at 10:11 AM, Erica Sadun via swift-evolution >> wrote: >> >> Some pals and I have been kicking an idea around about introducing >> better ways to support the compiler in protocol

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Paul Cantrell via swift-evolution
> On Jun 14, 2017, at 4:51 PM, David Hart via swift-evolution > wrote: > > >> On 14 Jun 2017, at 22:37, Vladimir.S via swift-evolution >> > wrote: >> >> On 14.06.2017 21:23, Haravikk via swift-evolution

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Chris Lattner via swift-evolution
> On Jun 14, 2017, at 10:11 AM, Erica Sadun via swift-evolution > wrote: > > Some pals and I have been kicking an idea around about introducing better > ways to support the compiler in protocol extensions. We want to eliminate > some hard-to-detect bugs. We've been

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Vladimir.S via swift-evolution
On 15.06.2017 0:51, David Hart wrote: On 14 Jun 2017, at 22:37, Vladimir.S via swift-evolution > wrote: On 14.06.2017 21:23, Haravikk via swift-evolution wrote: On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread David Hart via swift-evolution
> On 14 Jun 2017, at 22:37, Vladimir.S via swift-evolution > wrote: > > On 14.06.2017 21:23, Haravikk via swift-evolution wrote: >>> On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution >>> > wrote: >>>

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Víctor Pimentel via swift-evolution
On 14 Jun 2017, at 23:22, Goffredo Marocchi via swift-evolution wrote: >> Yes, I think we are all in vigorous agreement about this. The question is >> whether, at this point in Swift's evolution, a wide-ranging migration due to >> a new required keyword will be well

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread David Hart via swift-evolution
> On 14 Jun 2017, at 20:19, Matthew Johnson wrote: > > >> On Jun 14, 2017, at 1:12 PM, Xiaodi Wu via swift-evolution >> > wrote: >> >> On Wed, Jun 14, 2017 at 1:08 PM, Xiaodi Wu >

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Xiaodi Wu via swift-evolution
Sure, it’s not out of the question, technically. The question is whether a migration of such scale is desirable, which is a difficult judgment call. On Wed, Jun 14, 2017 at 16:43 David Hart wrote: > On 14 Jun 2017, at 20:19, Matthew Johnson wrote: > >

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Goffredo Marocchi via swift-evolution
Sent from my iPhone > On 14 Jun 2017, at 21:41, Xiaodi Wu via swift-evolution > wrote: > >> On Wed, Jun 14, 2017 at 3:37 PM, Vladimir.S via swift-evolution >> wrote: >>> On 14.06.2017 21:23, Haravikk via swift-evolution wrote: >>>

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Xiaodi Wu via swift-evolution
On Wed, Jun 14, 2017 at 3:37 PM, Vladimir.S via swift-evolution < swift-evolution@swift.org> wrote: > On 14.06.2017 21:23, Haravikk via swift-evolution wrote: > >> >> On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution < >>> swift-evolution@swift.org > wrote:

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Vladimir.S via swift-evolution
On 14.06.2017 21:23, Haravikk via swift-evolution wrote: On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution > wrote: On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Adrian Zubarev via swift-evolution
I like the idea of fixing this area of the language and I’m happy to see others already pointed out that extend could be implicit and does not need to be introduced at all, where default would become necessary for protocol default implementations. If I’m not mistaken this _can_ be an

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread David Moore via swift-evolution
I agree with omitting the extend keyword, as it does not really add anything useful to the language. The default keyword, on the other hand, seems as if it will be really useful for extending protocols. It would be useful for a handful of cases, and it further introduces safety to Swift as a

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Víctor Pimentel via swift-evolution
> El 14 jun 2017, a las 20:01, David Hart via swift-evolution > escribió: > > I think this proposal is a great idea. But I would vote for the alternative > of only having default and implicitly deducing extend when default is not > specified: it would mimic how

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Matthew Johnson via swift-evolution
> On Jun 14, 2017, at 1:23 PM, Haravikk via swift-evolution > wrote: > > >> On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution >> > wrote: >> >> On Wed, Jun 14, 2017 at 1:01 PM, David Hart via

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Haravikk via swift-evolution
> On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution > wrote: > > On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution > > wrote: > Sorry, initially sent off-list: > > I think this

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Matthew Johnson via swift-evolution
> On Jun 14, 2017, at 1:12 PM, Xiaodi Wu via swift-evolution > wrote: > > On Wed, Jun 14, 2017 at 1:08 PM, Xiaodi Wu > wrote: > On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution >

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Xiaodi Wu via swift-evolution
On Wed, Jun 14, 2017 at 1:08 PM, Xiaodi Wu wrote: > On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution < > swift-evolution@swift.org> wrote: > >> Sorry, initially sent off-list: >> >> I think this proposal is a great idea. But I would vote for the >> alternative

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Xiaodi Wu via swift-evolution
On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution < swift-evolution@swift.org> wrote: > Sorry, initially sent off-list: > > I think this proposal is a great idea. But I would vote for the > alternative of only having default and implicitly deducing extend when > default is not

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread David Hart via swift-evolution
Sorry, initially sent off-list: I think this proposal is a great idea. But I would vote for the alternative of only having default and implicitly deducing extend when default is not specified: it would mimic how override works with only one keyword, it would not introduce a completely new

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Robert Bennett via swift-evolution
I like this proposal a lot and also like Xiaodi’s suggestion that these be made into @ attributes. > On Jun 14, 2017, at 1:48 PM, Xiaodi Wu via swift-evolution > wrote: > > I like that this is minimal impact because it is optional. Since it is > optional, I wonder

Re: [swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Xiaodi Wu via swift-evolution
I like that this is minimal impact because it is optional. Since it is optional, I wonder if making it visually distinct from the mandatory keywords such as "override" for classes would be optimal, perhaps by making these @annotations. Otherwise the naming is near perfect, IMO. It follows by

[swift-evolution] [Pitch] Introducing role keywords to reduce hard-to-find bugs

2017-06-14 Thread Erica Sadun via swift-evolution
Some pals and I have been kicking an idea around about introducing better ways to support the compiler in protocol extensions. We want to eliminate some hard-to-detect bugs. We've been brainstorming on how to do this without affecting backward compatibility and introducing a minimal impact on