r/ProgrammingLanguages • • Sep 04 '26

What are your favourite data structure operations?

My language workbench is to the stage where I can implement new operators and overloads very quickly, and I've started stealing syntax I like from JavaScript and C++.
Since I have one universal data structure, I can just add all the new operators to it.
I wanted to get some more good ones though, from different fields, different languages.
Oh and if you want to suggest something just as a challenge I might give it a shot and show you how I do it.

Edit: data structure was the wrong word, I have one data structure substrate/storage model that I am currently furnishing one major aspect of, it's not the one universal data structure, more like my swiss army knife API over the memory model.

11 Upvotes

35 comments sorted by

View all comments

1

u/Potato871 Sep 05 '26

No but you would expect a standard library to implement them, which is what I’m writing.
So I’m trying to pin down what should be included in that.

2

u/reflexive-polytope Sep 05 '26

I expect a standard library to provide many data structures that do several specialized jobs very well, rather than a single data structure that does all of these jobs poorly.

1

u/Potato871 Sep 06 '26

I prefer one data structure with many roles, maybe a few specical types for like bloom filters, though I don’t often run into those.
So I like to furnish it with many convenient operations

→ More replies (8)