Persistent Collections with full COW support

Is swift evolution interested in a set of persistent collections (vector, hashset, hashmap) with full cow support and extensive tests?

They are finished and in use.

I would adapt them to the current style &.

Best regards

1 Like

Can you link to the SPM package so people can play around with it?

···

On Sep 1, 2017, at 8:26 AM, Sebastian Bohmann via swift-evolution <swift-evolution@swift.org> wrote:

Is swift evolution interested in a set of persistent collections (vector, hashset, hashmap) with full cow support and extensive tests?

They are finished and in use.

I would adapt them to the current style &.

Best regards

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I would be interested in this as a “non standard” library - a library shipped with Swift, but not imported by default. In general, average developers probably don’t need the difference between a hashset and another kind of set. But if I really cared, it’d be cool to just “import DataStructures” (or whatever) and have it all.

Dave

···

On Sep 1, 2017, at 9:26 AM, Sebastian Bohmann via swift-evolution <swift-evolution@swift.org> wrote:

Is swift evolution interested in a set of persistent collections (vector, hashset, hashmap) with full cow support and extensive tests?

They are finished and in use.

I would adapt them to the current style &.

Best regards

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

No sure if this is they will make stdlib, but ai am sure people would like to take a look at it :).

···

Sent from my iPhone

On 1 Sep 2017, at 17:26, Sebastian Bohmann via swift-evolution <swift-evolution@swift.org> wrote:

Is swift evolution interested in a set of persistent collections (vector, hashset, hashmap) with full cow support and extensive tests?

They are finished and in use.

I would adapt them to the current style &.

Best regards

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Definitely sounds useful to me, maybe as a standalone library.

-g.

Hi, as mentioned last summer on the mailing list, I've crated a persistent vector, hash set, and hash map with full COW suppport, plus an exhaustive randomized test suite. I personally find these collections extremeley practical, so maybe others may find them useful as well...
Plus, I wonder how I could make them more streamlined in the sense of blending in with modern swift style.
In case anybody is curious, here they are:

In case anybody wonders: concurrent vectors, hash sets, and hash maps are internally organized as trees, so when anybody needs a modified version of their copy, it’s cheap even in the shared case, as only the path from the root to the changed bit needs to be replaced, everything else is retained and remains shared.

This is why I find these collections to be a particularly good fit for COW ^^

I just refactored the code in accordance with current swift standards. It is way more readable now :D