Move Constructors - Converting Lvalues to Rvalues
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Wed Oct 2 03:39:36 UTC 2024
On 02/10/2024 3:59 PM, Atila Neves wrote:
> On Tuesday, 1 October 2024 at 03:07:02 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>> On 01/10/2024 3:58 PM, Atila Neves wrote:
>>> On Monday, 30 September 2024 at 20:28:05 UTC, Richard (Rikki) Andrew
>>> Cattermole wrote:
>>>> I suspect that we're going in an entirely wrong direction with move
>>>> constructors for two reasons:
>>>>
>>>> 1. Nobody has been able to answer what the purpose of them is, is it
>>>> an optimization, is it ownership transfer system (which is better
>>>> done with isolated).
>>>
>>> My understanding is that we need SSA in order to implement isolated.
>>> And so for now I'd say it's an optimisation mostly, but also bug
>>> prevention with move-only types.
>>
>> SSA? What? That has nothing to do with it.
>
> Not according to Amaury.
He would be wrong to suggest that it is a requirement. It may make it
easier to conceptualize it, and if you already have an IR that is SSA it
may even allow you to do it cheaply. But it is not a requirement.
You can confirm what I have said by reading Wikipedia on the subject
where SSA is indeed listed as an alternative approach to some problems.
https://en.wikipedia.org/wiki/Data-flow_analysis
To construct an SSA IR will cost a lot of time, that quite frankly I
can't see making the rest of the analysis faster. It would be a totally
different situation if we could parallelize it (I went down that path
with my semantic 4, but it makes more sense to do as part of semantic 3
for this). You basically need to make the CFG from the AST.
Isolated and with that unique ownership is based upon the data flow
analysis of the tracked objects. Object tracking isn't too complex if
you are limited to forward pass only.
For reference, good article by one of the creators of Midori, regarding
isolated https://joeduffyblog.com/2016/11/30/15-years-of-concurrency/
More information about the Digitalmars-d
mailing list