Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59360 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91080 invoked from network); 6 Apr 2012 00:52:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Apr 2012 00:52:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ww.galen@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ww.galen@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: ww.galen@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:33761] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/4A-30259-F4E3E7F4 for ; Thu, 05 Apr 2012 20:52:33 -0400 Received: by iaeh11 with SMTP id h11so3021770iae.29 for ; Thu, 05 Apr 2012 17:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=795cGDs0WYUTVoXPiXg23DFPYngTkSl853pkAsu0Z9M=; b=bi88jx31EZLTnelj2F+IJOtI2eEdTtKawSffAnpCyE4nppi29mY82BOofeFIEtkzvI qXRPOD0OUxtkuPo+wyx7gpEMDMXBVQy8FZR/+MWTfZANp8TANKwQvNFtjZdNS1rd6jyt lsLiooNJvO2h81Omk1dGIaGKoy7IEVZEOBtHyXZF32T8dduls0UJmUh5KzQycIFGUcB9 I0dD/MCUceuDsxwobCl+QwPlGk8vO85cB1VomJrriYdJyxyfOTc501veFCvmQslGvRP8 DKtfkPJ87l3b43WFOQaJ77LHyaWw6rE+yFZQ8VF46ZuFJdSSpaSxrKN/Wg4anYN1bk3E PI0Q== Received: by 10.42.58.76 with SMTP id g12mr585326ich.32.1333673548674; Thu, 05 Apr 2012 17:52:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.164.132 with HTTP; Thu, 5 Apr 2012 17:51:48 -0700 (PDT) In-Reply-To: <4F7E2F1B.2030109@sugarcrm.com> References: <2FD77C3003DC4656BCF6309B097DD978@gmail.com> <4F7E1FB8.7020108@sugarcrm.com> <4F7E2F1B.2030109@sugarcrm.com> Date: Thu, 5 Apr 2012 17:51:48 -0700 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf30334a051d747d04bcf81278 Subject: Re: [PHP-DEV] resume after exception From: ww.galen@gmail.com (Galen Wright-Watson) --20cf30334a051d747d04bcf81278 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Apr 5, 2012 at 4:47 PM, Stas Malyshev wrote: > > However, in general, thinking about more complex flow control structures > in fine. Just there's no reason to get exceptions mixed into it. > > Agreed. While restarting and resuming after exceptions could be useful, and a condition signaling control structure could also be useful, the two should be distinguished at the language level (even if they were implemented using the same mechanism under the hood). So, what do people think of some sort of retry mechanism for exceptions? What about a (separate) condition signaling control structure? What about serializable continuations, allowing for resuming execution in a separate request? CPS offers an alternative to the first two. As much as the idea appeals to me, retries seem less useful to me in PHP than in other languages unless (as Rasmus initially suggested) execution were serializable, which I suspect would be a heavy feature. Serializable continuations would require the most work to implement using PHP if it's never supported by the language itself. I suspect that serializable continuations will be space-inefficient no matter where they're implemented. Web continuations may not be common practice now, but part of the reason for that may be lack of support. It could become more popular if it were available. On the other hand, PHP's heritage as a templating language means serializable continuations may be just as much a problem as "die" or "exit" is, as they can result in invalid HTML. --20cf30334a051d747d04bcf81278--