220 31264 <762243ed-0c31-461d-b6fd-fdb8759857b2@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: P0534: call/cc, type safety and exceptions
Date: Wed, 1 Mar 2017 08:50:46 -0800 (PST)
Lines: 95
Approved: news@gmane.org
Message-ID: <762243ed-0c31-461d-b6fd-fdb8759857b2@isocpp.org>
References: <fc546ea4-a355-4a60-a7e7-97927993471d@isocpp.org>
 <3a57e294-7254-4358-828d-c9f7757f5295@isocpp.org>
 <4e6c13b2-4286-4df8-989b-97cbf3bf1cc7@isocpp.org>
 <312d04a6-8b20-4bf5-8357-507ba9938e84@isocpp.org>
 <a3c76a9f-ef02-4ea7-a754-66ee5a95b38f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_10812_899290570.1488387046389"
X-Trace: blaine.gmane.org 1488387056 20428 195.159.176.226 (1 Mar 2017 16:50:56 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 1 Mar 2017 16:50:56 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBZ7X3PCQKGQE5MHXOQQ@isocpp.org Wed Mar 01 17:50:51 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBZ7X3PCQKGQE5MHXOQQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f71.google.com ([209.85.218.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBZ7X3PCQKGQE5MHXOQQ@isocpp.org>)
	id 1cj7Sc-0003vg-IV
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Mar 2017 17:50:42 +0100
Original-Received: by mail-oi0-f71.google.com with SMTP id 126sf34983439oig.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Mar 2017 08:50:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=pXKIGkLE1uOd8Gq03q00YB5BG1FnUPjux8QLU6iInqY=;
        b=R/EVSX2oADK1Iq9/5TJD9ErmK6VaZcKw0LnX0IPDygw8LzwaooHThHcs/CS2S/GDYj
         49El1lGMYJPNPSo6COblfmVhMy1WNv11qvu/x0rGMMe1ZdKBTLEOFAliY09ap4yR5wm0
         NjNFW4lZTQ6Xq7kHS33j3p1y4nwqq3KANBpWVQDP9+mwdEv0jj4BsDFw8N3MSFN33MF0
         Zi7ZFQsKRi6wh6te1o7IyzMu3STsevWmistHqUMK2tHZ8ocG7LuAkoWS8wRNmRC9B0OX
         +ibaK6hjXIcvUYKt7lN147Huu44X0+XqtaMIezNJiIxc/C3LwALJUS4z5b2jAONXPTUv
         XPBw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to: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=pXKIGkLE1uOd8Gq03q00YB5BG1FnUPjux8QLU6iInqY=;
        b=ouEzP5aP6XMHoGN3MZqLG3fLbSwo126kZvSdUTvZoJu0KQbpjCcDUNgImKHVScNaBN
         4mPK3V39aKBDK25eoib3PsIEk9Wf+F1PoBet3Y3FWHmfPQRHpO+Hb5YsJkduK8dWliu8
         wgc/Fz313ZUsdqT+MhhyWATL8EyMel9GuOKCgmuELQfisNfIcVwiKgTa2v9FfYnmPu/N
         rUXH03GxdHBPUbGGdwBvCwfZQOBvPcwU5gFB7kosGJ7h09nyOo5w7B0BbXwkTIfYN149
         JQA8w0evudA9m3TrWkwUDg7eZJPTTXdczFJPLLHcNUt14OgQUcu0VtSMaByURupXPdU1
         dzDw==
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: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=pXKIGkLE1uOd8Gq03q00YB5BG1FnUPjux8QLU6iInqY=;
        b=fEoEPv13Z3mG/JXYr0Qv0eO9bbkyNGts9RFqnhQh2o417O57QhCGW5N2Yc1ZRMveJs
         D0z0PBk8HyPrrvJlPyfKtym35RTgYvN7rpKToPHKTRh04KBsEmYo4Fv8Gy+huHgxAkG0
         11arWJh+AEjhHVgHKjQ36EW/iBfTcynIA3tR0ZLPYaPr/mSgsGOuniq7+oxBieYZeSwB
         JeDVo9H3BxkH3oDyiXuCpbAYxUCkTODOHOfqwcDZZ3RZmIanbztB0VuftM/illrfB0gq
         b3XfFzaRNpBm8EDqf7YyBffQGLzAIHFkXp3bUfQWMlvMmiEeT8TKYVz2MzCmI7m9qrwc
         xvww==
X-Gm-Message-State: AMke39lUTdpl+JPN1Ypoo91ffaTdME918X7NpUSh89QLfVJAootPSjv/6q7xrdYh2CbBKQ==
X-Received: by 10.157.54.55 with SMTP id w52mr3027033otb.135.1488387048450;
        Wed, 01 Mar 2017 08:50:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.26.78 with SMTP id u14ls4934353otu.27.gmail; Wed, 01 Mar
 2017 08:50:46 -0800 (PST)
X-Received: by 10.157.41.152 with SMTP id n24mr1129465otb.0.1488387046914;
        Wed, 01 Mar 2017 08:50:46 -0800 (PST)
In-Reply-To: <a3c76a9f-ef02-4ea7-a754-66ee5a95b38f@isocpp.org>
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-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:31264
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31264>

------=_Part_10812_899290570.1488387046389
Content-Type: multipart/alternative; 
	boundary="----=_Part_10813_823472932.1488387046389"

------=_Part_10813_823472932.1488387046389
Content-Type: text/plain; charset=UTF-8



On Wednesday, March 1, 2017 at 10:48:40 AM UTC-5, Giovanni Piero Deretta 
wrote:
>
> On Wednesday, March 1, 2017 at 3:38:13 PM UTC, Nicol Bolas wrote:
> [...]
>
>>
>> So we need the safe mechanism, and we need it shipped with the system. 
>> But that should not be the *only* way; the lower-level form should still 
>> exist.
>>
>> Now, maybe the type-safe version should be the *default*, so that if you 
>> want the lower-level, unsafe API, we can clearly see that safety is being 
>> sacrificed. So `callcc/continuation` would naturally be type-safe, with 
>> `unsafe_callcc/unsafe_continuation` being not type safe.
>>
>
> we are in agreement then, I just want to point out that, given a type safe 
> std::continuation<T> implementation, the unsafe variant would simply be 
> std::continuation<void*>, while the dynamic variant would be 
> continuation<std::any_ptr>, given a suitable implementation of any_ptr.
>

I don't think you understood what I meant when I said "type safe". I 
specifically *don't* mean that the continuation has a static and typed set 
of parameters. What I mean is that getting the parameter back is 
type-checked and therefore safe. But it's a *runtime* check, not a 
compile-time check.

This prevents compile-time tight coupling while still having safety on the 
receiving end.

-- 
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/762243ed-0c31-461d-b6fd-fdb8759857b2%40isocpp.org.

------=_Part_10813_823472932.1488387046389
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, March 1, 2017 at 10:48:40 AM UTC-5, =
Giovanni Piero Deretta wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><=
div dir=3D"ltr">On Wednesday, March 1, 2017 at 3:38:13 PM UTC, Nicol Bolas =
wrote:<br>[...]<br><blockquote class=3D"gmail_quote" style=3D"margin:0;marg=
in-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"=
><br><div>So we need the safe mechanism, and we need it shipped with the sy=
stem. But that should not be the <i>only</i> way; the lower-level form shou=
ld still exist.<br><br>Now, maybe the type-safe version should be the <i>de=
fault</i>, so that if you want the lower-level, unsafe API, we can clearly =
see that safety is being sacrificed. So `callcc/continuation` would natural=
ly be type-safe, with `unsafe_callcc/unsafe_<wbr>continuation` being not ty=
pe safe.<br></div></div></blockquote><div><br>we are in agreement then, I j=
ust want to point out that, given a type safe std::continuation&lt;T&gt; im=
plementation, the unsafe variant would simply be std::continuation&lt;void*=
&gt;, while the dynamic variant would be continuation&lt;std::any_ptr&gt;, =
given a suitable implementation of any_ptr.<br></div></div></blockquote><di=
v><br>I don&#39;t think you understood what I meant when I said &quot;type =
safe&quot;. I specifically <i>don&#39;t</i> mean that the continuation has =
a static and typed set of parameters. What I mean is that getting the param=
eter back is type-checked and therefore safe. But it&#39;s a <i>runtime</i>=
 check, not a compile-time check.<br><br>This prevents compile-time tight c=
oupling while still having safety on the receiving end.<br></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/762243ed-0c31-461d-b6fd-fdb8759857b2%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/762243ed-0c31-461d-b6fd-fdb8759857b2=
%40isocpp.org</a>.<br />

------=_Part_10813_823472932.1488387046389--

------=_Part_10812_899290570.1488387046389--

.
