220 41376 <057b85fb-1020-4119-a6a5-19eb251f7057@isocpp.org> article
Path: news.gmane.org!.POSTED.ciao.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Destructive move, via forwarding and
 destructuring operations
Date: Mon, 21 Jan 2019 10:32:28 -0800 (PST)
Approved: news@gmane.org
Message-ID: <057b85fb-1020-4119-a6a5-19eb251f7057@isocpp.org>
References: <7b2204ba-51d0-481e-9974-10029547031c@isocpp.org>
 <ca96ebeb-8c6a-4dc3-a703-28a37feff900@isocpp.org>
 <20190120222650.5222481.91670.69069@gmail.com>
Reply-To: std-proposals@isocpp.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2124_372852324.1548095548383"
Injection-Info: ciao.gmane.org; posting-host="ciao.gmane.org:195.159.176.228";
	logging-data="157791"; mail-complaints-to="usenet@ciao.gmane.org"
Cc: dcrc2cpp@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBPNATDRAKGQEDDI4EGY@isocpp.org Mon Jan 21 20:00:09 2019
Return-path: <std-proposals+bncBCEKFTV6ZUMBBPNATDRAKGQEDDI4EGY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb1-f200.google.com ([209.85.219.200])
	by ciao.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.89)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBPNATDRAKGQEDDI4EGY@isocpp.org>)
	id 1gleno-000ez0-B9
	for gclcip-std-proposals@m.gmane.org; Mon, 21 Jan 2019 20:00:08 +0100
Original-Received: by mail-yb1-f200.google.com with SMTP id o199sf10699110ybg.18
        for <gclcip-std-proposals@m.gmane.org>; Mon, 21 Jan 2019 11:00:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=KcUkYdbNNE+m5hOFwLJtgkFCsZqxN3N1tyOf8cSm6bs=;
        b=GloYdbO9dagzSM+yQ9H5YJ33c6SctIweGLmsUO0sVsqfSzVWOsCj+mVi4ZOoWTPZQs
         ivZKVC4fAnj0fq5/NPDjawuU3XYGk8AbleXqT+25+sSTJwpKFxYDW+i5PmfookjWrao6
         T9sfFhQzVxQp6qnF1osUSJuBGaqQJzcvAGG45VzwezVo0dyHWGfOQ5ao1ASqphkeCM92
         YiRUHRsQfXuMZIt7JCXRCgI31HOfObm6Wwz5Au70IS2B63FjuyBRKEkoPMFA8y2kiaa6
         WjWjVvMX3PiWVU+mXAGiYMRWBpakkjGX/NNLdARx8eUuniUrJfGAS8Ji5BX2iGQxI9UO
         jkJA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=KcUkYdbNNE+m5hOFwLJtgkFCsZqxN3N1tyOf8cSm6bs=;
        b=T92e3SYv7DnSOltPgyNuIL7iJbPBqxywyXdmT0xia1FitQ/1sjEFKCii0LnkT1VILt
         oarohnfDbL60BVGxganFlQDe2cKz3kLn5QCN5VA93796wk0FyMRuOV4NRnMwOTm32cd7
         hpQ2LrMiHIU+0W7JWKpqwtoqpqZnDVSUSu/ja2DvJPpO/vIFOpvtrYEWm/GFgwFPQtZ7
         UxZId0hJeDGgvf16Ewbf1DQVuvTTW8BrXzY9Gd6w1S44+OMoC233/KcYG4egWpaJhu7l
         u0QYQ9cFepr3WtXoR8XXcVMEBmTMI0LFR+SpHiFuH6E6qsoS7M+w2tPGAyqiW0rQuxsl
         vwQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=KcUkYdbNNE+m5hOFwLJtgkFCsZqxN3N1tyOf8cSm6bs=;
        b=hebCzMVwSkQyDV0SIw6IqRF1W/BCgw94XKhh18/VoGznvjiS7jMD8ObgQtMcMEnqAx
         jmi8bCDreUrQ4KA5kwrxFcXKERIkl6bY0zSE+4uaWCyNtawd7QdCwrInARfl77sW3Hcm
         fCCrXTVEY43hIukKeI4iuuuKcmFntQLmAYWHXOe112WjnsCW/KLOF0///zWywL2kWJqx
         Xb3n25csQIxZ8JAZcwwCybFAFr6MyAKwS0U3TtDBZLBSHSH1VC2F++YR/u/vrfycHCg8
         ppzNOmf5mF5IwQ7eZKTujmykje5w96/dcAQ9JSIpTwWRMnF3+idUR5ocDsqFtLyqUSQb
         mnyg==
X-Gm-Message-State: AJcUukf31PYV8Vh+soUAsBFEHsh92loFbjSENCsL7WIeWG7oBiznLKEC
	3v6cY/QBMifi5QH8UdK6rbG2bA==
X-Google-Smtp-Source: ALg8bN6Ku//2uOj5KvQysV3x5vSaGQeJbtz9oR7tPSfxGpc/S7hf164fQbHq/mHdhoiiVJxG7p6f9A==
X-Received: by 2002:a5b:9c2:: with SMTP id y2mr1116125ybq.16.1548095550326;
        Mon, 21 Jan 2019 10:32:30 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:7d87:: with SMTP id y129ls2800516ywc.2.gmail; Mon, 21
 Jan 2019 10:32:29 -0800 (PST)
X-Received: by 2002:a81:27cd:: with SMTP id n196mr346606ywn.2.1548095549027;
        Mon, 21 Jan 2019 10:32:29 -0800 (PST)
In-Reply-To: <20190120222650.5222481.91670.69069@gmail.com>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:41376
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41376>

------=_Part_2124_372852324.1548095548383
Content-Type: multipart/alternative; 
	boundary="----=_Part_2125_1693843354.1548095548384"

------=_Part_2125_1693843354.1548095548384
Content-Type: text/plain; charset="UTF-8"

On Sunday, January 20, 2019 at 5:26:53 PM UTC-5, Tony V E wrote:
>
> Dangling references and destructive move are two things that could 
> possibly be solved by something called 'owning references'.
>
> I haven't read the paper, but the high cost of another reference could be 
> worth it if it solved these issues.
>

.... huh.

A while back, I went exploring down the rabbit hole of dangling references. 
At some point, I realized that what I was about to define was de-facto 
another reference type (along with further subdividing xvalues into two new 
value categories). At which point I deemed the whole exploration to be 
insane and stopped.

Would a third reference type be worth it if it solved both destructive move 
(at a language level) and dangling reference? I don't know.

The big problem with third references is that you're adding greater 
complexity to a part of the language that already has a lot of complexity. 
Reference collapsing rules already have 4 cases; adding a new reference 
type makes 8 cases. You now have a third case where they get applied to 
`this`, but you also have to decide how that interacts with the other two 
`this` reference.

It's hard enough to teach beginning C++ programmers how to use rvalue 
references correctly. The distinction between genuine rvalue references and 
forwarding references, when and how to use `move`, etc.

This is why solving the dangling reference problem through a third 
reference makes a degree of sense: that's an area of the language that is 
already complex for C++ users; if adding a bit more complexity allows users 
to write working code, then it's a win.

By contrast, solving destructive move alone is adding complexity without 
removing complexity. It (potentially) adds performance, but at the cost of 
complexity in a domain that C++ is already over-complicated within.

So I guess I could say this: if you can solve both problems with the same 
mechanism, it might be worth doing.

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/057b85fb-1020-4119-a6a5-19eb251f7057%40isocpp.org.

------=_Part_2125_1693843354.1548095548384
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, January 20, 2019 at 5:26:53 PM UTC-5, Tony V E =
wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"background=
-color:rgb(255,255,255);line-height:initial" lang=3D"en-US">               =
                                                                       <div=
 style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#=
39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;backgroun=
d-color:rgb(255,255,255)">Dangling references and destructive move are two =
things that could possibly be solved by something called &#39;owning refere=
nces&#39;.</div><div style=3D"width:100%;font-size:initial;font-family:Cali=
bri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-ali=
gn:initial;background-color:rgb(255,255,255)"><br></div><div style=3D"width=
:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,=
sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255=
,255,255)">I haven&#39;t read the paper, but the high cost of another refer=
ence could be worth it if it solved these issues.</div></div></blockquote><=
div><br></div><div>... huh.</div><div><br></div><div>A while back, I went e=
xploring down the rabbit hole of dangling references. At some point, I real=
ized that what I was about to define was de-facto another reference type (a=
long with further subdividing xvalues into two new value categories). At wh=
ich point I deemed the whole exploration to be insane and stopped.</div><di=
v><br></div><div>Would a third reference type be worth it if it solved both=
 destructive move (at a language level) and dangling reference? I don&#39;t=
 know.</div><div><br></div><div>The big problem with third references is th=
at you&#39;re adding greater complexity to a part of the language that alre=
ady has a lot of complexity. Reference collapsing rules already have 4 case=
s; adding a new reference type makes 8 cases. You now have a third case whe=
re they get applied to `this`, but you also have to decide how that interac=
ts with the other two `this` reference.<br></div><div><br></div><div>It&#39=
;s hard enough to teach beginning C++ programmers how to use rvalue referen=
ces correctly. The distinction between genuine rvalue references and forwar=
ding references, when and how to use `move`, etc.</div><div><br></div><div>=
This is why solving the dangling reference problem through a third referenc=
e makes a degree of sense: that&#39;s an area of the language that is alrea=
dy complex for C++ users; if adding a bit more complexity allows users to w=
rite working code, then it&#39;s a win.</div><div><br></div><div>By contras=
t, solving destructive move alone is adding complexity without removing com=
plexity. It (potentially) adds performance, but at the cost of complexity i=
n a domain that C++ is already over-complicated within.</div><div><br></div=
><div>So I guess I could say this: if you can solve both problems with the =
same mechanism, it might be worth doing.</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/057b85fb-1020-4119-a6a5-19eb251f7057%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/057b85fb-1020-4119-a6a5-19eb251f7057=
%40isocpp.org</a>.<br />

------=_Part_2125_1693843354.1548095548384--

------=_Part_2124_372852324.1548095548383--

.
