Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-14 Thread Xiaodi Wu via swift-dev
On Tue, Nov 14, 2017 at 2:34 PM, David Sweeris wrote: > > On Nov 2, 2017, at 4:22 PM, Xiaodi Wu via swift-dev > wrote: > > On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson > wrote: > >> >> On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev < >> swift-dev@swift.org> wrote: >> >> It looks lik

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-14 Thread David Sweeris via swift-dev
> On Nov 2, 2017, at 4:22 PM, Xiaodi Wu via swift-dev > wrote: > > On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson > wrote: > >> On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev > > wrote: >> >> It looks like we have a good so

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-04 Thread Jonathan Hull via swift-dev
> On Nov 2, 2017, at 5:10 PM, Stephen Canon via swift-dev > wrote: > > On Nov 2, 2017, at 7:22 PM, Xiaodi Wu via swift-dev > wrote: > >> On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson > > wrote: >> >>> On Nov 2, 2017, at 5:20 PM, Jo

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Chris Lattner via swift-dev
> On Nov 1, 2017, at 9:16 AM, Ben Cohen via swift-dev > wrote: > > > >> On Oct 31, 2017, at 10:11 PM, Chris Lattner via swift-dev >> wrote: >> >> On Oct 31, 2017, at 9:07 AM, Stephen Canon via swift-dev >> wrote: >>> [Replying to the thread as a whole] >>> >>> There have been a bunch of

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Xiaodi Wu via swift-dev
On Thu, Nov 2, 2017 at 7:10 PM, Stephen Canon wrote: > On Nov 2, 2017, at 7:22 PM, Xiaodi Wu via swift-dev > wrote: > > On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson > wrote: > >> >> On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev < >> swift-dev@swift.org> wrote: >> >> It looks like w

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Stephen Canon via swift-dev
On Nov 2, 2017, at 7:22 PM, Xiaodi Wu via swift-dev wrote: > On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson > wrote: > >> On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev > > wrote: >> >> It looks like we have a good solution.

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Xiaodi Wu via swift-dev
On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson wrote: > > On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev < > swift-dev@swift.org> wrote: > > It looks like we have a good solution. Per Steve and David’s suggestions: > > 1) Make FloatingPoint == reflexive > > 2) Add &== to FloatingPoint

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Matthew Johnson via swift-dev
> On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev > wrote: > > It looks like we have a good solution. Per Steve and David’s suggestions: > > 1) Make FloatingPoint == reflexive > > 2) Add &== to FloatingPoint for those who specifically want IEEE behavior > > 3) Add a warning + fixit

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Jonathan Hull via swift-dev
It looks like we have a good solution. Per Steve and David’s suggestions: 1) Make FloatingPoint == reflexive 2) Add &== to FloatingPoint for those who specifically want IEEE behavior 3) Add a warning + fixit to ‘a != a’ We should take this to evolution... Thanks, Jon > On Nov 1, 2017, at 10

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-02 Thread Tino Heth via swift-dev
> Am 01.11.2017 um 17:51 schrieb Greg Titus via swift-dev : > > The common (and correct!) wisdom in _any_ programming language that uses IEEE > floating point is that checking equality of two floating point values is > almost always a terrible idea. Usually what you want in any real world code

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-01 Thread Xiaodi Wu via swift-dev
On Wed, Nov 1, 2017 at 13:47 David Sweeris wrote: > > On Nov 1, 2017, at 10:21 AM, Xiaodi Wu wrote: > > > On Tue, Oct 31, 2017 at 23:43 David Sweeris wrote: > >> >> On Oct 31, 2017, at 20:58, Xiaodi Wu wrote: >> >> On Tue, Oct 31, 2017 at 10:50 PM, Xiaodi Wu wrote: >> >>> On Tue, Oct 31, 2017

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-01 Thread David Sweeris via swift-dev
> On Nov 1, 2017, at 10:21 AM, Xiaodi Wu wrote: > > > On Tue, Oct 31, 2017 at 23:43 David Sweeris > wrote: > > On Oct 31, 2017, at 20:58, Xiaodi Wu > wrote: > >> On Tue, Oct 31, 2017 at 10:50 PM, Xiaodi Wu >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-01 Thread Xiaodi Wu via swift-dev
On Tue, Oct 31, 2017 at 23:43 David Sweeris wrote: > > On Oct 31, 2017, at 20:58, Xiaodi Wu wrote: > > On Tue, Oct 31, 2017 at 10:50 PM, Xiaodi Wu wrote: > >> On Tue, Oct 31, 2017 at 10:23 PM, David Sweeris >> wrote: >> >>> >>> On Oct 31, 2017, at 7:26 PM, Xiaodi Wu wrote: >>> >>> On Tue, Oct

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-01 Thread Stephen Canon via swift-dev
> On Nov 1, 2017, at 12:51 PM, Greg Titus via swift-dev > wrote: > >> On Nov 1, 2017, at 9:16 AM, Ben Cohen via swift-dev >> wrote: >>> On Oct 31, 2017, at 10:11 PM, Chris Lattner via swift-dev >>> wrote: >>> On Oct 31, 2017, at 9:07 AM, Stephen Canon via swift-dev >>> wrote: [Reply

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-01 Thread Greg Titus via swift-dev
> On Nov 1, 2017, at 9:16 AM, Ben Cohen via swift-dev > wrote: >> On Oct 31, 2017, at 10:11 PM, Chris Lattner via swift-dev >> wrote: >> On Oct 31, 2017, at 9:07 AM, Stephen Canon via swift-dev >> wrote: >>> [Replying to the thread as a whole] >>> >>> There have been a bunch of suggestions

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-11-01 Thread Ben Cohen via swift-dev
> On Oct 31, 2017, at 10:11 PM, Chris Lattner via swift-dev > wrote: > > On Oct 31, 2017, at 9:07 AM, Stephen Canon via swift-dev > wrote: >> [Replying to the thread as a whole] >> >> There have been a bunch of suggestions for variants of `==` that either trap >> on NaN or return `Bool?`.

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Chris Lattner via swift-dev
On Oct 31, 2017, at 9:07 AM, Stephen Canon via swift-dev wrote: > [Replying to the thread as a whole] > > There have been a bunch of suggestions for variants of `==` that either trap > on NaN or return `Bool?`. I think that these suggestions result from people > getting tunnel-vision on the id

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread David Sweeris via swift-dev
> On Oct 31, 2017, at 20:58, Xiaodi Wu wrote: > >> On Tue, Oct 31, 2017 at 10:50 PM, Xiaodi Wu wrote: >>> On Tue, Oct 31, 2017 at 10:23 PM, David Sweeris wrote: >>> On Oct 31, 2017, at 7:26 PM, Xiaodi Wu wrote: > On Tue, Oct 31, 2017 at 5:56 PM, David Sweeris > wrote: >>

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Xiaodi Wu via swift-dev
On Tue, Oct 31, 2017 at 10:50 PM, Xiaodi Wu wrote: > On Tue, Oct 31, 2017 at 10:23 PM, David Sweeris > wrote: > >> >> On Oct 31, 2017, at 7:26 PM, Xiaodi Wu wrote: >> >> On Tue, Oct 31, 2017 at 5:56 PM, David Sweeris >> wrote: >> >>> >>> On Oct 31, 2017, at 09:07, Stephen Canon via swift-dev <

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Xiaodi Wu via swift-dev
On Tue, Oct 31, 2017 at 10:23 PM, David Sweeris wrote: > > On Oct 31, 2017, at 7:26 PM, Xiaodi Wu wrote: > > On Tue, Oct 31, 2017 at 5:56 PM, David Sweeris > wrote: > >> >> On Oct 31, 2017, at 09:07, Stephen Canon via swift-dev < >> swift-dev@swift.org> wrote: >> >> [Replying to the thread as a

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread David Sweeris via swift-dev
> On Oct 31, 2017, at 7:26 PM, Xiaodi Wu wrote: > > On Tue, Oct 31, 2017 at 5:56 PM, David Sweeris > wrote: > > On Oct 31, 2017, at 09:07, Stephen Canon via swift-dev > wrote: > >> [Replying to the thread as a whole] >> >> There have b

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Xiaodi Wu via swift-dev
On Tue, Oct 31, 2017 at 11:07 AM, Stephen Canon wrote: > [Replying to the thread as a whole] > > There have been a bunch of suggestions for variants of `==` that either > trap on NaN or return `Bool?`. I think that these suggestions result from > people getting tunnel-vision on the idea of “make

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Xiaodi Wu via swift-dev
On Tue, Oct 31, 2017 at 5:56 PM, David Sweeris wrote: > > On Oct 31, 2017, at 09:07, Stephen Canon via swift-dev < > swift-dev@swift.org> wrote: > > [Replying to the thread as a whole] > > There have been a bunch of suggestions for variants of `==` that either > trap on NaN or return `Bool?`. I t

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread David Sweeris via swift-dev
> On Oct 31, 2017, at 09:07, Stephen Canon via swift-dev > wrote: > > [Replying to the thread as a whole] > > There have been a bunch of suggestions for variants of `==` that either trap > on NaN or return `Bool?`. I think that these suggestions result from people > getting tunnel-vision on

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Jonathan Hull via swift-dev
> On Oct 31, 2017, at 9:07 AM, Stephen Canon wrote: > > [Replying to the thread as a whole] > > There have been a bunch of suggestions for variants of `==` that either trap > on NaN or return `Bool?`. I think that these suggestions result from people > getting tunnel-vision on the idea of “ma

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread David Sweeris via swift-dev
> On Oct 31, 2017, at 9:07 AM, Stephen Canon via swift-dev > wrote: > > [Replying to the thread as a whole] > > There have been a bunch of suggestions for variants of `==` that either trap > on NaN or return `Bool?`. I think that these suggestions result from people > getting tunnel-vision o

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-31 Thread Stephen Canon via swift-dev
[Replying to the thread as a whole] There have been a bunch of suggestions for variants of `==` that either trap on NaN or return `Bool?`. I think that these suggestions result from people getting tunnel-vision on the idea of “make FloatingPoint equality satisfy desired axioms of Equatable / Co

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-29 Thread Xiaodi Wu via swift-dev
On Fri, Oct 27, 2017 at 5:06 AM, Jonathan Hull wrote: > > On Oct 26, 2017, at 11:44 PM, Xiaodi Wu wrote: > > On Fri, Oct 27, 2017 at 1:30 AM, Jonathan Hull wrote: > >> One completely different idea, which I brought up a year or so ago, is to >> do what we do with pointers around this. That is

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-28 Thread Chris Lattner via swift-dev
> On Oct 26, 2017, at 11:44 PM, Xiaodi Wu via swift-dev > wrote: > > On Fri, Oct 27, 2017 at 1:30 AM, Jonathan Hull > wrote: > One completely different idea, which I brought up a year or so ago, is to do > what we do with pointers around this. That is you have your fas

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-27 Thread David Sweeris via swift-dev
> On Oct 27, 2017, at 3:06 AM, Jonathan Hull via swift-dev > wrote: > >> >> On Oct 26, 2017, at 11:44 PM, Xiaodi Wu > > wrote: >> >> On Fri, Oct 27, 2017 at 1:30 AM, Jonathan Hull > > wrote: >> One completely different idea, which I brought u

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-27 Thread Jonathan Hull via swift-dev
> On Oct 26, 2017, at 11:44 PM, Xiaodi Wu wrote: > > On Fri, Oct 27, 2017 at 1:30 AM, Jonathan Hull > wrote: > One completely different idea, which I brought up a year or so ago, is to do > what we do with pointers around this. That is you have your fast/unsafe IEEE >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Fri, Oct 27, 2017 at 1:30 AM, Jonathan Hull wrote: > One completely different idea, which I brought up a year or so ago, is to > do what we do with pointers around this. That is you have your fast/unsafe > IEEE Floats/Doubles/etc that have a scarier name. These do not conform to > Equatable

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
One completely different idea, which I brought up a year or so ago, is to do what we do with pointers around this. That is you have your fast/unsafe IEEE Floats/Doubles/etc that have a scarier name. These do not conform to Equatable or Comparable, but have their own version of IEEE equality/co

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Fri, Oct 27, 2017 at 1:09 AM, Jonathan Hull wrote: > > On Oct 26, 2017, at 8:16 PM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 4:34 PM, Jonathan Hull wrote: > >> >> On Oct 26, 2017, at 11:47 AM, Xiaodi Wu wrote: >> >> On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull wrote: >> >>> Now you a

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
> On Oct 26, 2017, at 8:16 PM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 4:34 PM, Jonathan Hull > wrote: > >> On Oct 26, 2017, at 11:47 AM, Xiaodi Wu > > wrote: >> >> On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 4:57 PM, Greg Parker wrote: > > On Oct 26, 2017, at 11:47 AM, Xiaodi Wu via swift-dev > wrote: > > On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull wrote: > >> Now you are just being rude. We all want Swift to be awesome… let’s try >> to keep things civil. >> > > Sorry if

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 4:34 PM, Jonathan Hull wrote: > > On Oct 26, 2017, at 11:47 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull wrote: > >> Now you are just being rude. We all want Swift to be awesome… let’s try >> to keep things civil. >> > > Sorry if my reply came

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread David Sweeris via swift-dev
> On Oct 26, 2017, at 3:16 PM, Matthew Johnson wrote: > >> >> On Oct 26, 2017, at 5:12 PM, David Sweeris via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> >>> On Oct 26, 2017, at 2:57 PM, Greg Parker via swift-dev >> > wrote: >>> On Oct 26, 20

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Matthew Johnson via swift-dev
> On Oct 26, 2017, at 5:12 PM, David Sweeris via swift-dev > wrote: > > >> On Oct 26, 2017, at 2:57 PM, Greg Parker via swift-dev > > wrote: >> >>> >>> On Oct 26, 2017, at 11:47 AM, Xiaodi Wu via swift-dev >> > wrote: >>> >>> On Thu, O

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread David Sweeris via swift-dev
> On Oct 26, 2017, at 2:57 PM, Greg Parker via swift-dev > wrote: > >> >> On Oct 26, 2017, at 11:47 AM, Xiaodi Wu via swift-dev > > wrote: >> >> On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull > > wrote: >> Now you are just being rude. We all

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Greg Parker via swift-dev
> On Oct 26, 2017, at 11:47 AM, Xiaodi Wu via swift-dev > wrote: > > On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull > wrote: > Now you are just being rude. We all want Swift to be awesome… let’s try to > keep things civil. > > Sorry if my reply came across that way! Th

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
> On Oct 26, 2017, at 11:47 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull > wrote: > Now you are just being rude. We all want Swift to be awesome… let’s try to > keep things civil. > > Sorry if my reply came across that way! That wasn't at all

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 1:30 PM, Jonathan Hull wrote: > Now you are just being rude. We all want Swift to be awesome… let’s try to > keep things civil. > Sorry if my reply came across that way! That wasn't at all the intention. I really mean to ask you those questions and am interested in the an

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
Now you are just being rude. We all want Swift to be awesome… let’s try to keep things civil. You said it was impossible, so I gave you a very quick example showing that the current behavior was still possible. I wasn’t recommending that everyone should only ever use that example for all thing

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 11:50 AM, Jonathan Hull wrote: > > On Oct 26, 2017, at 9:40 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 11:38 AM, Jonathan Hull wrote: > >> >> On Oct 26, 2017, at 9:34 AM, Xiaodi Wu wrote: >> >> On Thu, Oct 26, 2017 at 10:57 AM, Jonathan Hull wrote: >> >>> >>> On

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread David Sweeris via swift-dev
> On Oct 26, 2017, at 9:40 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 11:38 AM, Jonathan Hull > wrote: > >> On Oct 26, 2017, at 9:34 AM, Xiaodi Wu > > wrote: >> >> On Thu, Oct 26, 2017 at 10:57 AM, Jonathan Hull >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
> On Oct 26, 2017, at 9:40 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 11:38 AM, Jonathan Hull > wrote: > >> On Oct 26, 2017, at 9:34 AM, Xiaodi Wu > > wrote: >> >> On Thu, Oct 26, 2017 at 10:57 AM, Jonathan Hull >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 11:38 AM, Jonathan Hull wrote: > > On Oct 26, 2017, at 9:34 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 10:57 AM, Jonathan Hull wrote: > >> >> On Oct 26, 2017, at 8:19 AM, Xiaodi Wu wrote: >> >> >> On Thu, Oct 26, 2017 at 07:52 Jonathan Hull wrote: >> >>> On Oct 2

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
> On Oct 26, 2017, at 9:34 AM, Xiaodi Wu wrote: > > On Thu, Oct 26, 2017 at 10:57 AM, Jonathan Hull > wrote: > >> On Oct 26, 2017, at 8:19 AM, Xiaodi Wu > > wrote: >> >> >> On Thu, Oct 26, 2017 at 07:52 Jonathan Hull >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 10:57 AM, Jonathan Hull wrote: > > On Oct 26, 2017, at 8:19 AM, Xiaodi Wu wrote: > > > On Thu, Oct 26, 2017 at 07:52 Jonathan Hull wrote: > >> On Oct 25, 2017, at 11:22 PM, Xiaodi Wu wrote: >> >> On Wed, Oct 25, 2017 at 11:46 PM, Jonathan Hull wrote: >> >>> As someone

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
> On Oct 26, 2017, at 8:19 AM, Xiaodi Wu wrote: > > > On Thu, Oct 26, 2017 at 07:52 Jonathan Hull > wrote: >> On Oct 25, 2017, at 11:22 PM, Xiaodi Wu > > wrote: >> >> On Wed, Oct 25, 2017 at 11:46 PM, Jonathan Hull > >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Xiaodi Wu via swift-dev
On Thu, Oct 26, 2017 at 07:52 Jonathan Hull wrote: > On Oct 25, 2017, at 11:22 PM, Xiaodi Wu wrote: > > On Wed, Oct 25, 2017 at 11:46 PM, Jonathan Hull wrote: > >> As someone mentioned earlier, we are trying to square a circle here. We >> can’t have everything at once… we will have to prioritiz

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-26 Thread Jonathan Hull via swift-dev
> On Oct 25, 2017, at 11:22 PM, Xiaodi Wu wrote: > > On Wed, Oct 25, 2017 at 11:46 PM, Jonathan Hull > wrote: > As someone mentioned earlier, we are trying to square a circle here. We can’t > have everything at once… we will have to prioritize. I feel like the > preced

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Xiaodi Wu via swift-dev
On Wed, Oct 25, 2017 at 11:46 PM, Jonathan Hull wrote: > As someone mentioned earlier, we are trying to square a circle here. We > can’t have everything at once… we will have to prioritize. I feel like the > precedent in Swift is to prioritize safety/correctness with an option > ignore safety an

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Xiaodi Wu via swift-dev
On Wed, Oct 25, 2017 at 9:05 PM, David Zarzycki wrote: > > > On Oct 25, 2017, at 19:25, Xiaodi Wu wrote: > > I was proposing something different where Float and Int are both Equatable >> and Substitutable, but neither Equatable nor Substitutable inherit from the >> other. The former is mathemati

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Jonathan Hull via swift-dev
As someone mentioned earlier, we are trying to square a circle here. We can’t have everything at once… we will have to prioritize. I feel like the precedent in Swift is to prioritize safety/correctness with an option ignore safety and regain speed. I think the 3 point solution I proposed is a

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread David Zarzycki via swift-dev
> On Oct 25, 2017, at 19:25, Xiaodi Wu wrote: > > I was proposing something different where Float and Int are both Equatable > and Substitutable, but neither Equatable nor Substitutable inherit from the > other. The former is mathematical and the latter is not (which allows it to > deal with

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Xiaodi Wu via swift-dev
On Wed, Oct 25, 2017 at 8:26 PM, Jonathan Hull wrote: > > On Oct 25, 2017, at 9:01 AM, David Sweeris via swift-dev < > swift-dev@swift.org> wrote: > > > > That said, I fully acknowledge that this is all above my pay grade (also > I hadn't realized that the issue was as settled as it apparently is

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Jonathan Hull via swift-dev
> On Oct 25, 2017, at 9:01 AM, David Sweeris via swift-dev > wrote: > > That said, I fully acknowledge that this is all above my pay grade (also I > hadn't realized that the issue was as settled as it apparently is). If > splitting the protocols is a no-go from the get go, I'll go back to tryi

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Xiaodi Wu via swift-dev
On Wed, Oct 25, 2017 at 12:06 PM, David Zarzycki wrote: > > > On Oct 25, 2017, at 12:01, David Sweeris wrote: > > > On Oct 25, 2017, at 5:29 AM, David Zarzycki via swift-dev < > swift-dev@swift.org> wrote: > > > > On Oct 25, 2017, at 02:34, Xiaodi Wu via swift-dev > wrote: > > Please see earlie

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread David Zarzycki via swift-dev
> On Oct 25, 2017, at 12:01, David Sweeris wrote: > > >> On Oct 25, 2017, at 5:29 AM, David Zarzycki via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> >> >>> On Oct 25, 2017, at 02:34, Xiaodi Wu via swift-dev >> > wrote: >>> >>> Please see earlier repl

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread David Sweeris via swift-dev
> On Oct 25, 2017, at 5:29 AM, David Zarzycki via swift-dev > wrote: > > > >> On Oct 25, 2017, at 02:34, Xiaodi Wu via swift-dev > > wrote: >> >> Please see earlier replies summarizing core team members' persuasive >> arguments as to why not multiple protocol hie

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread David Zarzycki via swift-dev
> On Oct 25, 2017, at 08:29, David Zarzycki via swift-dev > wrote: > > > >> On Oct 25, 2017, at 02:34, Xiaodi Wu via swift-dev > > wrote: >> >> Please see earlier replies summarizing core team members' persuasive >> arguments as to why not multiple protocol hier

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread David Zarzycki via swift-dev
> On Oct 25, 2017, at 02:34, Xiaodi Wu via swift-dev > wrote: > > Please see earlier replies summarizing core team members' persuasive > arguments as to why not multiple protocol hierarchies like this. Hi Xiaodi, The above line is does it help your argument. Even if a person was motivated t

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Jonathan Hull via swift-dev
One possibility which might be easier would be to just depreciate Float’s Equatable conformance and provide a warning/fixit (suggesting how to use the new ‘~’ relation). > On Oct 25, 2017, at 2:35 AM, Jonathan Hull wrote: > > There is something interesting here. I like that ‘Bool?’ really rep

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-25 Thread Jonathan Hull via swift-dev
There is something interesting here. I like that ‘Bool?’ really represents what we need from the relation on Float. I think it solves the objection that Xiaodi mentioned with a PartialEq protocol. If everyone just switches to using PartialEq in generic contexts because they want it to work wi

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread Xiaodi Wu via swift-dev
On Wed, Oct 25, 2017 at 1:24 AM, David Sweeris wrote: > > On Oct 24, 2017, at 9:06 PM, Xiaodi Wu via swift-dev > wrote: > > On Tue, Oct 24, 2017 at 10:08 PM, Ben Cohen wrote: > >> >> >> On Oct 24, 2017, at 6:48 PM, Xiaodi Wu wrote: >> >> On Tue, Oct 24, 2017 at 1:55 PM, Ben Cohen wrote: >> >>

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread David Sweeris via swift-dev
> On Oct 24, 2017, at 9:06 PM, Xiaodi Wu via swift-dev > wrote: > > On Tue, Oct 24, 2017 at 10:08 PM, Ben Cohen > wrote: > > > On Oct 24, 2017, at 6:48 PM, Xiaodi Wu > wrote: > >> On Tue, Oct 24, 2017 at 1:55 PM, Ben Cohen >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread Xiaodi Wu via swift-dev
On Tue, Oct 24, 2017 at 10:08 PM, Ben Cohen wrote: > > > On Oct 24, 2017, at 6:48 PM, Xiaodi Wu wrote: > > On Tue, Oct 24, 2017 at 1:55 PM, Ben Cohen wrote: > >> >> >> On Oct 19, 2017, at 4:29 PM, Xiaodi Wu via swift-dev >> wrote: >> >> Differing behavior in generic and concrete contexts is si

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread Ben Cohen via swift-dev
> On Oct 24, 2017, at 6:48 PM, Xiaodi Wu wrote: > >> On Tue, Oct 24, 2017 at 1:55 PM, Ben Cohen wrote: >> >> >>> On Oct 19, 2017, at 4:29 PM, Xiaodi Wu via swift-dev >>> wrote: >>> >>> Differing behavior in generic and concrete contexts is simply too subtle to >>> be understandable to th

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread David Zarzycki via swift-dev
> On Oct 24, 2017, at 22:04, Xiaodi Wu via swift-dev > wrote: > > On Tue, Oct 24, 2017 at 4:28 PM, David Zarzycki > wrote: > > >> On Oct 24, 2017, at 14:55, Ben Cohen via swift-dev > > wrote: >> >> There really is no way to square this circle

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread Xiaodi Wu via swift-dev
On Tue, Oct 24, 2017 at 4:28 PM, David Zarzycki wrote: > > > On Oct 24, 2017, at 14:55, Ben Cohen via swift-dev > wrote: > > There really is no way to square this circle. Every option is going to > have downsides. We have to balance correctness, least surprise/most > expected behavior for most p

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread Xiaodi Wu via swift-dev
On Tue, Oct 24, 2017 at 1:55 PM, Ben Cohen wrote: > > > On Oct 19, 2017, at 4:29 PM, Xiaodi Wu via swift-dev > wrote: > > Differing behavior in generic and concrete contexts is simply too subtle > to be understandable to the reader. > > > Hardly more subtle then the current “Equatable works like

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread David Zarzycki via swift-dev
> On Oct 24, 2017, at 14:55, Ben Cohen via swift-dev > wrote: > > There really is no way to square this circle. Every option is going to have > downsides. We have to balance correctness, least surprise/most expected > behavior for most people, and consistency. For me, making generic use of

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-24 Thread Ben Cohen via swift-dev
> On Oct 19, 2017, at 4:29 PM, Xiaodi Wu via swift-dev > wrote: > > Differing behavior in generic and concrete contexts is simply too subtle to > be understandable to the reader. Hardly more subtle then the current “Equatable works like this, with these strong gua

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-23 Thread Xiaodi Wu via swift-dev
On Mon, Oct 23, 2017 at 12:47 AM, Brent Royal-Gordon wrote: > > On Oct 21, 2017, at 6:27 PM, Xiaodi Wu via swift-dev < > swift-dev@swift.org> wrote: > > > > Steve can describe the exact number of additional machine instructions > on each architecture, but from my cursory reading the performance c

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-23 Thread Stephen Canon via swift-dev
> On Oct 23, 2017, at 1:47 AM, Brent Royal-Gordon via swift-dev > wrote: > >> On Oct 21, 2017, at 6:27 PM, Xiaodi Wu via swift-dev >> wrote: >> >> Steve can describe the exact number of additional machine instructions on >> each architecture, but from my cursory reading the performance cos

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-22 Thread Brent Royal-Gordon via swift-dev
> On Oct 21, 2017, at 6:27 PM, Xiaodi Wu via swift-dev > wrote: > > Steve can describe the exact number of additional machine instructions on > each architecture, but from my cursory reading the performance cost is not > good and there's little cleverness to be had. I'm not sure why you think

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-21 Thread Xiaodi Wu via swift-dev
On Sat, Oct 21, 2017 at 10:16 PM, Jonathan Hull wrote: > > On Oct 21, 2017, at 6:27 PM, Xiaodi Wu wrote: > > On Sat, Oct 21, 2017 at 7:52 PM, Jonathan Hull wrote: > >> >> On Oct 21, 2017, at 3:02 PM, Xiaodi Wu wrote: >> >> On Fri, Oct 20, 2017 at 2:42 PM, Stephen Canon wrote: >> >>> On Oct 20

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-21 Thread Jonathan Hull via swift-dev
> On Oct 21, 2017, at 6:27 PM, Xiaodi Wu wrote: > > On Sat, Oct 21, 2017 at 7:52 PM, Jonathan Hull > wrote: > >> On Oct 21, 2017, at 3:02 PM, Xiaodi Wu > > wrote: >> >> On Fri, Oct 20, 2017 at 2:42 PM, Stephen Canon >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-21 Thread Xiaodi Wu via swift-dev
On Sat, Oct 21, 2017 at 7:52 PM, Jonathan Hull wrote: > > On Oct 21, 2017, at 3:02 PM, Xiaodi Wu wrote: > > On Fri, Oct 20, 2017 at 2:42 PM, Stephen Canon wrote: > >> On Oct 20, 2017, at 8:21 AM, David Zarzycki via swift-dev < >> swift-dev@swift.org> wrote: >> >> >> On Oct 20, 2017, at 07:51, X

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-21 Thread Jonathan Hull via swift-dev
> On Oct 21, 2017, at 3:02 PM, Xiaodi Wu wrote: > > On Fri, Oct 20, 2017 at 2:42 PM, Stephen Canon > wrote: >> On Oct 20, 2017, at 8:21 AM, David Zarzycki via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >>> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev >>

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-21 Thread Xiaodi Wu via swift-dev
On Fri, Oct 20, 2017 at 2:42 PM, Stephen Canon wrote: > On Oct 20, 2017, at 8:21 AM, David Zarzycki via swift-dev < > swift-dev@swift.org> wrote: > > > On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev > wrote: > > On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull wrote: > >> +1 for trapping unle

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Stephen Canon via swift-dev
> On Oct 20, 2017, at 8:21 AM, David Zarzycki via swift-dev > wrote: > >> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev > > wrote: >> >> On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull > > wrote: >> +1 for trapping unless using &==. In the

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Michael Gottesman via swift-dev
Before you guys decide anything, I would wait for Steve Canon to look at this. +CC Steve Michael > On Oct 20, 2017, at 10:21 AM, Xiaodi Wu via swift-dev > wrote: > > > On Fri, Oct 20, 2017 at 10:10 Matthew Johnson > wrote: >> On Oct 20, 2017, at 9:36 AM, Xiaod

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Jonathan Hull via swift-dev
I can support that. > On Oct 20, 2017, at 10:21 AM, Xiaodi Wu wrote: > > > On Fri, Oct 20, 2017 at 10:10 Matthew Johnson > wrote: >> On Oct 20, 2017, at 9:36 AM, Xiaodi Wu via swift-dev > > wrote: >> >> >> On Fri, Oct 20, 2017 at 07:

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Xiaodi Wu via swift-dev
On Fri, Oct 20, 2017 at 10:10 Matthew Johnson wrote: > On Oct 20, 2017, at 9:36 AM, Xiaodi Wu via swift-dev > wrote: > > > On Fri, Oct 20, 2017 at 07:21 David Zarzycki wrote: > >> >> >> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev >> wrote: >> >> On Fri, Oct 20, 2017 at 1:22 AM, Jonathan

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Xiaodi Wu via swift-dev
On Fri, Oct 20, 2017 at 10:05 Jonathan Hull wrote: > > On Oct 20, 2017, at 7:36 AM, Xiaodi Wu wrote: > > > On Fri, Oct 20, 2017 at 07:21 David Zarzycki wrote: > >> >> >> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev >> wrote: >> >> On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull wrote: >>

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Matthew Johnson via swift-dev
> On Oct 20, 2017, at 9:36 AM, Xiaodi Wu via swift-dev > wrote: > > > On Fri, Oct 20, 2017 at 07:21 David Zarzycki > wrote: > > >> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev > > wrote: >> >> On Fri, Oct 20, 2017 at 1:22 AM, Jonathan H

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Jonathan Hull via swift-dev
> On Oct 20, 2017, at 7:36 AM, Xiaodi Wu wrote: > > > On Fri, Oct 20, 2017 at 07:21 David Zarzycki > wrote: > > >> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev > > wrote: >> >> On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Xiaodi Wu via swift-dev
On Fri, Oct 20, 2017 at 07:21 David Zarzycki wrote: > > > On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev > wrote: > > On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull wrote: > >> +1 for trapping unless using &==. In the case of ‘Float?’ we could also >> map to nil. >> >> This is probably a m

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread David Zarzycki via swift-dev
> On Oct 20, 2017, at 07:51, Xiaodi Wu via swift-dev > wrote: > > On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull > wrote: > +1 for trapping unless using &==. In the case of ‘Float?’ we could also map > to nil. > > This is probably a more appropriate discussion for ev

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-20 Thread Xiaodi Wu via swift-dev
On Fri, Oct 20, 2017 at 1:22 AM, Jonathan Hull wrote: > +1 for trapping unless using &==. In the case of ‘Float?’ we could also > map to nil. > > This is probably a more appropriate discussion for evolution though... > > > On Oct 19, 2017, at 9:48 PM, Brent Royal-Gordon via swift-dev < > swift-d

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-19 Thread Jonathan Hull via swift-dev
+1 for trapping unless using &==. In the case of ‘Float?’ we could also map to nil. This is probably a more appropriate discussion for evolution though... > On Oct 19, 2017, at 9:48 PM, Brent Royal-Gordon via swift-dev > wrote: > >> On Oct 19, 2017, at 4:29 PM, Xiaodi Wu via swift-dev >

Re: [swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-19 Thread Brent Royal-Gordon via swift-dev
> On Oct 19, 2017, at 4:29 PM, Xiaodi Wu via swift-dev > wrote: > > D) Must floating-point IEEE-compliant equivalence be spelled `==`? > > In my view, this is something open for debate. I see no reason why it cannot > be migrated to `&==` if it were felt that `==` *must* be a full equivalence

[swift-dev] Rationalizing FloatingPoint conformance to Equatable

2017-10-19 Thread Xiaodi Wu via swift-dev
Ben Cohen asked to continue this conversation on swift-dev-- Included in PR #12503 is a small tweak to accommodate so-called "exceptional values" (such as NaN) in comparisons of array equality. Currently, `Array.==` first looks to referential equality of underlying buffers, then (if false) compa