Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] [RFC] Typed Properties

Posted by Nikita Popov 
Zeev Suraski
Re: [PHP-DEV] [RFC] Typed Properties
July 11, 2018 04:10PM
On Wed, Jul 11, 2018 at 4:44 PM Levi Morrison <[email protected]> wrote:

> > My logic is quite simple:
> > 1. Something as big as Typed Properties shouldn't be a last minute,
> rushed
> > RFC. Really - any RFC shouldn't - but in particular major language
> changes.
>
> I have seen this sentiment expressed elsewhere. I want to personally
> affirm that Nikita and Bob have been working hard on this for a long
> time. This is not a last minute change being rushed. They have been
> quite thorough and have discovered and fixed many edge cases that I
> suspect other authors would not have found or would have ignored. Yes,
> it is being voted on in the narrow gap between first alphas and
> feature freeze but that does not mean it is rushed.
>

It is being rushed as far as the RFC process & discussions around it are
concerned - that's what I meant. I did not dispute for a second that the
patch looks thoroughly thought out and a lot of effort went into it - it's
very evident and I acknowledged it already.

Zeev
Levi Morrison
Re: [PHP-DEV] [RFC] Typed Properties
July 11, 2018 04:50PM
> It is being rushed as far as the RFC process & discussions around it are concerned - that's what I meant.

I do not agree with this either. This has been previously discussed,
they have given it an ample discussion period, and it seems the only
reason it's not being voted on is because people don't want them to.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Zeev Suraski
Re: [PHP-DEV] [RFC] Typed Properties
July 11, 2018 05:00PM
On Wed, Jul 11, 2018 at 5:44 PM Levi Morrison <[email protected]> wrote:

> > It is being rushed as far as the RFC process & discussions around it are
> concerned - that's what I meant.
>
> I do not agree with this either. This has been previously discussed,
> they have given it an ample discussion period, and it seems the only
> reason it's not being voted on is because people don't want them to.
>

The only time I've heard about this was slightly under 3 weeks ago when
Nikita sent this RFC to internals - where he himself alluded to the fact
that this is "a large and complex proposal that may not be able to make the
deadline". To be clear, introducing such an RFC for discussion (a large
and complex one) after alphas have been released as opposed to months
before alphas are released constitutes as 'rushed' in my book, and
apparently in the books of others as well. You don't have to agree of
course as we're all obviously entitled to our own opinions...

Zeev
Sara Golemon
Re: [PHP-DEV] [RFC] Typed Properties
July 11, 2018 05:20PM
On Wed, Jul 11, 2018 at 10:43 AM, Levi Morrison <[email protected]> wrote:
>> It is being rushed as far as the RFC process & discussions around it are concerned - that's what I meant.
>
> I do not agree with this either. This has been previously discussed,
> they have given it an ample discussion period, and it seems the only
> reason it's not being voted on is because people don't want them to.
>
Well... it's not being voted on because, despite being six days till
the originally planned feature freeze date, neither sponsor has opened
a vote.

-Sara

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stanislav Malyshev
Re: [PHP-DEV] [RFC] Typed Properties
July 12, 2018 09:10PM
Hi!


> Ah, thanks, Nikita! Considering this, I'm not against delaying beta1
> for two weeks and having an alpha4, provided that we do not allow any
> new (i.e. not yet under discussion) RFC to target 7.3.
>
> Stas, what do you think?

Sorry for late answer, I've been behind my emails due to being extremely
busy.

I think we should go for 7.4 with this and take our time. Typed
properties is not some small deprecation or new function. It's a big
thing. If we rush it, it will become messy, there's no way around it. I
know about 7.4 "deprecations only" plans, but my personal take on this
it's too early to close on that, and between the choices of "fat 7.4"
and "rushing TP into 7.3 right now" I am firmly on the side of the former.

--
Stas Malyshev
smalyshev@gmail.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stas Malyshev
Re: [PHP-DEV] [RFC] Typed Properties
July 12, 2018 09:10PM
Hi!


> Well... it's not being voted on because, despite being six days till
> the originally planned feature freeze date, neither sponsor has opened
> a vote.

And I think it's a good thing. Both for selfish reasons (I haven't
actually have the time to read the proposal and the mail thread
properly yet, though I might be able to get to it next week) and for
procedural reasons - we're already in release process, we shouldn't be
voting on one of the biggest features in years this late. For me it
just doesn't feel right.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stanislav Malyshev
Re: [PHP-DEV] [RFC] Typed Properties
July 12, 2018 09:20PM
Hi!

> - As I said earlier, this patch has already been tested against some
> extremely tricky scenarios, so from a userland perspective it is safe for
> inclusion. If you don't have confidence in something related to it, please
> write a test case and help out.

It sounds like you are talking about "this patch" as if everything were
already done deal, all discussions are done, all decisions are made, all
implementations are finished, and the only thing we are left to decide
is when to press the "commit" button. Isn't it a bit early for this in
this stage to declare it done?
--
Stas Malyshev
smalyshev@gmail.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Marco Pivetta
Re: [PHP-DEV] [RFC] Typed Properties
July 12, 2018 09:30PM
Nope

On Thu, 12 Jul 2018, 21:10 Stanislav Malyshev, <[email protected]> wrote:

> Hi!
>
> > - As I said earlier, this patch has already been tested against some
> > extremely tricky scenarios, so from a userland perspective it is safe for
> > inclusion. If you don't have confidence in something related to it,
> please
> > write a test case and help out.
>
> It sounds like you are talking about "this patch" as if everything were
> already done deal, all discussions are done, all decisions are made, all
> implementations are finished, and the only thing we are left to decide
> is when to press the "commit" button. Isn't it a bit early for this in
> this stage to declare it done?
> --
> Stas Malyshev
> smalyshev@gmail.com
>
Rowan Collins
Re: [PHP-DEV] [RFC] Typed Properties
July 13, 2018 12:30PM
On 11 July 2018 at 14:44, Levi Morrison <[email protected]> wrote:

> > My logic is quite simple:
> > 1. Something as big as Typed Properties shouldn't be a last minute,
> rushed
> > RFC. Really - any RFC shouldn't - but in particular major language
> changes.
>
> I have seen this sentiment expressed elsewhere. I want to personally
> affirm that Nikita and Bob have been working hard on this for a long
> time. This is not a last minute change being rushed. They have been
> quite thorough and have discovered and fixed many edge cases that I
> suspect other authors would not have found or would have ignored. Yes,
> it is being voted on in the narrow gap between first alphas and
> feature freeze but that does not mean it is rushed.
>
>

They have indeed discovered many edge cases, and the RFC is extremely
thorough. But by the same token, they have made judgement calls about the
best way to handle some of those edge cases, and the RFC is 8000 words
long.

That's a lot of information for the rest of us to digest, and it's not just
trivia: accepting any implementation of this feature means making some
far-reaching decisions for the future typing functionality of the language.
For instance, I think the initialisation requirements for non-nullable
properties deserve a discussion in their own right, but I haven't yet had
time to write up my thoughts.

This isn't about rejecting the hard work that has gone into this; it's
about making sure there isn't some tweak we want to make before people
start building code that relies on it.


[Incidentally, I just noticed that we have both
https://wiki.php.net/rfc/typed-properties-v2 and
https://wiki.php.net/rfc/typed_properties_v2 - should this actually have
been "3.0"?]

Regards,
--
Rowan Collins
[IMSoP]
Nikita Popov
[PHP-DEV] Re: [RFC] Typed Properties
July 16, 2018 09:50PM
On Wed, Jun 20, 2018 at 11:59 PM, Nikita Popov <[email protected]> wrote:

> Hi internals,
>
> Bob and I would like to present a new typed properties proposal for your
> consideration:
>
> https://wiki.php.net/rfc/typed_properties_v2
>
> The proposal allows you to annotate properties with types, which are
> enforced at runtime. Unlike the previous RFC on this topic, the new
> proposal also supports typed static properties and references to typed
> properties.
>
> Please note that next to the main body, the RFC also contains an
> "Alternatives" section, which explores the problem space and considers
> trade-offs of different behaviors in some detail.
>
> Finally, while this RFC currently targets PHP 7.3, this is a large and
> complex proposal and we may not be able to meet the deadline, in which case
> this feature will go into the next PHP version.
>
> Regards,
> Nikita
>

Based on the feedback we received, we have decided to target PHP 7.4 for
this RFC. A main factor for this decision was that the RFC requires some
non-trivial changes to 3rd-party extensions for full compatibility. This
would put the ongoing (but nearly complete) effort to port extensions to
PHP 7.3 back to square one.

Now that the target version is decided and the last open questions in the
RFC have been resolved, we plan to open voting tomorrow.

Regards,
Nikita

PS: Thanks goes to the RMs for delaying the release schedule and providing
us with the opportunity to target PHP 7.3, even if we did not end up using
it.
Christoph M. Becker
[PHP-DEV] Re: [RFC] Typed Properties
July 16, 2018 11:20PM
On 16.07.2018 at 21:45, Nikita Popov wrote:

> Based on the feedback we received, we have decided to target PHP 7.4 for
> this RFC. A main factor for this decision was that the RFC requires some
> non-trivial changes to 3rd-party extensions for full compatibility. This
> would put the ongoing (but nearly complete) effort to port extensions to
> PHP 7.3 back to square one.
>
> PS: Thanks goes to the RMs for delaying the release schedule and providing
> us with the opportunity to target PHP 7.3, even if we did not end up using
> it.

Thanks for the careful decision. :)

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sara Golemon
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 16, 2018 11:50PM
On Mon, Jul 16, 2018 at 3:45 PM, Nikita Popov <[email protected]> wrote:
> Based on the feedback we received, we have decided to target PHP 7.4 for
> this RFC. A main factor for this decision was that the RFC requires some
> non-trivial changes to 3rd-party extensions for full compatibility. This
> would put the ongoing (but nearly complete) effort to port extensions to
> PHP 7.3 back to square one.
>
I look forward to seeing this in 7.4!

> PS: Thanks goes to the RMs for delaying the release schedule and providing
> us with the opportunity to target PHP 7.3, even if we did not end up using
> it.
>
Ultimately, that was for the other RFCs as much as for TP. What's
important is that PHP continues moving forward.

-Sara

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Zeev Suraski
RE: [PHP-DEV] Re: [RFC] Typed Properties
July 17, 2018 12:20AM
> Based on the feedback we received, we have decided to target PHP 7.4 for this
> RFC. A main factor for this decision was that the RFC requires some non-trivial
> changes to 3rd-party extensions for full compatibility. This would put the
> ongoing (but nearly complete) effort to port extensions to PHP 7.3 back to
> square one.

As I mentioned beforehand, I think it's good it wasn't rushed into 7.3 and at the same time sorry it's not being targeted for 8.0.

> Now that the target version is decided and the last open questions in the RFC
> have been resolved, we plan to open voting tomorrow.

IMHO one of the key reasons for not putting it into 7.3 was the fact that very little discussion about the actual proposal actually happened because it arrived so late in the 7.3 release cycle. Most of the discussion under the Typed Properties thread actually had to do with whether or not it should go into 7.3, 7.4 or 8.0 - and not about the specifics of the proposal. I skimmed through the thread and found just a handful of responses that dealt with the specific of the proposals - most of them unanswered (unless I'm missing some internals email somehow).

With this in mind, I think that now that the meta parts are finalized, we should allow a bit more time for real meaningful discussion about the proposal to happen. I understand that you don't want to delay this to a later time in the 7.4 process, but delaying it by a week or so will allow people to actually review the proposal in more detail without the uncertainty that surrounded it beforehand - and perhaps have their concerns addressed. Given that 7.4's finalization date is a year away, and there are no conflicting RFCs in the queue - a week will not have any sort of negative influence on the proposal, but might have some positive impact on its contents.

Zeev
Niklas Keller
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 17, 2018 09:00AM
Zeev Suraski <[email protected]> schrieb am Di., 17. Juli 2018, 00:10:

> > Based on the feedback we received, we have decided to target PHP 7.4 for
> this
> > RFC. A main factor for this decision was that the RFC requires some
> non-trivial
> > changes to 3rd-party extensions for full compatibility. This would put
> the
> > ongoing (but nearly complete) effort to port extensions to PHP 7.3 back
> to
> > square one.
>
> As I mentioned beforehand, I think it's good it wasn't rushed into 7.3 and
> at the same time sorry it's not being targeted for 8.0.
>
> > Now that the target version is decided and the last open questions in
> the RFC
> > have been resolved, we plan to open voting tomorrow.
>
> IMHO one of the key reasons for not putting it into 7.3 was the fact that
> very little discussion about the actual proposal actually happened because
> it arrived so late in the 7.3 release cycle. Most of the discussion under
> the Typed Properties thread actually had to do with whether or not it
> should go into 7.3, 7.4 or 8.0 - and not about the specifics of the
> proposal. I skimmed through the thread and found just a handful of
> responses that dealt with the specific of the proposals - most of them
> unanswered (unless I'm missing some internals email somehow).
>
> With this in mind, I think that now that the meta parts are finalized, we
> should allow a bit more time for real meaningful discussion about the
> proposal to happen. I understand that you don't want to delay this to a
> later time in the 7.4 process, but delaying it by a week or so will allow
> people to actually review the proposal in more detail without the
> uncertainty that surrounded it beforehand - and perhaps have their concerns
> addressed. Given that 7.4's finalization date is a year away, and there
> are no conflicting RFCs in the queue - a week will not have any sort of
> negative influence on the proposal, but might have some positive impact on
> its contents.
>
> Zeev
>

I'd also like to ask for a further discussion period. Seems like there is
quite some discussion going on right now.

Regards, Niklas

>
Nikita Popov
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 17, 2018 08:10PM
On Tue, Jul 17, 2018 at 12:10 AM, Zeev Suraski <[email protected]> wrote:

> > Based on the feedback we received, we have decided to target PHP 7.4 for
> this
> > RFC. A main factor for this decision was that the RFC requires some
> non-trivial
> > changes to 3rd-party extensions for full compatibility. This would put
> the
> > ongoing (but nearly complete) effort to port extensions to PHP 7.3 back
> to
> > square one.
>
> As I mentioned beforehand, I think it's good it wasn't rushed into 7.3 and
> at the same time sorry it's not being targeted for 8.0.
>
> > Now that the target version is decided and the last open questions in
> the RFC
> > have been resolved, we plan to open voting tomorrow.
>
> IMHO one of the key reasons for not putting it into 7.3 was the fact that
> very little discussion about the actual proposal actually happened because
> it arrived so late in the 7.3 release cycle. Most of the discussion under
> the Typed Properties thread actually had to do with whether or not it
> should go into 7.3, 7.4 or 8.0 - and not about the specifics of the
> proposal. I skimmed through the thread and found just a handful of
> responses that dealt with the specific of the proposals - most of them
> unanswered (unless I'm missing some internals email somehow).
>
> With this in mind, I think that now that the meta parts are finalized, we
> should allow a bit more time for real meaningful discussion about the
> proposal to happen. I understand that you don't want to delay this to a
> later time in the 7.4 process, but delaying it by a week or so will allow
> people to actually review the proposal in more detail without the
> uncertainty that surrounded it beforehand - and perhaps have their concerns
> addressed. Given that 7.4's finalization date is a year away, and there
> are no conflicting RFCs in the queue - a week will not have any sort of
> negative influence on the proposal, but might have some positive impact on
> its contents.
>
> Zeev
>

Sure, we can wait another week. Unless the additional discussion results in
major changes to the RFC, we'll start voting next Monday (2018-07-23). In
the interest of avoiding further delays, please try to view this as a hard
deadline: If you would like to discuss some aspect of the proposal or raise
a concern, please do so now rather than on Monday morning.

Nikita
Zeev Suraski
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 17, 2018 09:40PM
On 17 Jul 2018, at 21:02, Nikita Popov <[email protected]<mailto:[email protected]>> wrote:

On Tue, Jul 17, 2018 at 12:10 AM, Zeev Suraski <[email protected]<mailto:[email protected]>> wrote:
> Based on the feedback we received, we have decided to target PHP 7.4 for this
> RFC. A main factor for this decision was that the RFC requires some non-trivial
> changes to 3rd-party extensions for full compatibility. This would put the
> ongoing (but nearly complete) effort to port extensions to PHP 7.3 back to
> square one.

As I mentioned beforehand, I think it's good it wasn't rushed into 7.3 and at the same time sorry it's not being targeted for 8.0.

> Now that the target version is decided and the last open questions in the RFC
> have been resolved, we plan to open voting tomorrow.

IMHO one of the key reasons for not putting it into 7.3 was the fact that very little discussion about the actual proposal actually happened because it arrived so late in the 7.3 release cycle. Most of the discussion under the Typed Properties thread actually had to do with whether or not it should go into 7.3, 7.4 or 8.0 - and not about the specifics of the proposal. I skimmed through the thread and found just a handful of responses that dealt with the specific of the proposals - most of them unanswered (unless I'm missing some internals email somehow).

With this in mind, I think that now that the meta parts are finalized, we should allow a bit more time for real meaningful discussion about the proposal to happen. I understand that you don't want to delay this to a later time in the 7.4 process, but delaying it by a week or so will allow people to actually review the proposal in more detail without the uncertainty that surrounded it beforehand - and perhaps have their concerns addressed. Given that 7.4's finalization date is a year away, and there are no conflicting RFCs in the queue - a week will not have any sort of negative influence on the proposal, but might have some positive impact on its contents.

Zeev

Sure, we can wait another week. Unless the additional discussion results in major changes to the RFC, we'll start voting next Monday (2018-07-23). In the interest of avoiding further delays, please try to view this as a hard deadline: If you would like to discuss some aspect of the proposal or raise a concern, please do so now rather than on Monday morning.

Much appreciated - thank you!

Zeev
Zeev Suraski
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 19, 2018 11:00AM
On Tue, Jul 17, 2018 at 9:02 PM Nikita Popov <[email protected]> wrote:

>
> Sure, we can wait another week. Unless the additional discussion results in
> major changes to the RFC, we'll start voting next Monday (2018-07-23). In
> the interest of avoiding further delays, please try to view this as a hard
> deadline: If you would like to discuss some aspect of the proposal or raise
> a concern, please do so now rather than on Monday morning.
>

I reviewed the proposal in detail - and quite detailed it is. It seems
like you and Bob did a very thorough job here, kudos on that.

I do have 3 comments - none of them major - but I think should be addressed
nonetheless:

1. The RFC is surprisingly sparse on examples where the typed properties
are not scalar ones. So much, in fact, that I had to check whether this is
intentional (i.e., classes are unsupported as enforced property types) or
an oversight. Reviewing the 'Supported Types' section, while mentioning a
ClassOrInterface - isn't entirely clear, as it's unclear whether this is a
token, or something that stands for any class name or interface.
Thankfully the proposal does cover class and interface names as property
type definitions. I would recommend to be explicit here, and say "any
class or interface name", and ideally also provide a sample of that option
in the Introduction section of the RFC.
2. While trying to understand whether #1 was in fact supported and
reviewing the patch, I noticed that there were several comments from Dmitry
on the patch (within the pull request). It would be nice if they were
addressed (none of them will turn the patch upside down, and as I see it
they are orthogonal to the vote).
3. The patch does bring a performance penalty, albeit quite small (every
property assignment now has to conduct type safety checks). This does not
only affect code that uses typed properties - but also code that doesn't.
I think this should be mentioned in the RFC. To be clear - I don't think
the penalty is substantial enough to change someone's opinion about the
merits of the proposal one way or another - but in the spirit of full
disclosure it should be there.

Zeev
Dmitry Stogov
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 19, 2018 01:40PM
I've run few benchmarks, to measure the performance penalty of this proposal.


https://gist.github.com/dstogov/b9fc0fdccfb8bf7bae121ce3d3ff1db1


In most cases real-life apps become ~1% slower. In the worst case, I got 6% slowdown (on mediawiki).


Thanks. Dmitry.

________________________________
From: Zeev Suraski <[email protected]>
Sent: Thursday, July 19, 2018 11:52:37 AM
To: Nikita Popov
Cc: Zeev Suraski; Internals
Subject: Re: [PHP-DEV] Re: [RFC] Typed Properties

On Tue, Jul 17, 2018 at 9:02 PM Nikita Popov <[email protected]> wrote:

>
> Sure, we can wait another week. Unless the additional discussion results in
> major changes to the RFC, we'll start voting next Monday (2018-07-23). In
> the interest of avoiding further delays, please try to view this as a hard
> deadline: If you would like to discuss some aspect of the proposal or raise
> a concern, please do so now rather than on Monday morning.
>

I reviewed the proposal in detail - and quite detailed it is. It seems
like you and Bob did a very thorough job here, kudos on that.

I do have 3 comments - none of them major - but I think should be addressed
nonetheless:

1. The RFC is surprisingly sparse on examples where the typed properties
are not scalar ones. So much, in fact, that I had to check whether this is
intentional (i.e., classes are unsupported as enforced property types) or
an oversight. Reviewing the 'Supported Types' section, while mentioning a
ClassOrInterface - isn't entirely clear, as it's unclear whether this is a
token, or something that stands for any class name or interface.
Thankfully the proposal does cover class and interface names as property
type definitions. I would recommend to be explicit here, and say "any
class or interface name", and ideally also provide a sample of that option
in the Introduction section of the RFC.
2. While trying to understand whether #1 was in fact supported and
reviewing the patch, I noticed that there were several comments from Dmitry
on the patch (within the pull request). It would be nice if they were
addressed (none of them will turn the patch upside down, and as I see it
they are orthogonal to the vote).
3. The patch does bring a performance penalty, albeit quite small (every
property assignment now has to conduct type safety checks). This does not
only affect code that uses typed properties - but also code that doesn't.
I think this should be mentioned in the RFC. To be clear - I don't think
the penalty is substantial enough to change someone's opinion about the
merits of the proposal one way or another - but in the spirit of full
disclosure it should be there.

Zeev
André Rømcke
Re: [PHP-DEV] Re: [RFC] Typed Properties
July 23, 2018 03:00PM
> On 19 Jul 2018, at 13:34, Dmitry Stogov <[email protected]> wrote:
>
> I've run few benchmarks, to measure the performance penalty of this proposal.
>
>
> https://gist.github.com/dstogov/b9fc0fdccfb8bf7bae121ce3d3ff1db1
>
>
> In most cases real-life apps become ~1% slower. In the worst case, I got 6% slowdown (on mediawiki).


Nice overview.

Is there any overview of how it will improve performance for code moving from magic getters / setters to this?

Or is there interest in such a comparison?

(Context: working on a larger open source project where that is used quite a bit for type and read-only safety checks.)


Best,
André
Sorry, only registered users may post in this forum.

Click here to login