[swift-evolution] [Pitch] New Version of Array Proposal

Daryle Walker darylew at mac.com
Sun Jul 23 22:05:03 CDT 2017


> On Jul 23, 2017, at 5:49 PM, David Sweeris via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> On Jul 23, 2017, at 12:18, Taylor Swift <kelvin13ma at gmail.com <mailto:kelvin13ma at gmail.com>> wrote:
> 
>> I don’t think tuples are a suitable replacement for FSAs. A tuple should be able to be broken up and optimized by the compiler, and have no contiguity guarantees in memory.
> 
> 
> C's static arrays are imported as tuples, which need at least some level of contiguity guarantees to work. Even if tuples in general make that such a guarantee, tuple-based FSAs could use the same compiler logic as imported C arrays.

I think that’s supposed to be a workaround solution, not a map going forward. By having to support C-array conversion, tuples have to give up tuple-specific optimizations, like rearranging members and contiguity. Adding FSAs (with a distinct internal representation) will let the two have different optimizations.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170723/b43bea48/attachment.html>


More information about the swift-evolution mailing list