Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64902 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82119 invoked from network); 12 Jan 2013 18:00:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2013 18:00:26 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.180 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.217.180 mail-lb0-f180.google.com Received: from [209.85.217.180] ([209.85.217.180:54434] helo=mail-lb0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/5B-24230-9B4A1F05 for ; Sat, 12 Jan 2013 13:00:26 -0500 Received: by mail-lb0-f180.google.com with SMTP id gj3so2047502lbb.11 for ; Sat, 12 Jan 2013 10:00:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YSZLS71E3yvA69jze/ygH7tdGrNYANxU6fhwiLsrbu8=; b=JkvO97fHxxvJMzTgB79QhH3LWGfROkaZU0FxaBp7Ct0/XwflSLD1e2QQ3ohjCJTrrf T+pkiEL58LgnX9J6m5WSRWLLO6i+bxr/mhKvv5CUCppnsCCcG/M6at8z7sCcHa7wzqq8 Fv8ZDWY6e0oDpBB0yP3h4kyTpWMh4iqM4K4BpTpwhdekvJClUzoi44Q5tQWQEOFGVYsL AXLWhcw+Ys65zBpO8dmY8vQlt5A/oen6HD/b0l9kyj83m2XD5pc77ZNNGb1daBwV2nvf 0m8bm5jgyy2KVOfW4FmQukMfGm0/WWS41jTdgA39y6RzA8lt6quYS8ajnkUCzkPP7SzG TIDQ== MIME-Version: 1.0 Received: by 10.112.10.200 with SMTP id k8mr25462141lbb.73.1358013622972; Sat, 12 Jan 2013 10:00:22 -0800 (PST) Received: by 10.112.4.168 with HTTP; Sat, 12 Jan 2013 10:00:22 -0800 (PST) In-Reply-To: References: Date: Sat, 12 Jan 2013 19:00:22 +0100 Message-ID: To: Rasmus Schultz Cc: PHP internals Content-Type: multipart/alternative; boundary=bcaec54ee29098f00804d31b2ffc Subject: Re: [PHP-DEV] annotations, vision, goals From: nikita.ppv@gmail.com (Nikita Popov) --bcaec54ee29098f00804d31b2ffc Content-Type: text/plain; charset=ISO-8859-1 On Sat, Jan 12, 2013 at 5:29 PM, Rasmus Schultz wrote: > I hear a lot of interesting arguments in this big annotation discussion, > and now there's the ongoing vision discussion, which got me thinking. > > It is true that there is broad community interest in annotations - part of > the problem here, is that different groups have differing opinions about > precisely what annotations are, how and when they should be used, the > syntax, and a bunch of other things. > > To name a similar example, there is also broad community interest in e-mail > clients - and countless userland implementations. Nobody is pushing for a > standard e-mail client in PHP. Granted, e-mail is a run-time library > feature, not a language feature, but I don't think it's an unfair > comparison, since annotations aren't really so much a language feature > either, if you think about it - much of the discussions revolve around API > issues, and like someone pointed out, you could do metadata in other ways, > without altering the language or parsing docblocks. > > I'm not making this point to argue against annotations, but it lead me back > to another idea that has surfaced in discussions before: a source-directive > feature. > > This sounds like a much smaller feature, which would be much simpler to > define and agree on, and much simpler to implement. > > A source-directive would empower the community to define and implement the > syntax, and not only for annotations, but for other features, such as > aspect-oriented programming, which I believe was once proposed as an RFC > (?) and declined, probably for the same reason... it's a feature with too > many variations and opinions, lots of complexity, and it's probably another > one of those language-features where the discussions end up revolving > around run-time issues more so than language/syntax. > > It would be nice if every developer in the world could all agree on > everything. But we can't, we don't, and we're not going to - and that's not > a bad thing, because it means PHP is open for innovators to find better > ways to do certain things in userland :-) > > The big advantage to having something like implemented and maintained in > userland, is that these features can thrive and grow if they turn out to be > successful - or, if everyone decides in a year or two that annotations > suck, they can stop using them and move on to something else. It also means > that developers don't need to wait for a year or more for their sysadmin to > deploy the next minor PHP update that fixes a bug or makes a minor addition > to that feature. > > Perhaps it's time to think about "lower level" language features that > facilitate implementing "borderline" language-features, and enable the > community to write better, more reliable implementations of things like > annotations and AOP, rather than writing it for them? > > And perhaps a source-directive isn't the solution in this case, or perhaps > it's only part of the solution - but what I'm saying is, maybe instead of > lumping on more features that do one thing, perhaps it's time to turn > things around, view things in a different light, and try to think about > things on a somewhat more "meta" level? What's are the smallest "building > block" language features that would enable the community to build bigger > features such as annotations in a better way? > > I love annotations. But I love my implementation of annotations, I probably > won't like yours, and that's not necessarily something we should need to > agree upon. > > Is it really the responsibility of the language to deliver high-level > features that support patterns? > > Or should it deliver simpler features that support the implementation of > those patterns? > Hey Rasmus! I'm not sure I entirely understood this mail (mainly because I don't quite get what you mean by "source directive" and Google couldn't tell me either). Do you mean introducing something like macros to PHP? Or something like expression trees? I.e. means to add language features from userland? If so, this suggestion should be a bit more concrete, because there are so many different ways to do this at varying degrees. Talking about it in abstract doesn't lead us anywhere here. If you are talking about language extensibility to a degree where one could implement annotations (as "real" syntax) in userland, then I don't think this is realistic. There are only very few languages that allow these kinds of deep manipulations (and those languages happen to not be used much ^^). Nikita --bcaec54ee29098f00804d31b2ffc--