Library associative array project v0.0.1

Steven Schveighoffer schveiguy at gmail.com
Wed May 11 19:19:18 UTC 2022


On 5/11/22 11:54 AM, templatedperson wrote:
> On Wednesday, 11 May 2022 at 15:31:02 UTC, Steven Schveighoffer wrote:
>> I just spent a couple hours making a library AA solution that is 
>> binary compatible with druntime's builtin AA.
>>
>> The benefits:
>>
>> 1. Proves that a library implementation is possible, also shows where 
>> shortcomings are.
>> 2. Usable at compile time to make an AA that can be used at runtime.
>> 3. Much more approachable code than the AA runtime, does not require 
>> "faking" a typeinfo, dealing with typeinfo in general, or deal with 
>> magic compiler hooks. This gives a good base to start experimenting with.
>>
> 
> This is great!

Thanks!

> 
>> 2. Look at alternatives to GC for allocation/deallocation.
> 
> Maybe add `@nogc` overloads that take `std.experimental.allocator`s? 
> That could be the best way to accomplish this.

Technically, we don't need attributes, if the allocator doesn't use the 
GC, it will infer @nogc.

Adding an allocator template parameter is a definite plan. However, once 
you go outside the standard AA implementation, you can no longer be 
binary compatible.

But the overall goal is to provide a base for future improvement (both 
in the language and as an alternative to AAs), so please, if you have 
more ideas, file some github issues!

-Steve


More information about the Digitalmars-d-announce mailing list