Review Update
The core team met and discussed the feedback received so far, and has made the following recommendations:
Intention to accept
The core team feels this is an important addition to the language that will open up SIMD programming to a wide audience in an approachable way.
The core team also made the following decisions for when the proposal is accepted:
- There were many requests for additional math operations. These are certainly important, but can be left to later proposals once this foundational proposal has landed.
- The initializers for
VectorN
from anArray
should instead be generic from anySequence
. - The
.
prefix should be used on all mask-producing operators:- In case of
.==
, this helps disambiguate between theBool
andMask
-returning forms - In case of
.&
and.|
this helps resolve the precedence problem of&
and the inconsistency of a non-short-circuiting&&
- While it doesn't have similar motivations, for consistency
.<
& co should also have a leading dot.
- In case of
- Pointwise arithmetic operations will not have a leading dot.
- To avoid confusion with
Collection
semantics and future types like matrices,count
should be renamedelementCount
- The element properties
x
,y
,z
andw
will be available on vectors of up to 4, along with the common named swizzleseven
,odd
,high
andlow
.- The general swizzle operation
init(gathering:at:)
feels unsatisfactory, and so should be deferred for a later proposal after more thought. - Brute-forcing all possible swizzles on the smaller vectors as properties was also ruled out.
- The general swizzle operation
Prototype of "generic"-style vectors
The majority of the feedback received during the thread was regarding the alternate "generic" spelling: Vector3<Int8>
rather than Int8.Vector3
.
It is still unclear which is the better form. However, in order to better make the decision, the core team has asked the proposal author to implement a prototype showing the alternate form. Reviewers will then be able to try out either form in order to help make the decision. (since @scanon is on vacation this week, @moiseev is kindly helping out with this prototype)
In addition, the proposal should be revised to spell out more explicitly some of the details, for example, of what masks are and the role they play.
We will hold the review open pending that prototype, and I'll post again when it's available.