Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89393 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38009 invoked from network); 24 Nov 2015 19:06:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2015 19:06:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:38885] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/CC-57156-D15B4565 for ; Tue, 24 Nov 2015 14:06:06 -0500 Received: by wmec201 with SMTP id c201so40329432wme.1 for ; Tue, 24 Nov 2015 11:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=nG0tObPtGZUJLhNMfzx/7Zfw76mHOLZhd7OZM3lJUlg=; b=iPgDvbQN5iBJRHsxg78jQDptg1u8qe80+ppSoPyTs/CKla/h77YbtNSIsgNlEW0hdb VjO5Ktb7SA1cy327V4shg72VKLGCZn38ZcJ0c5yy3R4GrGsYYVy9GMjb9zZ4+7WKr641 xUiaMbOO3h6vHTxnK86Da7kWNfLbMUoTEb7QP/X+A2Qnnxf/BN41ShPSIC51BwL1nOrD ALZt8cQqF/f8ocUwVyMbYvpYqPGv8Gx83RvC5b1WRgouRAcNE+8dACJQzGwBYzyhWCvI 7rTXvv/VtTos7VKx31QmpRbjcbFjQ9GQZY7HNtnkFXfvykGYWO+5hM6jS9WJlwFGlXEZ NI0Q== X-Received: by 10.28.30.14 with SMTP id e14mr20668796wme.83.1448391962633; Tue, 24 Nov 2015 11:06:02 -0800 (PST) Received: from [192.168.1.189] ([95.148.161.224]) by smtp.googlemail.com with ESMTPSA id d2sm19618363wjy.16.2015.11.24.11.06.01 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Nov 2015 11:06:01 -0800 (PST) To: internals@lists.php.net References: Message-ID: <5654B516.4020700@gmail.com> Date: Tue, 24 Nov 2015 19:05:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Native Annotation Syntax From: rowan.collins@gmail.com (Rowan Collins) On 24/11/2015 16:30, Pedro Cordeiro wrote: > I'd been reading some old RFCs recently, and I found two RFCs on the > subject of annotations, both by Guilherme Blanco. The first one, which > proposed a native syntax for annotations, is marked as 'declined', and I > couldn't find a discussion for it anywhere. The second one, which proposes > retrieving annotation from DocBlocks through reflection is 'inactive', with > no further explanation. > > I'd really like to see native annotation support for PHP that doesn't live > in comments. > > Is there a reason those RFCs were dropped, or was it just lack of interest? I think one of the stumbling blocks in recent discussions of annotation support is just how much support should be provided; off the top of my head, this could be: - a few extra functions in reflection classes to parse the items within a docblock (docblocks are already handled in reflection separately from normal comments) - automatic instantiation of a set of standard Annotation objects with the text content above - automatic instantiation of classes based on the annotations provided - built-in support for applying annotations to the objects they appear on, perhaps in the form of full Aspect-Oriented Programming support At first sight, these seem like details which could be tweaked later, but they make a difference to what syntax to standardise: is the annotation name just a string, or a valid class name? is the value of the annotation just a string, or a parseable PHP expression? is it more useful to use the de facto existing syntax in DocBlocks, or to add a new keyword or operator? etc The devil, as ever, is in the detail. Regards, -- Rowan Collins [IMSoP]