Associative Arrays in the data segment

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 09:22:02 PDT 2015


On Sat, Apr 11, 2015 at 01:48:10AM +1000, Daniel Murphy via Digitalmars-d wrote:
> "H. S. Teoh via Digitalmars-d"  wrote in message
> news:mailman.1417.1428680037.3111.digitalmars-d at puremagic.com...
> 
> >I think this is unacceptable. We're trying to decouple AA's from
> >compiler innards, and this is going backwards and adding a huge
> >dependency between them again, not to mention being a maintenance
> >nightmare because bugs are bound to happen when the two code bases go
> >out of sync. It's the very problem we've been trying to fix for
> >years.
> 
> That's what tests are for.

The bigger problem is that this binds us even more to the current
schizophrenic split of the AA implementation between the compiler and
druntime. We've been trying to break away from that for years, and now
you're suggesting to bring us back to square one.


> >While I am very much in favor of compile-time initialized AA's (been
> >wanting that for years now), I think this is not the right approach.
> >In my mind, the correct approach is to factor out the AA
> >implementation into a library solution, and use CTFE on that library
> >code to generate the compile-time initialized literal.
> 
> How many years are you willing to wait for the 'correct approach'?

Didn't somebody (IIRC Igor Stepanov?) submit a bunch of PRs in this
direction? I.e., precisely to factor out AA-specific interfaces in the
compiler so that everything goes through a standard API that eventually
can be swapped for proxies to a library implementation? While it's true
I haven't seen activity on this front for a while now, I was under the
impression things were moving along quite well. If we all were to get
behind this effort and push it through instead of going back to the bad
ole split-implementation approach, maybe it would have seen the light of
day already.


T

-- 
It is of the new things that men tire --- of fashions and proposals and improvements and change. It is the old things that startle and intoxicate. It is the old things that are young. -- G.K. Chesterton


More information about the Digitalmars-d mailing list