Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50249 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3665 invoked from network); 16 Nov 2010 13:50:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2010 13:50:52 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:51253] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/B4-64124-B2C82EC4 for ; Tue, 16 Nov 2010 08:50:43 -0500 Received: by fxm13 with SMTP id 13so463410fxm.29 for ; Tue, 16 Nov 2010 05:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=MU6YH7xNqYrYVaTZs0iusXzNIT+UmieCZ+v9NgFBrBA=; b=QRPEKZv2u7CHKKT6XhChk9hYV8Fio7B5ZTBBETxBXwrdHptEHWKeUCWNj+0s4p7lEF 50F0qbux27FXMSpRE4Ep3DrbEfk5FHz7fN6Sbqon24DliJfWsr9Zr2uYJh0gncRkBmxB fuYGhfxmljUPmAGer7cgN4ftov0Fr9l8yh3qo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CTCngB9KCI8ZeyFMdcRbxeUGAubZOe0HiPUcFayXxJLhcgvdDuQX8nCWfABXqzx6NR oxRJKByIYTDUR4FOxyCxUl8AUVcl3vKQk46RKG/SiR1EESH99ALAwWGMU6kOwjSpw9pv 5G/V1wjyeYsGTreY5pWeF0qir7hwC3ekTOoUo= MIME-Version: 1.0 Received: by 10.223.100.9 with SMTP id w9mr6001973fan.12.1289915425094; Tue, 16 Nov 2010 05:50:25 -0800 (PST) Received: by 10.223.105.5 with HTTP; Tue, 16 Nov 2010 05:50:25 -0800 (PST) In-Reply-To: References: <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B588@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B6A0@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59D788@il-ex2.zend.net> Date: Tue, 16 Nov 2010 11:50:25 -0200 Message-ID: To: RQuadling@googlemail.com Cc: Zeev Suraski , Pierre Joye , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) support discussion From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") Hi Richard, The first proposed patch has some performance impact, due to the parsing time. And that's just it. Instantiation of annotation classes is irrelevant because it only happens when you explicitly request for it at runtime. The only drawback is that it cannot be cached in APC. Cheers, On Tue, Nov 16, 2010 at 10:32 AM, Richard Quadling wr= ote: > On 16 November 2010 07:06, Zeev Suraski wrote: >>> -----Original Message----- >>> From: Pierre Joye [mailto:pierre.php@gmail.com] >>> Sent: Tuesday, November 16, 2010 1:45 AM >>> To: Zeev Suraski >>> Cc: guilhermeblanco@gmail.com; PHP internals >>> Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) supp= ort >>> discussion >>> >>> On Tue, Nov 16, 2010 at 12:39 AM, Zeev Suraski wrote: >>> > Suggesting phpdoc is used for the purposes mentioned does not mean we >>> don't understand what we're talking about. >>> >>> I feel like you never used annotations in other languages, did you? >> >> You got me... =C2=A0But as an intelligent human being I'd like to think = I can evaluate the merits of a feature without having to actually use it. >> >> I'm not saying that annotations don't give you any value. =C2=A0Sure the= y do. =C2=A0I'm saying that they come at a great price of adding an obscure= branch of syntax into a language that's already grown significantly in com= plexity, and the bang for the buck isn't worth it. =C2=A0Those advanced dev= elopers needing that feature can make do with phpdoc. >> >> Zeev > > Hi all. > > I use PHPDoc. I develop SOAP services and use ZF to autocreate my WSDL > files. I've used tools to create classes from a WSDL file. I don't > know how this qualifies specifically as "annotations" - so I'm > probably in the same camp as Zeev on this. > > An issue for me is the lack of ongoing development (it seems) of > phpdoc. Yes, sure, it is for documentation. But that is just one sort > of annotation. [1] > > I think having a mechanism which is easily understood in both human > and machine terms and obeys a simple, expandable syntax, then this > would seem to be extremely useful. > > I like the idea of JSON encoded annotations. JSON is very simple to > understand (if you can manually create a nested associative array in > PHP, you can create JSON encoded data). > > I think for more complex annotations, a simple @tag doesn't seem like > it is going to be enough. There is no way to nest the tags in any > meaningful and validatable way. At least not in a way that is obvious > when you read it. Also, for every new @tag, you have to tell PHPDoc to > ignore it as it will produces noise. > > But consider now the amount of PHPDoc blocks out there. A PHPDoc -> > annotations converter would have to be developed. Theoretically, one > _SHOULD_ be able to do that using a PHPDoc template - I think - not an > area I know well. > > > One issue mentioned is that having annotations will have a > "performance hit" on PHP. > > I'm obviously missing something here. If the annotation is in a > blockcomment, then that would seem to satisfy the performance issue. > Reading the annotation for normal runtime execution would seem wrong. > Only as part of reflection or annotation specific access should the > block be "decoded" into whatever form is required. > > So, aren't annotations really just an extension to the docblock > decoding aspects of reflection? Do we have a "performance hit" because > of reflection? > > > I know I know very little about the impact on PHP, but a simple syntax > wrapped in a comment would really seem to be an ideal approach to me. > So much so, I'm almost surprised we need anything in the core at all. > > > > Regards, > > Richard. > > [1] http://en.wikipedia.org/wiki/Annotation#Software_programming > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > --=20 Guilherme Blanco Mobile: +55 (16) 9215-8480 MSN: guilhermeblanco@hotmail.com S=C3=A3o Paulo - SP/Brazil