Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30861 invoked from network); 25 Apr 2016 12:26:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2016 12:26:49 -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.119 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 157.56.111.119 mail-bn1bon0119.outbound.protection.outlook.com Received: from [157.56.111.119] ([157.56.111.119:44384] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/B5-00233-70D0E175 for ; Mon, 25 Apr 2016 08:26:48 -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=zE9nma7Kp67rAI7DQQfHC29MTAmT347ANpzHfJI1b+o=; b=d6WvcdaB8nKYd1zSVJ9/M61l5S7ozpptXHxEM1N8ikQCtLAAb6z3itIbqUZT9koF+6SzzV+aQBpc+JpSgYQ8SgNn4gWrQKZnwWIA56O2nhRKghnms/cNp1ObRWapTPv0tBCVfxCWriFIujp1zOWZ60L1b32shWfP0hybNice5Ys= Authentication-Results: php.net; dkim=none (message not signed) header.d=none;php.net; dmarc=none action=none header.from=zend.com; Received: from tpl2.home (92.62.57.172) by BLUPR0201MB1780.namprd02.prod.outlook.com (10.162.239.14) with Microsoft SMTP Server (TLS) id 15.1.477.8; Mon, 25 Apr 2016 12:26:40 +0000 To: Joe Watkins References: <571BA0F0.2030400@fleshgrinder.com> <571C82A7.2060706@fleshgrinder.com> <571CB44C.1000704@fleshgrinder.com> <571CBD1E.7020103@fleshgrinder.com> <571DD2A3.2020106@zend.com> <571DEC9E.80407@zend.com> CC: Pierre Joye , PHP internals , Benjamin Eberlei , Sara Golemon Message-ID: <571E0CF2.4040506@zend.com> Date: Mon, 25 Apr 2016 15:26:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------030007070608040401090306" X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: HE1PR02CA0057.eurprd02.prod.outlook.com (10.163.170.25) To BLUPR0201MB1780.namprd02.prod.outlook.com (10.162.239.14) X-MS-Office365-Filtering-Correlation-Id: 6b030d6b-8c31-4644-96d4-08d36d04dc02 X-Microsoft-Exchange-Diagnostics: 1;BLUPR0201MB1780;2:11X1DQwToFWn+IqLOuS48wkEzYP1MaOoMyFPDVHl5P+KAionfDKMjxhQB9JDC+O0mRe5MgHWHjtS677QPF7afB2n1BYS4BzTiPRc94BkEQpxmUPs7OrJAyyQC5UTXEJsuq9tc8uIMdaThBH4HeqJw42ozXBPMQeiRwSz8vOM3Qc+ABE+C7janOZzaq2zLAm8;3:84tzCtkg/xeZT5rfbXkRi07mVRyzLz9wZOZFi9Sf0P7lZnzijaQ1nACV+/0lQ2mZbgdo7KjGzcPTWj1m0g6HDjwWbQmReeQDCVK+jP6oLFQRRI36QR2iUIy2GIOwShua;25:IcY0PtF1YDeKo0+XT6ZjgX1CkciDuMY2IikLpQLVzEy56g6MdgM9yqU0ir8nB3WROgxteW3/Mbe29knSk5SiSSkViWal1kE8nKNBOxZGdeLVrVCGXFOJLwU59tYOvp7Idy1iqUcwCxAToLXU4dY6AfwrREF25NCc9PaPAwS1zg9rTn52VLZkYBwZBcYhvt4QJMVSC5cqBuLf/2HKN72vmfUHY8wo/kXEPcjLPCr/HbZeZSdyw8u/39tUX0ZwJJAoXjTGMWcMB06JL+bPeLZ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DpZBxt7EHw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:BLUPR0201MB1780;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0201MB1780; X-Forefront-PRVS: 0923977CCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(24454002)(377454003)(65816999)(54356999)(50986999)(87266999)(76176999)(93886004)(16236675004)(81166005)(5004730100002)(15395725005)(270700001)(1720100001)(86362001)(64126003)(15188155005)(19273905006)(110136002)(66066001)(33656002)(16799955002)(19617315012)(2906002)(65956001)(6116002)(15975445007)(59896002)(189998001)(3846002)(42186005)(586003)(19580395003)(19580405001)(36756003)(4001350100001)(84326002)(1096002)(92566002)(512874002)(77096005)(4326007)(563064011);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0201MB1780;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0201MB1780;23:NJ/gmPZdlxenkyXSShs4FgWbbc3rVmBHt1JOUWJ?= =?us-ascii?Q?FSFHyQv1zlVcF8fsYUEazYYrFCPk1DZE1RcNB9vxrqgrrQSsGi8X7lIyjosm?= =?us-ascii?Q?lvA4o4zN4QHXKBLPttGxXU9UMEA+jpIGJeqpZOTqH8ojUpAKfWhQ2BPQvz4z?= =?us-ascii?Q?VQyq3glUHGOAQfQ6NxtvFU3tLePuEjsDm75G2nRq2fkZnUQIbNd+xyqrfBnd?= =?us-ascii?Q?wRX3KfdtKjak/BQZprde6i9McfX3wRk0jmfhF7mT575EkmblLhl6/8FaJis0?= =?us-ascii?Q?8x60Brezp3bSdaK20NbzF04u8sA9JAJRi97sVU/8wIOtv0+kxee6SBCoeSHG?= =?us-ascii?Q?BrEjmv8dCVyRKJZrLT9culpye//7GjOz7nd2aR4qHbG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kfjM1NaDB1RfqoW/7Ggjwdyqiv7WHXM4dzTX30pOKPhzuGUkOlGcQM4f5VdUbr0va/GgsgIwqQQjulYUFdPrJfNIor2GgQo8zpMAwbMHg+B5Wu9YYj5IWgiakg==;24:eh4B/k8Zb2Urs8xgW8WFJUMRAlKzfC6c68VfFLssLXHTnvevon4HJH9QQjsww6XlAOF2z3+XbE3NFIiM84sFiMPaKLawpv0YmVGAxFx0nxo=;7:s29zeHVPIGQcgixv4VkJnTp3RfiPdvzau9HYfsGsC+Ebe3J6aYAAwLZD/RH6Jby4t5wfM+xrju3mV6/jqE0dmW5Rm0DVweInIAo+0drZPWBMHzT/tTFGNvui1cylmlsHh2tJRiWSFzIwfUdeUMnHw5nYE0uSCpizXsPodso20D10044rAk2btZ4oafYUxsfx SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2016 12:26:40.7668 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0201MB1780 Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: dmitry@zend.com (Dmitry Stogov) --------------030007070608040401090306 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit On 04/25/2016 02:28 PM, Joe Watkins wrote: > Morning internals, > > This morning I attempted to prototype a dbc extension. > > In my opinion, the patch, or internals, are not fit for the > intended purpose. > > At the moment, the *only* way to perform meta programming is going > to be in userland. This is going to make it prohibitively slow, and > rather pointless. why? It's quite easy to use attributes in C extension. if (op_array->attributes) { zval *val = zend_hash_find_str(op_array->attributes, "requires", sizeof("requires")-1_; if (val && Z_TYPE_P(val) == IS_ARRAY) { HashTable *ht = Z_ARRVAL_P(val); ZEND_HASH_FORECH_VAL(ht, val) { ... ZEND_HASH_FOREACH_END(); } } > > None of the compiler API is exported: This means that AST is > almost useless to internals unless it's a constant expression. Do you mean C or PHP API? What exactly do you like to be exported? zend_compile_expr()? It's not a problem to export it in 7.1. > > There is a problem with zend extensions and fcall handlers, which > we are not sure how to fix. This is completely unrelated historical problem :) > > Working with AST is easy, working with opcodes directly is not. > > Before we can have this, we must work on the AST API and allow > extensions to transform AST with much better hooks than we have at the > moment. This is related to user extendable parser, that is definitely not a subject of this RFC. > > I was excited to start working with this .. at the moment, I'm -1. I got you. Attributes are not especially for DbC and user extendable parser, and they are not a magic wand. They may be an underlying layer for many things (including DbC). But to reach what you want, you'll have to start from something anyway. Thanks. Dmitry. > > Cheers > Joe > > PS. If anyone is interested http://github.com/krakjoe/dbc was my first > attempt at interacting with the patch. > > > > > On Mon, Apr 25, 2016 at 11:08 AM, Dmitry Stogov > wrote: > > > > On 04/25/2016 12:44 PM, Pierre Joye wrote: > > hi Dmitry, > > Awesome work! Thanks. > > I do like you keep what was discussed last time. Make the basics > available and leave the rest to the applications (doctrine or > other). > > I feel too that how the apps will interact with may need some more > discussions but other commented on it so I won't interfer here :). > > I've collected the most interesting feedback at > https://wiki.php.net/rfc/attributes#open_issues > And I'm going to correct RFC and implementation rethinking these > questions. > > Thanks. Dmitry. > > > > On Mon, Apr 25, 2016 at 3:17 PM, Dmitry Stogov > > wrote: > > The proposed by you "@..." syntax just won't fit into PHP > grammar, because @ > used as silence operator. > > Attribute, syntax is taken from HHVM. I don't see a big > reason to introduce > more fragmentation into PHP world. > > Also see https://docs.hhvm.com/hack/attributes/syntax and I fully > agree with Dmitry here. It makes no sense now to go with our own > syntax. > > If any of the hhvm developers are around, we may get some > feedbacks > about their current APIs (using getAttributes) and if they > would like > to change one thing or another. That could (or must) part of > the PHP > specifications. > > Cheers, > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --------------030007070608040401090306--