Possible change to array runtime?

Jonathan M Davis jmdavisProg at gmx.com
Wed Mar 19 21:02:44 PDT 2014


On Friday, March 14, 2014 14:50:43 Dicebot wrote:
> It has not been mentioned as example of blocker but example of
> most horrible breaking change that can happen if dmd user is not
> aware of it before upgrade.
> 
> I think only practical thing that blocks D2 transition right now
> is that no one can afford to work on it full-time and amount of
> changes needed is too big to be done as a side work - array
> stomping is not only problematic area, I personally think const
> will cause much more problems.
> 
> Really hope that with recent hires doing a focused porting effort
> will soon become a real option. D1 is so D1 :P

Just a thought for this particular case. You could write a clearForAppend for 
D1 which simply sets the array length to 0 and slowly change your current code 
to use that instead of setting the array length to 0 directly. Then when you 
do go to port to D2, you can simply change clearForAppend's behavior so that 
it also calls assumeSafeAppend. That would allow you to do this particular 
change as a side project rather than focusing on it full time, which obviously 
isn't enough on its own, but it could help.

- Jonathan M Davis


More information about the Digitalmars-d mailing list