Re: [RFC] Asymmetric Visibility, v2

From: Date: Mon, 05 Aug 2024 15:42:09 +0000
Subject: Re: [RFC] Asymmetric Visibility, v2
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Mon, Aug 5, 2024, at 7:27 AM, Vincent de Lau wrote:
> From: Rob Landers <[email protected]> 
> Sent: Sunday, July 21, 2024 11:21 AM
>
>> On Sat, Jul 20, 2024, at 23:51, Larry Garfield wrote:
>> > On Sat, Jul 20, 2024, at 7:22 AM, Rodrigo Vieira wrote:
>> > > Will the alternative syntax on hook not even be put to a vote?
>
>> > It was, a year and a half ago when Aviz was first proposed.  The preference was
>> > split, but leaned toward the prefix-style syntax.  So we went with that.  I don't think
>> > we'll ever get everyone to want the same syntax, but we're using the one that was both
>> > somewhat more popular, and (as discussed in the RFC) arguably superior.
>
>> > As the "comments in yield from" thread has shown, *any* even slight change
>> > to PHP's syntax will require work from static analysis tools.  That's the nature of the
>> > problem space, regardless of the syntax specifics.
>
>> Just to play devil’s advocate, it was also before we had property hooks who advertised
>> itself as a way to “wrap and guard access to object properties” but we are simply ignoring their
>> existence here.
>
> I'm very disappointed that this discussion was not concluded before the 
> vote was started. One of the main arguments for picking this syntax is 
> the research from two years ago, when hooks where not a thing. In my 
> opinion that makes that whole research obsolete in this new context. 
> I've asked to redo the research, but that was not acknowledged
>
> For the 'split visibility' concern, there has been some mentioning of 
> reviving the var keyword, allowing you to place all visibility in the 
> hook block.
>
> While I don't have the 'perfect' syntax in mind, I strongly believe 
> that this subject required a bit more investigation and discussion. My 
> only hope now is that the people voting take this into consideration, 
> especially as this is now being rushed into 8.4.

While hooks were not a feature when Aviz was first proposed, it was very clear at the time that they
were coming, and the syntax was mostly already figured out, at least in broad strokes.  It's
not like no one knew we'd be having {} after the property if hooks pass.  I would not call the
results obsolete.  Rather, I think what it shows is that there's no syntax that will satisfy
everyone, so trying to find a syntax favored by everyone would just waste time and end in failure
anyway.

I would hardly call this rushed; it was open for multiple months, and built on the previous
discussion in 2023.  Lazy Objects, for instance, was first proposed a month after aviz, and started
its vote on the same day..  (No shade on Lazy Objects; I'm happy to see that passing.)

--Larry Garfield


Thread (57 messages)

« previous php.internals (#124771) next »