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

Tino Heth 2th at gmx.de
Mon Aug 7 06:11:54 CDT 2017


> We don’t want to add conformance then find out that was a mistake.
I think we also don't want to create restrictions based on future additions that might never happen...

> Besides that they can’t be Sequences, unless you throw away allowing parallel/vector processing in the future. (That can’t be bolted onto Version 2, since committing to Sequence means you committed to single-thread iteration.)
… especially as I doubt that those restrictions are required at all:
As I said, just conforming to collection doesn't forbid to add things that aren't in the protocol.
Why should it be impossible to add vector processing support when it is decided that this feature should be added to the language?

Parallel processing would be nice for Array<T> as well — and I can't think of someone really arguing to remove conformance to Sequence from Array now…

The situation is very different with Array<T, size: Int>:
If it is decided to add generic value parameters* to Swift, it imho would be awkward not to utilise this powerful for fixed-size arrays, and all those syntax-additions that are discussed for them would become very questionable at least.

Tino
Which imho definitely should happen: Whereas many additions to Swift are more a less a question of personal preference, generic value parameters offer protection from some kinds of bugs whose severity can actually be proven with real-word examples that had terrible consequences.

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


More information about the swift-evolution mailing list