__rvalue and Move Semantics first draft

Salih Dincer salihdb at hotmail.com
Fri Nov 15 05:27:47 UTC 2024


On Saturday, 9 November 2024 at 22:59:34 UTC, Walter Bright wrote:
> On 11/9/2024 8:15 AM, Richard (Rikki) Andrew Cattermole wrote:
>> 1. We'll need to introduce a swap builtin, since we have no 
>> way to say describe moves between parameters. This can come 
>> later, as it is an addition.
>
> Doesn't a swap function get arguments passed by `ref`?
>
>> 2. I have the concern that existing code that is not designed 
>> to accept a move, will have a move into it. White listing via 
>> an attribute ``@move`` to say that this constructor/opAssign 
>> is designed to handle a move in would be valuable.
>
> This can work, but if the users have to proactively add this 
> attribute, I'm afraid we've failed.
>
>> 3. Optimizing of eliding of destructors should be done with 
>> type state analysis, it does not need its own dedicated DFA.
>
> The two are the same, aren't they?

When will I be able to measure performance for different data 
types and usage scenarios?

Thus, we can concretely show the performance advantages of the 
__rvalue keyword. In my opinion, the performance impact of 
transport semantics in real-world applications should be analyzed 
in detail, and its effects on large data structures and 
frequently used objects should be examined.

We have no time to lose...

SDB at 79



More information about the dip.development mailing list