VOOZH about

URL: https://externals.io/message/109713

⇱ [VOTE] Attributes v2 RFC Vote is open - Externals


[VOTE] Attributes v2 RFC Vote is open

Hello,

I have opened the vote on the Attributes v2 RFC. The voting will be open
until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

Thank you everyone for taking part in the detailed discussion.

greetings
Benjamin

I have opened the vote on the Attributes v2 RFC. The voting will be
open until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

It's unfortunate that the RFC doesn't more fully enumerate the
advantages/disadvantages of the proposed syntax options.

It only points out that the T_ATTRIBUTE @: syntax is shorter and
more familiar, but claims that it has the downside of not permitting
whitespace in attribute names (it's not clear this is really an
advantage - just an opportunity for arguments about code style).

But if you look at the pull request for the @: syntax [1], there is
a much more complete comparison. For example, the <<>> syntax is more
verbose, unfamiliar to most people, and even Hack seems to be moving
away from it. Furthermore, because it reuses existing tokens with a
different meaning, it results in expressions that can be very difficult
to read. For example:

const Baz = 2;

<<FooAttribute(2 * 3 + 3)>><<Bar(4 + 5 * 2)>>
<<BarAttribute(2 * (3 + 3)>>Baz, (4 + 5) * 2)>>
function foo() {}

If PHP gets generics in the future (hopefully it does), the syntax will
likely get even more confusing (if not a lot of PHP developers use shift
tokens, certainly a lot more will use generics).

The @: syntax makes it much more obvious where separate attributes
are being used vs. constant expressions containing a shift token:

@:FooAttribute(2 * 3 + 3)
@:Bar(4 + 5 * 2)
@:BarAttribute(2 * (3 + 3)>>Baz, (4 + 5) * 2)
function foo() {}


In addition, the `@:` syntax is less verbose, and much closer to the
attribute syntax developers are familiar with using in PHPDoc comments,
as well as the syntax with precedence in other languages such as Java
and Python.

The syntax choice is very important, the language will be stuck with
it for a very long time!

Best regards,
Theodore

[1]: https://github.com/kooldev/php-src/pull/2

Hi,

Benjamin Eberlei wrote:

Hello,

I have opened the vote on the Attributes v2 RFC. The voting will be open
until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

Thank you everyone for taking part in the detailed discussion.

greetings
Benjamin

Thanks for putting this to a vote. I remember I had some comments about
autoloading behaviour and you changed the behaviour in the RFC, but I
didn't get around to reading it again. I am concerned though that it
doesn't seem to say anymore when autoloading happens, if at all? Can
that be clarified?

Thanks,
Andrea

Hello everyone,

i just closed the vote. Attributes v2 was accepted with 51 yay, 1 nay. The
selected syntax will be <<Attribute>>.

Thank you everyone for participating in the discussion and vote!

We will start work on merging the patch (quite a few review comments are
already addressed). In addition we will probably put up discussion for some
adjustments/additions for a follow up RFC over the next few days.

greetings
Benjamin

On Mon, Apr 20, 2020 at 11:18 AM Benjamin Eberlei kontakt@beberlei.de
wrote:

Hello,

I have opened the vote on the Attributes v2 RFC. The voting will be open
until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

Thank you everyone for taking part in the detailed discussion.

greetings
Benjamin

Hello everyone,

i just closed the vote. Attributes v2 was accepted with 51 yay, 1 nay. The
selected syntax will be <<Attribute>>.

Thank you everyone for participating in the discussion and vote!

We will start work on merging the patch (quite a few review comments are
already addressed). In addition we will probably put up discussion for some
adjustments/additions for a follow up RFC over the next few days.

greetings
Benjamin

On Mon, Apr 20, 2020 at 11:18 AM Benjamin Eberlei kontakt@beberlei.de
wrote:

Hello,

I have opened the vote on the Attributes v2 RFC. The voting will be open
until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

Thank you everyone for taking part in the detailed discussion.

greetings
Benjamin

Calling it now: This is going to be Drupal 8's "signature feature" the same way property types was for 7.4.

Woohoo!

--Larry Garfield

I would actually go as far as to say that this is going to be PHP 8
signature
feature.

Best regards,
Benas Seliuginas

I would actually go as far as to say that this is going to be PHP 8
signature
feature.

Best regards,
Benas Seliuginas

... I spent way too long working on that project... sigh Yeah, PHP 8.0. :-P

--Larry Garfield

Am 04.05.2020 um 19:34 schrieb Benas IML:

I would actually go as far as to say that this is going to be PHP 8
signature feature.

It certainly is for me.

Hey Andrea,

Hi,

Benjamin Eberlei wrote:

Hello,

I have opened the vote on the Attributes v2 RFC. The voting will be open
until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

Thank you everyone for taking part in the detailed discussion.

greetings
Benjamin

Thanks for putting this to a vote. I remember I had some comments about
autoloading behaviour and you changed the behaviour in the RFC, but I
didn't get around to reading it again. I am concerned though that it
doesn't seem to say anymore when autoloading happens, if at all? Can
that be clarified?

Thanks,
Andrea

From my review of the tests, autoloading occurs when an object is being
requested (via newInstance() call on a reflection attribute).

Until then, the same semantics as the ::class pseudo-constant apply.

Hey Andrea,

Hi,

Benjamin Eberlei wrote:

Hello,

I have opened the vote on the Attributes v2 RFC. The voting will be
open
until two weeks from now, May 4th 2020, noon UTC.

RFC: https://wiki.php.net/rfc/attributes_v2

I know that I'm "too late" to be making suggestions, but I would like to see
a new "@@" operator over the proposed <<...>> or @:.

While it is possible (!!) that some code is already using a double
@-operator
in a way that would conflict, I'd posit that it is a reasonable BC break in
return
for a subjectively nicer (for want of a better word) attribute operator.

Nikita and Sara shared similar grumblings in unofficial channels [1] [2].

However, there is something to be said for just deciding on anything and
rolling forward with it.

[1] https://chat.stackoverflow.com/rooms/11/conversation/at-at-01
and https://chat.stackoverflow.com/rooms/11/conversation/at-at-02
[2]
https://www.reddit.com/r/PHP/comments/g4psl5/rfc_attributes_vote_is_open_now/fnz97fk/

Thank you everyone for taking part in the detailed discussion.

greetings
Benjamin

Thanks for putting this to a vote. I remember I had some comments about
autoloading behaviour and you changed the behaviour in the RFC, but I
didn't get around to reading it again. I am concerned though that it
doesn't seem to say anymore when autoloading happens, if at all? Can
that be clarified?

Thanks,
Andrea

From my review of the tests, autoloading occurs when an object is being
requested (via newInstance() call on a reflection attribute).

Until then, the same semantics as the ::class pseudo-constant apply.

I know that I'm "too late" to be making suggestions, but I would like to
see
a new "@@" operator over the proposed <<...>> or @:.

I support this, and agree with Theodore Brown's earlier message (
https://externals.io/message/109713#109717).

Peter

On Tue, Apr 21, 2020 at 12:39 PM Peter Bowyer phpmailinglists@gmail.com
wrote:

On Tue, 21 Apr 2020 at 09:15, Peter Cowburn petercowburn@gmail.com
wrote:

I know that I'm "too late" to be making suggestions, but I would like to
see
a new "@@" operator over the proposed <<...>> or @:.

I support this, and agree with Theodore Brown's earlier message (
https://externals.io/message/109713#109717).

The discussion on this RFC was 5 weeks and the syntax suggestions until
yesterday have all been suboptimal.

While the nerd reference of a potential AT-AT operator gives me tickles,
same with the now included smiley alternative @: these approaches have the
downside that they don't have an end token, and are therefore visually
"harder" to spot on declarations (subjective impression). It is my belief
that even with @@ as secondary alternative the <<>> syntax would still
prevail for this reason.

I remember reasonably well how internals exploded when the namespace
operator was selected, everyone was making their own appeal to the syntax
gods for something different.

Please be reminded how this is the 7th RFC on attributes in PHP and on many
of the previous ones the problems came down to syntax, except the
Attributes v1 where <<>> was proposed as well and the implementation
(exposed ast\node, no namespacing) was the primary reason for it getting
rejected.

Peter

The discussion on this RFC was 5 weeks and the syntax suggestions until
yesterday have all been suboptimal.

I appreciate the discussion period was 5 weeks, which was a generous
allowance. It's also been an unusual 5+ weeks, with life and priorities
disrupted for many people.

Best wishes,
Peter