220 31309 <5d94e416-e8bf-41e1-98f3-eee6133c9b64@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Giovanni Piero Deretta <gpderetta@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: P0534: call/cc, type safety and exceptions
Date: Thu, 2 Mar 2017 03:29:34 -0800 (PST)
Lines: 115
Approved: news@gmane.org
Message-ID: <5d94e416-e8bf-41e1-98f3-eee6133c9b64@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>
 <762243ed-0c31-461d-b6fd-fdb8759857b2@isocpp.org> <f8a573b1-c4ff-48a2-8a6f-51433732ab26@isocpp.org>
 <aecc5a06-78cc-4071-8cce-b2e731439463@isocpp.org> <f67a3b9d-3fec-40c5-95a2-576acf88b6f9@isocpp.org>
 <CA+wfc1-fGEOGVP6--YexgjWgkZy6h1-o3QmK0a6SLnSChfeq+g@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_118_329297088.1488454174790"
X-Trace: blaine.gmane.org 1488454178 2317 195.159.176.226 (2 Mar 2017 11:29:38 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 2 Mar 2017 11:29:38 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDEP3I7TGEIJ7BHAYUCRUBADL3TXW@isocpp.org Thu Mar 02 12:29:33 2017
Return-path: <std-proposals+bncBDEP3I7TGEIJ7BHAYUCRUBADL3TXW@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDEP3I7TGEIJ7BHAYUCRUBADL3TXW@isocpp.org>)
	id 1cjOvK-00088W-9a
	for gclcip-std-proposals@m.gmane.org; Thu, 02 Mar 2017 12:29:30 +0100
Original-Received: by mail-yw0-f199.google.com with SMTP id 203sf118002856ywz.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 02 Mar 2017 03:29:36 -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=alkYHWHp7jy6TfyzdFsRbxYrXk1bfN4iK5Fi5LNYvP8=;
        b=HdCjDtaLHaP2VkMZwVLjMHpkJYIDw6X1V4Zj22XI0W/F7QLIhS2DH8wtGWwUDNgFUL
         Y7WawLSuTV+fsZ957m0bL+KyJNDsBrDfcUvrox6fGsG2jn0U90DcTAKhndNCIu42V0Fr
         qvTV6CmhW9vmqTmt5T2oK6kqbhhG/FyiYWv90Ja4P5hKlAMjPrnl4rvISfT93Be1wTWj
         4uOm5Fp3oPWdSvg4lR2Z5kajCA+sKdmGkBpic+KC//Ce+QDqelhi/O+qKVHFd4R7TItP
         Xi+JsyBIRi6aleJY7SYLifYkNcv6ufMi5mvSKEl2wY+IAxo9z7a3T1zmaG/Z2RwzJrYK
         9xtw==
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=alkYHWHp7jy6TfyzdFsRbxYrXk1bfN4iK5Fi5LNYvP8=;
        b=TWtWD/wG57BbI5HJl3X2C4l4JERMPlNPh93xX9OxmUGClKomLifGkx8lQqHzI+xzCQ
         3SvuvcIUhFX8IdCeCmCJwtbDjRAu6ytp6YpCqZ97YxBkpAZ6ITRaKiDWqYNx8PauSGe4
         cv0vpiUT8r9rfzzYL7E2ZPH+w+YB4ydpWi3bNMJF3NCfxRy4DiyycIT4jIIjKJXNOFHQ
         /pGo4XSmDcKNsXW1J1ieJmIuWw8MLL3bAWuCH1n3RwUz9/i291sMNuwP/eRNQK3D3gTU
         ZPrPq9rZyeslMVCaaZa2bDXzywUuzSW27FfQSqxCVFAIiQlXyJjATpSEsAgHeR3p2dBh
         Q91g==
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=alkYHWHp7jy6TfyzdFsRbxYrXk1bfN4iK5Fi5LNYvP8=;
        b=p3oKUe4xh4qyqXICsJdFoGmCZdOxpoWXshdEmt7aBcCfFf/C4mfp3eNLekwJn2gN14
         JMr2kK97kbI7OKsbCcbQoOTO0jtPA0DamU2S5xuqeGasA5dS3doTbPZ4hInNzlZ2JyBW
         +oUMeitb1eZC+ccOafMauNOQh5s09PFu/UC1rcxNgqqBXry9e9BSlz/souay6LBe6Stt
         ZbLMK2uhcNRDCXeCu6SLpUuRTI6M7dLGfFkkfymkPza4FkNismP1o3e/unT2bDMuVtkP
         LCPD/OoBeboUCRhtFMxgI6MfRz6lchG8ZR5aWg/UBqREGciKmoo3rX1TsQvj4FtktBNd
         rVbw==
X-Gm-Message-State: AMke39kanKagVWsBK+yTxqakc0KnKEJMMMi22clI0wrdompPn6+k/Pg9mxWN7aVpfoSuGw==
X-Received: by 10.13.220.195 with SMTP id f186mr557062ywe.121.1488454176231;
        Thu, 02 Mar 2017 03:29:36 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.32.34 with SMTP id n31ls5845952ota.4.gmail; Thu, 02 Mar
 2017 03:29:35 -0800 (PST)
X-Received: by 10.157.32.161 with SMTP id x30mr1519939ota.20.1488454175423;
        Thu, 02 Mar 2017 03:29:35 -0800 (PST)
In-Reply-To: <CA+wfc1-fGEOGVP6--YexgjWgkZy6h1-o3QmK0a6SLnSChfeq+g@mail.gmail.com>
X-Original-Sender: gpderetta@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:31309
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31309>

------=_Part_118_329297088.1488454174790
Content-Type: multipart/alternative; 
	boundary="----=_Part_119_1951193406.1488454174790"

------=_Part_119_1951193406.1488454174790
Content-Type: text/plain; charset=UTF-8

On Thursday, March 2, 2017 at 11:09:49 AM UTC, Oliver Kowalke wrote:
>
> 2017-03-02 11:52 GMT+01:00 Giovanni Piero Deretta <gpde...@gmail.com 
> <javascript:>>:
>
>>
>> [1] contrary to what P0534 claims, it describes delimited continuations; 
>> I'm not even sure you can have undelimited continuations when you have 
>> one-shot semantics.
>>
>
> undelimited continuations == no delimiter that tells you where the 
> continuatio nends, e.g. if you call callcc() from main(), it is undelimited 
>

there are a whole family of delimited continuations semantics each with 
slightly different delimiter/invoker semantics. shift/reset is just one of 
them. 

With undelimted continuation you can return from call/cc and fall back in 
the original continuation, while still holding the captured continuation, 
allowing returning 'twice'. This is of course not possible with oneshot 
continuation, and callcc (and yield), in a way, do inserts a prompt. Now, 
if I understand correctly, with shift/reset, shift finds the closest 
dynamically scoped reset in the callstack, while with callcc and yield, 
there is not a clear distinction between the prompt and the shift point as 
they are both continuations and they are statically scoped (on the other 
hand, asymmetric coroutines with an explicit thread local parent pointer 
more closely match shift/reset model).

Regarding main, the continuation is implicitly delimited as you can't fall 
further than that and return to the os instead. Oleg Kiselyov (which has 
done a lot of work on the topic) in fact claims that undelimited 
continuations do not really exist, as a delimiter always exists, it might 
just be outside of the programmer control.

Anyway, I don't pretend to understand fully the formal semantics of 
continuations, so I might be mistaken. It doesn't really matter that much 
for us C++ programmers though . 

-- gpd

-- 
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/5d94e416-e8bf-41e1-98f3-eee6133c9b64%40isocpp.org.

------=_Part_119_1951193406.1488454174790
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, March 2, 2017 at 11:09:49 AM UTC, Oliver Kowa=
lke wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><di=
v><div class=3D"gmail_quote">2017-03-02 11:52 GMT+01:00 Giovanni Piero Dere=
tta <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"uiMMo53zCQAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;">gpde...@gmail.com</a>&gt;</span>:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><span></span><div><br>[1] contrary to what=
 P0534 claims, it describes delimited continuations; I&#39;m not even sure =
you can have undelimited continuations when you have one-shot semantics.<br=
></div></div></blockquote></div><br></div><div>undelimited continuations =
=3D=3D no delimiter that tells you where the continuatio nends, e.g. if you=
 call callcc() from main(), it is undelimited <br></div></div></blockquote>=
<div><br>there are a whole family of delimited continuations semantics each=
 with slightly different delimiter/invoker semantics. shift/reset is just o=
ne of them. <br><br>With undelimted continuation you can return from call/c=
c and fall back in the original continuation, while still holding the captu=
red continuation, allowing returning &#39;twice&#39;. This is of course not=
 possible with oneshot continuation, and callcc (and yield), in a way, do i=
nserts a prompt. Now, if I understand correctly, with shift/reset, shift fi=
nds the closest dynamically scoped reset in the callstack, while with callc=
c and yield, there is not a clear distinction between the prompt and the sh=
ift point as they are both continuations and they are statically scoped (on=
 the other hand, asymmetric coroutines with an explicit thread local parent=
 pointer more closely match shift/reset model).<br><br>Regarding main, the =
continuation is implicitly delimited as you can&#39;t fall further than tha=
t and return to the os instead. Oleg Kiselyov (which has done a lot of work=
 on the topic) in fact claims that undelimited continuations do not really =
exist, as a delimiter always exists, it might just be outside of the progra=
mmer control.<br><br>Anyway, I don&#39;t pretend to understand fully the fo=
rmal semantics of continuations, so I might be mistaken. It doesn&#39;t rea=
lly matter that much for us C++ programmers though . <br></div><br>-- gpd<b=
r></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/5d94e416-e8bf-41e1-98f3-eee6133c9b64%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5d94e416-e8bf-41e1-98f3-eee6133c9b64=
%40isocpp.org</a>.<br />

------=_Part_119_1951193406.1488454174790--

------=_Part_118_329297088.1488454174790--

.
