Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Pavol Vaskovic via swift-evolution
On Tue, May 30, 2017 at 7:51 AM, David Sweeris wrote: > > `(Int, Int, Int, Int)` isn't *that* horrible compared to "[Int x 4]", but > would you want to replace "[Int8 x 1]" with the multipage-long tuple > equivalent? > 😳 It would be really helpful to my understanding, if you spoke about a pr

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Charlie Monroe via swift-evolution
There was someone a few weeks ago trying to port his Go game to Swift from (I believe) C++ and found out that the lack of fixed-size arrays was causing the move-computing algorithm to slow down significantly. This is due to fixed arrays being able to live on stack, while "normal Array" is dynam

Re: [swift-evolution] Revisiting SE-0110

2017-05-30 Thread Nevin Brackett-Rozinsky via swift-evolution
On Mon, May 29, 2017 at 10:47 PM, Robert Bennett wrote: > I think the goal of SE 0110 and to a lesser extent 0066 was to disallow > this level of intelligence in the compiler. > Interesting. I happen to think that the goal of SE–110

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread David Sweeris via swift-evolution
> On May 30, 2017, at 03:25, Pavol Vaskovic wrote: > >> On Tue, May 30, 2017 at 7:51 AM, David Sweeris wrote: >> >> `(Int, Int, Int, Int)` isn't *that* horrible compared to "[Int x 4]", but >> would you want to replace "[Int8 x 1]" with the multipage-long tuple >> equivalent? > > 😳 > It

Re: [swift-evolution] Question regarding SE-0167 Swift Encoders

2017-05-30 Thread Itai Ferber via swift-evolution
Hi Gwendal, There are no stupid questions — everything helps hammer out this API, so I appreciate you taking the time to look at this so deeply. I have to confess that I’m not familiar with this concept, but let’s take a look: ```swift if let valueType = T.self as? DatabaseValueConvertible.Ty

Re: [swift-evolution] Derived Equatable conformance akin to Codable

2017-05-30 Thread Dave Abrahams via swift-evolution
on Fri May 26 2017, Logan Shire wrote: > Given we now have precedent in the form of the derived Codable conformance > coming in Swift 4.0, > it begs the question why we don’t offer the same behavior for value types > that declare themselves to > be Equatable > and have all Equatable properties

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Michael Ilseman via swift-evolution
> On May 27, 2017, at 10:40 AM, Dave Abrahams via swift-evolution > wrote: > > > Pretty version: > https://github.com/dabrahams/swift-evolution/blob/string-index-overhaul/proposals/-string-index-overhaul.md > > > > # String Index Overhaul > > * Proposal: [SE-](-string-inde

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Robert Bennett via swift-evolution
I agree that Swift absolutely needs a static array type. However, until then, here's a gist to generate the code for a static array struct: https://gist.github.com/rltbennett/8a750aa61d58746b3ca4531b3ca3d0db . Happy coding. (Disclaimer: barely tested.) > On May 30, 2017, at 11:27 AM, David Swe

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Jordan Rose via swift-evolution
My knee-jerk reaction is to say it's too late in Swift 4 for this kind of change, but with that out of the way, I'm most concerned about what it means to have, say, a UTF-8 index that's not on a UTF-16 boundary. let str = "言" let oneUnitIn = str.utf8.index(after: str.utf8.startIndex) let trailin

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Jean-Daniel via swift-evolution
> Le 30 mai 2017 à 12:42, Charlie Monroe via swift-evolution > a écrit : > > There was someone a few weeks ago trying to port his Go game to Swift from (I > believe) C++ and found out that the lack of fixed-size arrays was causing the > move-computing algorithm to slow down significantly. >

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Robert Bennett via swift-evolution
It's not just about the cost of allocation; heap accesses are incredibly slow compared to stack accesses. > On May 30, 2017, at 5:36 PM, Jean-Daniel via swift-evolution > wrote: > > >> Le 30 mai 2017 à 12:42, Charlie Monroe via swift-evolution >> a écrit : >> >> There was someone a few wee

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Dave Abrahams via swift-evolution
on Tue May 30 2017, Jordan Rose wrote: > My knee-jerk reaction is to say it's too late in Swift 4 for this kind > of change, but with that out of the way, I'm most concerned about what > it means to have, say, a UTF-8 index that's not on a UTF-16 boundary. > > let str = "言" > let oneUnitIn = str

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Dave Abrahams via swift-evolution
on Tue May 30 2017, Michael Ilseman wrote: >> On May 27, 2017, at 10:40 AM, Dave Abrahams via swift-evolution >> wrote: >> >> >> An index that does not fall on an exact boundary in a given `String` >> or `Substring` view will be “rounded down” to the nearest boundary >> when used for slicing

Re: [swift-evolution] Implicit truncation

2017-05-30 Thread Greg Parker via swift-evolution
> On May 26, 2017, at 12:04 AM, Xiaodi Wu via swift-evolution > wrote: > > I've often wondered if even just "bitPattern" might suffice, as the > truncating or extending of it should not be particularly surprising. Being explicit about bit pattern truncation or extension is valuable. It helps

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Dave Abrahams via swift-evolution
on Tue May 30 2017, Jordan Rose wrote: >> On May 30, 2017, at 14:53, Dave Abrahams wrote: >> >> >> on Tue May 30 2017, Jordan Rose wrote: >> >>> My knee-jerk reaction is to say it's too late in Swift 4 for this kind >>> of change, but with that out of the way, I'm most concerned about what

Re: [swift-evolution] Implicit truncation

2017-05-30 Thread Dave Abrahams via swift-evolution
on Tue May 30 2017, Greg Parker wrote: >> On May 26, 2017, at 12:04 AM, Xiaodi Wu via swift-evolution >> wrote: >> >> I've often wondered if even just "bitPattern" might suffice, as the >> truncating or extending of it > should not be particularly surprising. > > Being explicit about bit pat

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Anders Kierulf via swift-evolution
> On May 30, 2017, at 3:36 PM, Jean-Daniel via swift-evolution > wrote: > >> >> Le 30 mai 2017 à 12:42, Charlie Monroe via swift-evolution >> mailto:swift-evolution@swift.org>> a écrit : >> >> There was someone a few weeks ago trying to port his Go game to Swift from >> (I believe) C++ and

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Jordan Rose via swift-evolution
> On May 30, 2017, at 14:53, Dave Abrahams wrote: > > > on Tue May 30 2017, Jordan Rose wrote: > >> My knee-jerk reaction is to say it's too late in Swift 4 for this kind >> of change, but with that out of the way, I'm most concerned about what >> it means to have, say, a UTF-8 index that's n

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Daryle Walker via swift-evolution
On May 29, 2017, at 3:37 AM, Rien wrote:While I’d like a fixed size array, I’d agree with Rod that this looks odd.Myself I use the name ‘array’ a lot in places where I get/need a temporary array that lives for a few lines only. So I am against using the keyword ‘array’.That’s why I hope “array” ca

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Daryle Walker via swift-evolution
On May 29, 2017, at 5:39 PM, Nicolas Fezans via swift-evolution wrote:On Mon 29. May 2017 at 20:57, David Sweeris via swift-evolution wrote:> On May 29, 2017, at 01:12, Tino Heth via swift-evolution wrote:>> I agree strongly that the syntax l

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Daryle Walker via swift-evolution
On May 29, 2017, at 3:21 AM, Rod Brown wrote:While I can’t comment about the technical details, I have to say, this looks really “unswifty” to my eye. I’d probably expect something more along the lines of: let x: FixedArray = [1, 2, 3]or: let y: StaticArray = [1, 2, 3]Generic syntax is intentional

Re: [swift-evolution] Yet another fixed-size array spitball session

2017-05-30 Thread Daryle Walker via swift-evolution
On May 30, 2017, at 2:32 AM, Charlie Monroe via swift-evolution wrote:Sorry if this has been suggested before, but what is wrong with something alonglet x: Int[4]let x: Int<4>In case of multi-dimension arrays:let x: Int[4][4]let x: Int[4, 4]let x: Int<4><4>let x: Int<4, 4>I see small issues with e

Re: [swift-evolution] Pitch: String Index Overhaul

2017-05-30 Thread Jordan Rose via swift-evolution
> On May 30, 2017, at 16:13, Dave Abrahams wrote: > > > on Tue May 30 2017, Jordan Rose > wrote: > >>> On May 30, 2017, at 14:53, Dave Abrahams wrote: >>> >>> >>> on Tue May 30 2017, Jordan Rose wrote: >>> My knee-jerk reaction is to say it's too late in Swift

Re: [swift-evolution] Question regarding SE-0167 Swift Encoders

2017-05-30 Thread Gwendal Roué via swift-evolution
Hello Itai, Thanks for helping sorting things out. I have since my initial question a better understanding of Codable, and I hope I can better express the trouble. I bump against the fact that SE-0166 and SE-0167 assume that there is a single kind of coding keys. This is the case for JSON and

[swift-evolution] [Meta] WWDC week

2017-05-30 Thread Brent Royal-Gordon via swift-evolution
I'm going to be in San Jose during WWDC next week, and I'm assuming I won't be the only one. Are there any swift-evolution meetings or events planned? Personally, I'd love to put some faces to names (not that I'm very good with faces, or names for that matter). -- Brent Royal-Gordon Architechi

Re: [swift-evolution] [Meta] WWDC week

2017-05-30 Thread Jonathan Hull via swift-evolution
I’ll be in the area. Not sure where the parties will be yet, but I am happy to meet up with everyone… > On May 30, 2017, at 10:26 PM, Brent Royal-Gordon via swift-evolution > wrote: > > I'm going to be in San Jose during WWDC next week, and I'm assuming I won't > be the only one. Are there

Re: [swift-evolution] [Meta] WWDC week

2017-05-30 Thread David Hart via swift-evolution
I'll be there too. I don't think there is a swift-evo meeting organized. If there is, please let me know. If not, we could all try to meet some evening. Don't know SJ so don't know where. > On 31 May 2017, at 07:45, Jonathan Hull via swift-evolution > wrote: > > I’ll be in the area. Not sure