Re: [RFC] Short Closures 2, aka auto-capture take 3
| From: | Arnaud Le Blanc | Date: | Mon, 13 Jun 2022 12:29:53 +0000 |
| Subject: | Re: [RFC] Short Closures 2, aka auto-capture take 3 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117930@lists.php.net to get a copy of this message | ||
On dimanche 12 juin 2022 20:05:02 CEST Dan Ackroyd wrote:
> On Thu, 9 Jun 2022 at 17:34, Larry Garfield <larry@garfieldtech.com> wrote:
> > That RFC didn't fully go to completion due to concerns over the
> > performance impact
> I don't believe that is an accurate summary. There were subtle issues
> in the previous RFC that should have been addressed. Nikita Popov
> wrote in https://news-web.php.net/php.internals/114239
> It would produce a better discussion if the RFC document either said
> how those issues are resolved, or detail how they are still
> limitations on the implementation.
> To be clear, I don't fully understand all those issues myself (and I
> have just enough knowledge to know to be scared to look at that part
> of the engine) but my understanding is that the concerns are not about
> just performance, they are deep concerns about the behaviour.
Thank you for pointing this out. Nikita was referring to side-effects of
capturing too much variables, and suggested to make the capture analysis
behavior explicitly unspecified in the RFC so that it could be changed
(optimized) later.
The new version of the RFC does the optimization.
Following your comment, I have clarified a few things in the "Auto-capture
semantics" section. This includes a list of way in which these effects can be
observed. These are really marginal cases that are not relevant for most
programs.
Cheers
--
Arnaud Le Blanc