saresend
(Samuel Resendez)
August 14, 2025, 2:30pm
1
Hey - I have a usecase for which having a generic segment tree implementation would be fantastic. I’m wondering if this is something that has come up before, and whether swift-collections would consider supporting a segment tree?
I can't answer your specific question, but here's a quote from last year:
As a practical matter, all feature work on new data structures in swift-collections is currently on hold, while we're focusing on Swift's roadmap for improving performance predictability .
The introduction of ownership control (e.g. support for ~Copyable types, strictly distinguishing between borrowing and consuming use) is a major language development; it requires us to dismantle Swift's pre-existing container concepts and to reassemble them from scratch, targeting these new features. (The current Sequence/Collection protocols will survive, of course, but I expect they will remain limited to high level (copyable) use cases.)
All existing data structure implementations will need to be extensively redone to support this work -- in the short term, I expect our hands will be quite full with designing and implementing a multitude of new variants of the existing container types, inside and outside the stdlib.
I expect work on finalizing ropes (and adding new data structure implementations) in swift-collections will resume once the dust has settled on these lower-level issues.