DIP 1014

Nicholas Wilson iamthewilsonator at hotmail.com
Tue Jul 2 07:19:10 UTC 2019


On Tuesday, 2 July 2019 at 05:32:07 UTC, Tremor wrote:
> Is any update for this ?

Les De Ridder has implemented the druntime function and made 
phobos use it for its move function, all thats left is to make 
the compiler insert a call to it when it moves structs around.

> DIP1014 is fatal for implement safe ref count,  I don't trust a 
> language call them self system language without safe ref count.
>
> This is also a major block for implement GNU CPP std::string, 
> cpp ABI compatible is  another import goal for D.
>
> I just with I has the skill to work on this,  If nobody has no 
> time to work on this. maybe some one can give a guide about how 
> to implement this ?
>
> like the step to do:
>
> step 1:  example to add some build in id for opPostMove

That would go here:

https://github.com/dlang/dmd/blob/master/src/dmd/id.d#L63

you'd need one for 
https://github.com/dlang/druntime/blob/master/src/object.d#L151 
as well

> step 2: which part code to modify to hook opPostMove with 
> rvalue or lvalue move

Would probably want to insert the call in, Razvan Nitu would 
probably know better/in more detail.

https://github.com/dlang/dmd/blob/b359735d1034c77aa5b59dff9a8b815fb3eb14c9/src/dmd/expression.d#L468

> step 3: how to glue it with DMD and LDC backend to generate asm 
> code.

This should be no problem, all that is needed is to insert a call 
to, 
https://github.com/dlang/druntime/blob/master/src/object.d#L151 
Its all front end stuff, i.e. LDC will be able to use whatever 
the front end does with no problem.

> Maybe there should be a new thread to talk about this.
>
> The github user thewilsonator is like a hero to me, maybe when 
> he get free time can take a look for this.

I'm humbled, but a bit busy. Don't let me stop you opening a PR 
though. I'm sure Razvan and I can try to help you there.




More information about the Digitalmars-d mailing list