First off, thanks for writing this proposal. I'm excited to see it and I hope it's just the start of dependent types making it into Swift! I've been studying dependent types for a number of years now and I think they're (a big part of) the future. Writing down your specification in the language of types, which then all-but-forces you to pick an implementation, is a really satisfying workflow and the result is quite readable.
- What is your evaluation of the proposal?
+0, as I have a few questions.
Are the only methods that will be present on this type the ones that are presented in this proposal, particularly the ones under "Generalized Sequence and Collection APIs"? I'm writing my review assuming the answer to this question is "yes".
What level of static computation is available? Can one write append for vectors of length N and M? How about repeat(k) which gives a vector of length k*N?
- Is the problem being addressed significant enough to warrant a change to Swift?
Absolutely, yes. This is one of the most basic dependent types and if Swift is going to support complex and subtle static requirements such as lifetimes, having dependently typed containers will likely be crucial. Plus, there are a million other reasons to support dependent types, I won't go through them all here.
- Does this proposal fit well with the feel and direction of Swift?
Given the lack of conformances, I think the answer is unfortunately no.
While it's possible to write most collection-manipulation code using the handful of methods provided, it's not going to be as pretty and certainly won't be idiomatic Swift. Porting code that manually loops over indices or re-implements library functions using swap, especially if your code has to compile against more than one version of Swift (for example in a third party library), will be pretty painful.
- If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
I've used a number of dependently typed languages, most notably Agda. I like that the name Vector is the same as you'll find in the literature on dependent types.
- How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Read through the proposal.
If there is some need to put this type in place now in its nerf'd state, I understand, but that hasn't been articulated well. I'm not against this type going in per-se, but I think it will be received better and adopted faster if it's introduced in a more complete state.
If my assumption (at the top of this message) is wrong, and a more complete set of methods will be available on the type despite it not conforming, then I'm probably in the +1 camp. Likewise, if there's some other feature that needs this, I'm not against this going in.