Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97868 invoked from network); 5 May 2016 07:07:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2016 07:07:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 157.56.111.101 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 157.56.111.101 mail-bn1bbn0101.outbound.protection.outlook.com Received: from [157.56.111.101] ([157.56.111.101:26400] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/B8-16256-131FA275 for ; Thu, 05 May 2016 03:07:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AzVWcKIN1mofEkfxj3npz7knwgAocUh+YIJDKRySIH4=; b=cWzsaLvA4FMa8ua8x9azk8RbehhYFd6iEZab8+44FtMHDxzWlcr1HmLlQHltgIw33RsvQbwOnB1Om6FSGDIAw+5rPUVRfrL4wcDAtVTKLHXJ5hK3ztmXUagT7l44LOUNg6SnnO6+Yoo2cfN3Hk2XlKLXmsjFpLHMSSsgZcgmjV4= Authentication-Results: lists.php.net; dkim=none (message not signed) header.d=none;lists.php.net; dmarc=none action=none header.from=zend.com; Received: from tpl2.home (92.62.57.172) by SN1PR0201MB1790.namprd02.prod.outlook.com (10.162.228.20) with Microsoft SMTP Server (TLS) id 15.1.485.9; Thu, 5 May 2016 07:07:24 +0000 To: Stanislav Malyshev , Larry Garfield , 'PHP internals' References: <5723F2AE.2020806@garfieldtech.com> <8a7d1e8a-1e9e-0bbd-912a-21201638b989@gmail.com> Message-ID: Date: Thu, 5 May 2016 10:07:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <8a7d1e8a-1e9e-0bbd-912a-21201638b989@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: DB4PR07CA004.eurprd07.prod.outlook.com (10.242.229.14) To SN1PR0201MB1790.namprd02.prod.outlook.com (10.162.228.20) X-MS-Office365-Filtering-Correlation-Id: 99aacc54-8249-47c0-571d-08d374b3e9e4 X-Microsoft-Exchange-Diagnostics: 1;SN1PR0201MB1790;2:aPtBT/GKKDZTn5a7k4zrE6Gl/tpcvFN+E6bUzbYsX0IEpB5kgq8Q+eYRgVFc1cte+uWTkHrIve/73dC/uQddnpNYTB9CSxKLtI9bUpWbsex+unK53OOJgDHc4C3EHGaWJIWUYsTTlxVAc/I5Kv93se8Tu1owLGlxxjeWeefK3s+96utzHHk6PYAGUkvQuNXv;3:pXN07GHGduX3K5gMjlHGrzJm3VsbL3PEz8+wjsFcvVRzF+/fOxkCEQiRmOfI1PIVHFnN277UvrHgdzomPQ/NyAJ7MOMkPEfRrAvIf9ibUY1nfFbC0u3yI3P8n6pLYiqY;25:bKPPXu0YTQvM7ffidwCVInh8X0I3ltYzY/782OUW+iA2uneBZADNfZoUDDJxcGEY4XNlcMlzR6wDoxCnHRK9horRz0gg6hubxKjN1msBBJ7VEvOle6miyEyDK/bTirxQJV+54Fe9l9d7B5rQXqPBzmOBAo0ysD99SswnRpqvCebWNIOTDHoU4U7Zm1nzfb366nKWC4bMSuh1glRPw4n6LsqomJEUliBbXnjab+pWTfp8z+y0kmj1ZW/NF8of+YCQhhQG2FCBgjaXf6XqV4KmzNk0hV9NzJ8xoPBsB14x0EBLdRsR4vYCFZQQO0MO7FA/UeeY/Cv47ZLmscTvPQFP0RaanNMHP3AtG6G1WvWYBOH26iBhheONdZTwj3eBRyTrkT1Cg2nuRgtB2TWyA3CheHsLKtkLCw0rMBGDs2PIMNsUNXdUShu9iQYX65/WEpWa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0201MB1790; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0201MB1790;20:f3F+yz9pucWYOr1IgB7tNHMZ9XMNg75Pztpv4JicPBOR5jBHbHUMMA9HUn+O4efZh9J/BVLPWr0MH07LcLGthfUH0YD78S7p+g9vPQrv7gMIfU1sVI0qvcHWLFZYGq0Ra4DnRTEt4dpa9mv3456Q66pqiIHtaZErTicuXfsEdwDu4+oi8VhcsGfUA1ulLMEv8UHLkunMVoDwPM/0FitwoNozzDydOzxJzw7156jweDMhn2lNO+8210ndO+BTRd2fhFVA6Hpa1yusvcLa0ryPMgp+yaX9QzYrLDbNCAicCb2915PjSR7z8A6Gs33T8hHCDgB8r2hLwagTwSewkoXUlp2lO/8gD/biIzR7h/4ofS9c9yToZdAJHYuHkpR6yGvmbv8e50G4kxgxG+DzjxdrrGpVdfg3LKjKuADSz+B35wjzYxWaVH3I1VnbMHcyYUwZALIBAgE4bLknhRIikh4VY5YMNp48i8wUukJAqcVvtcfpnGFnJadigze5zpH+43a0;4:PG/GaR1Kkzpvp05BtrcskhcZwHRCwZNFl1kANlajqaWgJITQtDhUQND0gMLTBy7rWQhUEvmdQswau2z8fNkWThz7QusqhjoUmKpUvHaLNWa6azB5p6tqQ+Y89Tg2xnb1iwbyhvj0Bpak4LPixkXyTo+fScFjlLWuVCcx8bK07MMTECbCaRR/ytM2fuhDT41fymJIVXa98bcLiMZ4u3krZ541q3Ry69f9Tjrc9JCpJqj5MtWwAcEmd2ki8xdWlIPERRTJIrsOAbt479BHg2GGZcIchWyls8+5LAFnEsw5P89+BPwKc/mSPLwAhm49NNjeTob3K9faxstng0+bA+Y+qZxl/9L7d2MEE78/61KuBzYxVNouwMItegjXaVaroqUTrkVdYHGrRSf0HzliOTfu+A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521098)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:SN1PR0201MB1790;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0201MB1790; X-Forefront-PRVS: 0933E9FD8D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(377454003)(24454002)(230700001)(5008740100001)(5004730100002)(36756003)(2950100001)(77096005)(81166005)(54356999)(189998001)(47776003)(66066001)(65956001)(50466002)(64126003)(65806001)(5001770100001)(50986999)(107886002)(76176999)(86362001)(31696002)(4001350100001)(42186005)(92566002)(6116002)(3846002)(586003)(2906002)(23676002)(31686004)(83506001)(33646002)(65826006);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0201MB1790;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjAyMDFNQjE3OTA7MjM6SHRxZEgzcGJFZUY2Y1pSZmQyMTU1RWhV?= =?utf-8?B?M1ByUjk3anVYS0RXSlFrZFdnOFZ4L1gvSVc3d3pUZVZyZTk0YStFZys4VzVO?= =?utf-8?B?MEsrY0N1MHB5enBtQkNnamxrd0dXdVp5RCtpQm51OW93R0hYbVBkV3RyY1RF?= =?utf-8?B?dWU1ejNCWEtzUm9zVGg1MVNaaHFLZGFuYzBkYWk5b0g4M1dTZ3FVRExXUDZj?= =?utf-8?B?anZmdFBSV1JwQ2RPa3NsNGtwaHNBLzV3MlRGaHFzYU1WWUkyRUFaTEprTExI?= =?utf-8?B?UjBxNjNFcWw0MWo1dk84RGtOUSsxOXQ4MDFrNm9BUVlKRHBRZElrVkpFWUNQ?= =?utf-8?B?WXdoaHE1NTEwZFprU2Q4YlNCMnhES3ZycnpIWGtNK1o0ZnY5c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syT3hNcFRBMDdodS9sQTE1ZG1uL1I5?= =?utf-8?B?SlZhbDJzZ210UnZRL09mSWRubGtMTVNIRzlXdzJrc28xblFhTEJuZ2k4K0RE?= =?utf-8?Q?zUia/PkmrG?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR0201MB1790;5:sXiCnO9A4Jzd0jJWL++X5tnv6ERylYs98akkyD9N5NlbgS7Gvhi9dmG+b+RWZQ6jjj8eDjfOQzAxpChyEEnYYffxsTIhK4v4tPygtqpEuRu2o4v/QVO/RrqcfGB3yAj4MYhR9Arf+2mS4ayQJWHSWA==;24:AB7R5RHPxNELCEnJ742T6ytg6m9KjbnQKDJj/QkAUfOWv6Ei+k26IKpydDrxxesM7hQYhNdOi6cIp+GzHwojTrRKVhpaocRkplzIYtJPpGo=;7:AMijBFrigZSxUGNTTinNF9BItHXlvET5LmxXC4GAd2R7Hj/4JGLIpPMyH+gYtYWu0nijjhzlsJXHyQp4Y/DLAwjqtyoczNJj9j1gMCye64hNZ8PJeMEtMlwlaChIfWxA8XhoCzfOVGHaHvAlOA2r2zJVz9Uqmu7xZPFpWt0Ddm5ccyJcFvGR1JFnrBXY0x10 SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2016 07:07:24.7332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0201MB1790 Subject: Re: [PHP-DEV] Attributes/Annotations Case Study: Drupal From: dmitry@zend.com (Dmitry Stogov) On 05/05/2016 09:48 AM, Stanislav Malyshev wrote: > Hi! > >> It's also possible to write: >> >> <> "id" = "system_branding_block", >> "admin_label" = @Translation("Site branding") >> ]))>> >> >> >> you don't need to split your annotation into many attributes. You should >> just adopt its syntax to become a valid PHP expression. >> This expression is not going to be evaluated. It's going to be just >> parsed into AST. and then you may traverse this AST and transform it >> into other data structures. >> The key idea of RFC was not to invite another language for meta-data, >> but use PHP language itself. > This is a good way to avoid handling a lot of issue, but what I am > afraid of is that with this solution, what would happen that people > start doing exactly that - inventing another languages for metadata. In > fact, that's exactly what the expression above does - it uses "=" as > named argument, ops, "=" actually should be replaced with "=>", or this won't work. > and uses @ as special tag, not like PHP does. So it's in > fact mini-language using PHP's AST parser to tokenize its grammar, but > having separate semantics. right. RFC doesn't propose any semantic, but higher layer may define completely different semantic. > > Maybe that's what we want to have here - freedom for everybody to invent > their own languages - but I fear the danger of fragmentation here and > also people implementing tons of slightly different incompatible parsers > for ASTs that are generated. We'd have Drupal attributes and Symphony > attributes and Doctrine attributes and Zend attributes and so on, and > each of them would have different semantics. Not sure this would be > good. But maybe it avoids arguing about the syntax now. Today, we have the same with doc-comments. Attributes eliminate the need for separate parser and perform syntax validation at compile time. They also provide flexible syntax to support all existing annotation systems, but they can't solve semantic problems, because they are just meta-data. Thanks. Dmitry. > >> we don't have fully constructed classes at compile time. Classes may be >> used during transformation from plain arrays and AST into application >> specific data structures. > We don't have classes but we do namespace resolution right? For > namespace resolution, you don't need to have the class actually present. > I don't think we need it for ::class either. >