Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49580 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17304 invoked from network); 8 Sep 2010 07:32:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2010 07:32:38 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:54684] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/70-13913-41C378C4 for ; Wed, 08 Sep 2010 03:32:37 -0400 Received: from il-gw1.zend.com (unknown [10.1.1.22]) by il-mr1.zend.com (Postfix) with ESMTP id 1225850473; Wed, 8 Sep 2010 10:30:51 +0300 (IDT) Received: from ws.home (10.1.10.4) by il-ex2.zend.net (10.1.1.22) with Microsoft SMTP Server id 14.0.689.0; Wed, 8 Sep 2010 10:32:24 +0300 Message-ID: <4C873C0F.1010200@zend.com> Date: Wed, 8 Sep 2010 11:32:31 +0400 User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Pierrick Charron CC: , Zeev Suraski , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: PHP Annotations RFC + Patch From: dmitry@zend.com (Dmitry Stogov) Hi Pierrick, I've taken just a quick look into concept and patch. It looks interesting and might be useful in some areas, but I see several significant problems: 1) Have you thought about compatibility with opcode caches? In case I understood properly, you store annotation as a HashTable of object. But life-time of objects is restricted by request time, so they won't persist in opcode cache and will have to be recreated on each request. It's a huge overhead. I don't have a good solution for this problem except for using arrays instead of objects. 2) I suppose that usage of annotation would be quite rare case. I don't think it make sense to extend each op_array, property and class with additional "annotations" field. I think it's possible to have a separate CG(annotaions_map) where the keys might be the addresses of corresponding classesm, methods and properties. 3) I think the annotaton syntax must follow PHP syntax as close as possible - allow leading \ in QualifiedName - use '=>' in arrays 4) I didn't understand why do we need nested annotations. The first and second problems are the most important. I don't like to lose performance of existing applications which don't use annotations at all. I think the concept must be redesigned a bit. Also I would like to see an APC patch to check if the implementation works and doesn't lose performance. Thanks. Dmitry. Pierrick Charron wrote: > Hi Dmitry, > > As discussed on IRC, here are the RFC and the patch to add Annotation > support in PHP : > > - RFC : http://wiki.php.net/rfc/annotations > - Patch : http://www.adoy.net/php/Annotations.diff > > All your feedback and suggestions will be more than welcome. > > Thanks again. > > Pierrick (or adoy on irc)