Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-08 Thread Markus Fischer
Hi Theodore, On 08.06.20 06:36, Theodore Brown wrote: ```php // 170 characters for attributes (162 not counting leading whitespace) << ManyToMany(Phonenumber::class), JoinTable("users_phonenumbers"), JoinColumn("user_id", "id"), InverseJoinColumn("phonenumber_id", "id",

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-08 Thread Larry Garfield
On Sun, Jun 7, 2020, at 11:36 PM, Theodore Brown wrote: > > Bracket-based syntaxes, particularly with grouping, are more clearly > > separated from the main code, particularly when used inline. For instance: > > > > `$f = @@Something @@AnotherThing function(@@Special @@ReallyInt int $var) > >

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-07 Thread Theodore Brown
Hi Rowan, On Sun, June 7, 2020 at 5:32 PM Rowan Tommins wrote: > On 07/06/2020 19:37, Theodore Brown wrote: > > Yes, I agree that there's a judgment call to make. Out of curiosity, > > given these shortcomings of the double-angle-bracket syntax, do you > > think there are any objective reasons

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-07 Thread Rowan Tommins
On 07/06/2020 19:37, Theodore Brown wrote: If `<> )>>` means something like `new Foo( new Bar )`, then I can imagine it being useful for `<> )>>` to mean `new Foo( [new Bar, new Baz] )`. That would actually be more convenient than the double-at version, where you'd have to write `@@Foo( [@@Bar,

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-07 Thread Theodore Brown
Hi Rowan, On Sat, June 6, 2020 at 7:06 AM Rowan Tommins wrote: > The `::` token in the parser is called `T_PAAMAYIM_NEKUDOTAYIM`, and > personally I find `T_SL` and `T_SR` just as cryptic and irrelevant. The most > common place I see those token names is when accidentally running code > with

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-06 Thread Rowan Tommins
Hi Theodore, Firstly, sorry if my previous e-mail came across overly negative, I wasn't in the best mood when I wrote it (gestures vaguely at the state of the world). I think this is possibly the best line I've read all week: Well, I guess the line between objective and subjective may

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Theodore Brown
On Thu, June 4, 2020 at 12:19 PM Rowan Tommins wrote: > Hi Theodore, Hi Rowan, Thanks for the feedback. I added replies inline. > I find the "objective" reasons in this RFC to be greatly exaggerated. > > 1. `@@Jit` does not require "half as many characters" as `<>`; > even for this, which is

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Theodore Brown
On Thu, June 4, 2020 at 3:28 PM Marcio Almada wrote: > I'd also prefer any attribute syntax without the bracket-like pair > of tokens. I'm just a bit confused about the RFC itself and the PR > content at this point. > > The RFC is currently proposing `@@MyAttribute()` and the PR > is currently

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Marcio Almada
Hello! > > Hi internals, > > I discussed the syntax for attributes further with Benjamin, Martin, > and several other internals developers off-list, and with their > feedback completed an RFC proposing to use the shorter `@@` syntax > instead of `<<>>` for attributes in PHP 8. I'd also prefer any

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Rowan Tommins
On Thu, 4 Jun 2020 at 00:55, Theodore Brown wrote: > https://wiki.php.net/rfc/shorter_attribute_syntax > > The goal is not to bikeshed over subjective syntax preferences, > but to address several concrete shortcomings related to verbosity, > nested attributes, confusion with generics and other

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Ben Ramsey
> On Jun 3, 2020, at 18:54, Theodore Brown wrote: > > Hi internals, > > I discussed the syntax for attributes further with Benjamin, Martin, > and several other internals developers off-list, and with their > feedback completed an RFC proposing to use the shorter `@@` syntax > instead of `<<>>`

RE: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Iván Arias
>> As we are creating new syntax, why not simply use another single >> symbol? Here are some examples: >> >> ```php >> *Deprecated >> %Deprecated >> >Deprecated >> >> function foo() { } >> ``` >> >> I'm not 100% sure if all this symbols could by used in that context, >> but I think I prefer any

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Theodore Brown
On Thu, June 4, 2020 at 6:55 AM Jordi Boggiano wrote: > Thanks for the write-up. I didn't feel strongly either way before but > after reading the RFC I am hoping it passes. > > Another fringe benefit is the ability to grep for attributes, @@ does > not occur anywhere in a couple projects I

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Theodore Brown
On Thu, June 4, 2020 at 5:39 AM Iván Arias wrote: > As we are creating new syntax, why not simply use another single > symbol? Here are some examples: > > ```php > *Deprecated > %Deprecated > >Deprecated > > function foo() { } > ``` > > I'm not 100% sure if all this symbols could by

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Theodore Brown
On Thu, June 4, 2020 at 5:37 AM Ilija Tovilo wrote: >>> Does the PHP parser prevent us from adopting #[attr]? I presume >>> C#'s [attr] syntax and C++'s [[attr]] are impossible due to >>> PHP's short array syntax. >> >> yes, that would create ambiguity in the parser since `#` (just >> like

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Jordi Boggiano
Hey, On 04/06/2020 01:54, Theodore Brown wrote: I discussed the syntax for attributes further with Benjamin, Martin, and several other internals developers off-list, and with their feedback completed an RFC proposing to use the shorter `@@` syntax instead of `<<>>` for attributes in PHP 8.

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Benas IML
Hey! That's why I am against this RFC or any other "change style to what I prefer". PHP's current attribute syntax is consistent with other languages and poses no BC breaks whatsoever. Best regards, Benas On Thu, Jun 4, 2020, 1:37 PM Ilija Tovilo wrote: > > > Does the PHP parser prevent us

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Iván Arias
Hi all, I understand that is better to replicate syntax from another language, but the only valid syntax seems to be the current one (Hack's <<>>). The proposed syntax in this RFC is a new syntax that is not directly used in another language, but an adaptation, and it includes a little BC

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Ilija Tovilo
> > Does the PHP parser prevent us from adopting #[attr]? I presume C#'s [attr] > > syntax and C++'s [[attr]] are impossible due to PHP's short array syntax. > > yes, that would create ambiguity in the parser since `#` (just like `//`) > is for comments. I've mentioned this off-list before. If

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Benas IML
Hello, yes, that would create ambiguity in the parser since `#` (just like `//`) is for comments. Best regards, Benas On Thu, Jun 4, 2020, 11:03 AM Peter Bowyer wrote: > Hi Theodore, > > On Thu, 4 Jun 2020 at 00:55, Theodore Brown > wrote: > > >

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Peter Bowyer
Hi Theodore, On Thu, 4 Jun 2020 at 00:55, Theodore Brown wrote: > https://wiki.php.net/rfc/shorter_attribute_syntax Thanks for creating this RFC and for including "Comparison to other languages" in it. A provisional +1 from me. Does the PHP parser prevent us from adopting #[attr]? I presume

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-03 Thread Benas IML
Hello, thank you for the RFC but I hope it doesn't pass. Here's my constructive feedback as to why. Verbosity? Are we really debating whether adding 2 extra characters is more "verbose"? Well, with 3 or more grouped attributes, we are less verbose by 1 character. I don't find "verbosity" to be

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-03 Thread Benjamin Eberlei
On Thu, Jun 4, 2020 at 1:55 AM Theodore Brown wrote: > Hi internals, > > I discussed the syntax for attributes further with Benjamin, Martin, > and several other internals developers off-list, and with their > feedback completed an RFC proposing to use the shorter `@@` syntax > instead of `<<>>`

[PHP-DEV] [RFC] Shorter attribute syntax

2020-06-03 Thread Theodore Brown
Hi internals, I discussed the syntax for attributes further with Benjamin, Martin, and several other internals developers off-list, and with their feedback completed an RFC proposing to use the shorter `@@` syntax instead of `<<>>` for attributes in PHP 8.

<    1   2