Associative Arrays in the data segment

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 07:11:47 PDT 2015


On 4/10/15 9:44 AM, Daniel Murphy wrote:
> "Steven Schveighoffer"  wrote in message
> news:mg8ihs$1at6$1 at digitalmars.com...
>
>> >
>> > this has a majour drawback, methinks: an inability to change AA
>> > implementation without fixing the compiler too. i.e. i can't no
>> longer > to
>> > simply rewrite the relevant parts of druntime (change hashing function,
>> > for example) and be happy.
>>
>> I agree with ketmar, If the compiler implements this, then you cannot
>> play with the implementation of AA at all without changing the compiler.
>
> The AA implementation has changed once in the time I've been involved
> with D.  I don't see this as a big concern.

It's all the rage these days, Walter just started a thread on it ;)

But the issue I see is that this is a step BACKWARDS. We want to move to 
more possibility of customization, not less. Subtle differences in 
compiler/library implementation are the stuff nightmare bugs are made of.

>> I'd rather see the compiler treat AA as fully library type, and be
>> able to build AA at compile time because the code is sane.
>
> Who wouldn't?  But realistically, how many more years until that happens?

I think it's possible now, but nobody has been able to exactly duplicate 
certain aspects of the builtin AA. I may take a stab at it. We also had 
a horrible experience of "half-library half magic" type a few years ago.

But the real answer is, as soon as someone does it who has 
Walter's/Kenji's/your ear, we can create an AA, and fix the compiler to 
use and support it. It needs an advocate (who is willing to do the hard 
work).

-Steve


More information about the Digitalmars-d mailing list