Containers

deadalnix deadalnix at gmail.com
Wed Sep 1 10:32:45 UTC 2021


On Wednesday, 1 September 2021 at 10:12:23 UTC, Per Nordlöw wrote:
> - CoW: sounds like the future direction in other languages such 
> as Swift so no objections on that matter:
>   - Should we enforce CoW or make it opt-in via storages fed as 
> template parameters?

I think COW should be the default. It is not difficult to build 
reference container from COW ones, so we probably don't need it 
to be optional, simply provide wrappr around the COW container to 
provide references ones.

>   - Will you be supporting
>

I'm not sure what you mean here. If it is bugfixes and all, I 
don't have much problem with that. Container are fairly 
straightforward, so I don't expect the workload to be very high 
anyways.

> - Will you be using ranges or iterators?
>

This is D, we must provide ranges. But in operator and similar 
kind forces us to do both.

> - What about allocators? If you do can you please use 
> std.experimental.allocator instead of stdx.allocator (used by 
> emsi-containers and libdparse and dsymbol) is more than 2 years 
> old now. std.experimental.allocator has received much love 
> since, for instance `allocateZeroed` for the allocators that 
> support it.
>

I have to admit I have not put too much thought into this.

> - An interesting emsi container that was new to me is 
> `UnrolledList`. It's used extensively in dsymbol.
>

I have no idea what that is.

>> I expected to focus on Vector/Set/Map initially. This should 
>> serve most use case in practice.
>
> You should probably use robin-hood hashing if you pick 
> open-addressing.

Yes, that being said, I would like to not expose the 
implementation. PHP and python were able to move from a tree 
based approach to open addressing for dictionaries, for great 
benefit. They could do so because they didn't expose the innards 
of the container.

There are very interesting approach leveraging vector 
capabilities of modern CPU such as F14: 
https://engineering.fb.com/2019/04/25/developer-tools/f14/ and 
exposing the innards would prevent moving to them later on.


More information about the Digitalmars-d mailing list