SR-122 / CollectionsMoveIndices.swift Prototype

Feel free and have fun ;)

···

On Thu, Feb 25, 2016 at 1:48 PM Austin Zheng <austinzheng@gmail.com> wrote:

This is great stuff. Shawn, do you have any objections to me picking up
your stuff and continuing while you're out of town?

Austin

On Thu, Feb 25, 2016 at 12:54 PM, Dave Abrahams <dabrahams@apple.com> > wrote:

on Wed Feb 24 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

> So I have made some progress on things.
>
> The first PR has been pulled in Apple's branch...
> [stdlib] - overlaying new index model on existing Collection by shawnce · Pull Request #1413 · apple/swift · GitHub
>
> The second PR is a work in progress...
> [stdlib] - WIP replacing aspects of ForwardIndex with those from Collection by shawnce · Pull Request #1418 · apple/swift · GitHub
>
> Things compile but many tests are failing because of purposely added
> fatalError markers in the code.
>
> I am at a point that it is becoming more difficult to keep things
compiling
> (I can still make some more progress however). Soon it looks like more
of
> the prototype needs to be integrated into / replace existing code. Also
a
> few classes likely need to be rethought given these changes. I not fully
> sure of these aspects at this time.
>
> I also see a good amount of change taking place related to API naming
that
> will/is conflict with change I need to make. It may make sense to pause
for
> a bit while more of that gets worked out (at least in some areas).

That should be settling down in the next day.

> Anyway I need to head out of town for a couple of days and likely won't
> have much time to make progress on this as a result.

Thanks for all your work to date!

--
-Dave

Hi Shawn,

I’ve done the following:
Merged latest stable into llvm/swift-3-indexing-model
Merged latest stable into clang/swift-3-indexing-model
Merged latest swift-3-api-guidelines into swift/swift-3-indexing-model (there was Just One Conflict! in CMakeFiles.txt)

swift/utils/build-script -R gives no errors, which, I assume, is a success at this point =)

max

···

On Mar 1, 2016, at 3:33 PM, Shawn Erickson <shawnce@gmail.com> wrote:

I am back and starting to work on this effort again.

I think it may be time to get swift/swift-3-indexing-model branch in Apple's repo updated to the latest stable from swift-3-api-guidelines. I can then merge the latest into my changes.

Also it may be time to see if the following two branches of llvm and clang that I have been using are still up-to-date enough. Things appear to be working but just wondering if I am missing out on some improvements, etc.

--- Updating '/Users/shawnce/Documents/Development/apple_swift/llvm' ---
Current branch swift-3-indexing-model is up to date.
--- Updating '/Users/shawnce/Documents/Development/apple_swift/clang' ---
Current branch swift-3-indexing-model is up to date.

I will need help of Apple folks to get these branches moved forward (likely cleaner then me doing that in forks of my own).

Anything to attempt on strings? I see you are considering consolidating down to
a single index type for those, etc. Of course you also imply a large string
rework that may happen in the future.

Yes, Strings need the same treatment (though it may be a bit simpler
since one doesn't have to unwind the broken double-indirection hack
mentioned in the paper).

···

on Mon Apr 11 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

-Shawn

On Mon, Apr 11, 2016 at 11:07 AM Dave Abrahams <dabrahams@apple.com> wrote:

    on Sun Apr 10 2016, Austin Zheng <austinzheng-AT-gmail.com> wrote:

    > I'm really sorry for dropping the ball and disappearing off the list. I'd
    like
    > to help out if I can. I'll check out the current branch tomorrow and see
    what
    > the status of the work is, but let me know if everything is done
    already/there's
    > something in particular that should be worked on.

    Dmitri may have other ideas, but one thing we haven't done is to take
    advantage of the new model by removing references from indices. I'd
    like to prove that the new model does what it's supposed to. You might
    try simplifying the indices for Set and Dictionary. It should be
    possible to represent them as a wrapper around an Int.

    >
    >
    > Austin
    >
    > On Mon, Mar 21, 2016 at 11:39 AM, Shawn Erickson <shawnce@gmail.com> > wrote:
    >
    > Anything I can help with on this effort? It looks like things are moving
    > along among the Apple folks. Not sure how to jump in without stepping on
    in
    > flight work, etc.
    >
    > On Tue, Mar 15, 2016 at 1:39 AM Dmitri Gribenko <gribozavr@gmail.com> > wrote:
    >
    > On Mon, Mar 14, 2016 at 7:59 PM, Shawn Erickson <shawnce@gmail.com> wrote:
    > >
    > >
    > > On Thu, Mar 10, 2016 at 10:49 PM Dmitri Gribenko <gribozavr@gmail.com> > > > wrote:
    > >>
    > >> Hi everyone,
    > >>
    > >> I just wanted to announce that we have sufficient change on the
    > >> swift-3-indexing-model branch so that we can build the core standard
    > >> library and StdlibUnittest. We achieved this by putting the protocol
    > >> new structure into place, and stubbing out with fatalError() or just
    > >> commenting out parts that didn't compile. Now we have a baseline that
    > >> we won't regress, and we are starting to work towards improving it,
    > >> making existing tests pass, and then writing new tests, and
    > addressing
    > >> TODOs and FIXMEs that we left in the code as we were doing the first
    > >> pass.
    > >>
    > >> Here's the most recent pull request from Shawn where he starts to fix
    > >> the tests: WIP - New indexing model: fixed compile issues in various stdlib tests, mor… by shawnce · Pull Request #1632 · apple/swift · GitHub
    > >>
    > >> Now we are in the "massively-parallel" stage of this project and we,
    > >> as always, welcome contributions to this branch!
    > >
    > >
    > > FYI
    > >
    > > I am working on the following:
    > >
    > > FAIL: Swift :: 1_stdlib/StringDiagnostics.swift
    > > FAIL: Swift :: 1_stdlib/StringDiagnostics_without_Foundation.swift
    > > ...and looking at converting String.XxxxIndexes to the new index style
    > while
    > > maintaining existing public API.
    >
    > There doesn't seem to be many tests actively failing in the primary
    > testsuite, so I'll be working on making StdlibCollectionUnittest
    > compile, which will allow us to run the validation testsuite.
    >
    > Dmitri
    >
    > --
    > main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
    > (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/
    >

    --
    Dave

--
Dave

This is hugely important, probably more important than what I
suggested. If Dmitri can use your help, it would be best to work with
him on that.

···

on Mon Apr 11 2016, Dmitri Gribenko <gribozavr-AT-gmail.com> wrote:

On Mon, Apr 11, 2016 at 11:07 AM, Dave Abrahams <dabrahams@apple.com> wrote:

on Sun Apr 10 2016, Austin Zheng <austinzheng-AT-gmail.com> wrote:

I'm really sorry for dropping the ball and disappearing off the list. I'd like
to help out if I can. I'll check out the current branch tomorrow and see what
the status of the work is, but let me know if everything is done already/there's
something in particular that should be worked on.

Dmitri may have other ideas, but one thing we haven't done is to take
advantage of the new model by removing references from indices. I'd
like to prove that the new model does what it's supposed to. You might
try simplifying the indices for Set and Dictionary. It should be
possible to represent them as a wrapper around an Int.

String could also make use of such simplification.

Another important task is writing tests for new APIs, such as range
APIs and collection APIs.

--
Dave

I was going to start working on String indices since I had some changes
stashed from a while back that make still make sense. Then I could likely
help with building out tests as well. Would want to coordinate that with
folks some how.

-Shawn

···

On Mon, Apr 11, 2016 at 11:42 AM Dave Abrahams <dabrahams@apple.com> wrote:

on Mon Apr 11 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

> Anything to attempt on strings? I see you are considering consolidating
down to
> a single index type for those, etc. Of course you also imply a large
string
> rework that may happen in the future.

Yes, Strings need the same treatment (though it may be a bit simpler
since one doesn't have to unwind the broken double-indirection hack
mentioned in the paper).

Hi Dmitri,

Happy to help with either/both of tests and new collection indices. Just point me in your preferred direction!

Thanks,
Austin

···

Sent from my iPhone

On Apr 11, 2016, at 11:43 AM, Dave Abrahams <dabrahams@apple.com> wrote:

on Mon Apr 11 2016, Dmitri Gribenko <gribozavr-AT-gmail.com> wrote:

On Mon, Apr 11, 2016 at 11:07 AM, Dave Abrahams <dabrahams@apple.com> wrote:

on Sun Apr 10 2016, Austin Zheng <austinzheng-AT-gmail.com> wrote:

I'm really sorry for dropping the ball and disappearing off the list. I'd like
to help out if I can. I'll check out the current branch tomorrow and see what
the status of the work is, but let me know if everything is done already/there's
something in particular that should be worked on.

Dmitri may have other ideas, but one thing we haven't done is to take
advantage of the new model by removing references from indices. I'd
like to prove that the new model does what it's supposed to. You might
try simplifying the indices for Set and Dictionary. It should be
possible to represent them as a wrapper around an Int.

String could also make use of such simplification.

Another important task is writing tests for new APIs, such as range
APIs and collection APIs.

This is hugely important, probably more important than what I
suggested. If Dmitri can use your help, it would be best to work with
him on that.

--
Dave

Dmitri can give you great guidance about testing.

···

on Mon Apr 11 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

On Mon, Apr 11, 2016 at 11:42 AM Dave Abrahams <dabrahams@apple.com> wrote:

    on Mon Apr 11 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

    > Anything to attempt on strings? I see you are considering consolidating
    down to
    > a single index type for those, etc. Of course you also imply a large
    string
    > rework that may happen in the future.

    Yes, Strings need the same treatment (though it may be a bit simpler
    since one doesn't have to unwind the broken double-indirection hack
    mentioned in the paper).

I was going to start working on String indices since I had some changes stashed
from a while back that make still make sense. Then I could likely help with
building out tests as well. Would want to coordinate that with folks some how.

--
Dave

Shawn and Austin, please feel free to reach out to me with any
questions you might have.

Dmitri

···

On Mon, Apr 11, 2016 at 3:16 PM, Dave Abrahams <dabrahams@apple.com> wrote:

on Mon Apr 11 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

On Mon, Apr 11, 2016 at 11:42 AM Dave Abrahams <dabrahams@apple.com> wrote:

    on Mon Apr 11 2016, Shawn Erickson <shawnce-AT-gmail.com> wrote:

    > Anything to attempt on strings? I see you are considering consolidating
    down to
    > a single index type for those, etc. Of course you also imply a large
    string
    > rework that may happen in the future.

    Yes, Strings need the same treatment (though it may be a bit simpler
    since one doesn't have to unwind the broken double-indirection hack
    mentioned in the paper).

I was going to start working on String indices since I had some changes stashed
from a while back that make still make sense. Then I could likely help with
building out tests as well. Would want to coordinate that with folks some how.

Dmitri can give you great guidance about testing.

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/