Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62542 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85797 invoked from network); 27 Aug 2012 00:22:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Aug 2012 00:22:01 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.220.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:46866] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/E0-13425-7ADBA305 for ; Sun, 26 Aug 2012 20:22:00 -0400 Received: by vcbgb30 with SMTP id gb30so4420002vcb.29 for ; Sun, 26 Aug 2012 17:21:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=uE4IQl9HhRqa8qqpfiy1bobaWrMMgW958HnF/vIA0LI=; b=GnET6UsBx9kMZ09mMK9CXfpEW5o+9Qt8DlBszYPRM6zniTHTKba50OQLHLSeZMC7/P zfuOPqcAoNiSLTaqLKM2Bf+jCdiNThx9unRbCD7Pbq6Py3i+SE/eYCLKDvBqrh1Ow1P8 xpumZr7grSzweiWNmg75WJTZanglx/ODp6BPeIRvXU/gZgi5ErWk4ci56TT8V+egM5Hs cWWQ8GGTfBCHt2x2CZOkmlKk2/ud1e8wvDR0NJGJBBWQYj1QMWIMvJI9EotSUhqZ8kc4 8Rjs0pXn8GxPibjIhly1aUYjsFwA9DZL/xiv4nw2wjbiIaYrmnvHyB/o11XnHSxPla9g eF7A== MIME-Version: 1.0 Received: by 10.220.218.144 with SMTP id hq16mr10016646vcb.61.1346026917008; Sun, 26 Aug 2012 17:21:57 -0700 (PDT) Received: by 10.58.84.164 with HTTP; Sun, 26 Aug 2012 17:21:56 -0700 (PDT) In-Reply-To: References: Date: Sun, 26 Aug 2012 20:21:56 -0400 Message-ID: To: Peter Nguyen Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=14dae9d24d3c3f15f204c83450dd X-Gm-Message-State: ALoCoQmNBy7R2pOOKFD2bI1liUWrAEMbR/dDNbJGQ93GBPgRUsk94I8MRG70Fi1++hOvJsgv4Yfn Subject: Re: [PHP-DEV] Aspect Oriented Programming in PHP From: rasmus@mindplay.dk (Rasmus Schultz) --14dae9d24d3c3f15f204c83450dd Content-Type: text/plain; charset=ISO-8859-1 But AOP is just one of many popular techniques that require code generation. And for that matter, there is an endless number of different approaches and features found in different AOP solutions for various languages - it's not a "one size fits all" idea, many people are going to have preferences about the details, and hence not a good candidate for a language feature, in my opinion. I would much prefer to see the language enhanced on a lower level - to enable solid, reliable, efficient implementations of code generation in userland, paving the way for good AOP frameworks, as well as many other techniques and ideas, now and in the future. Thanks to bytecode caching, and various other advances in efficiency in the past few years, PHP in general is (or could be) a brilliant language for code-generation tasks. For instance, check out this elegant parser library: http://qntm.org/loco For something like an aspect-oriented language extension and pre-processor, you could get a head start on parsing enhanced PHP syntax really quickly. Also, consider how much simpler it would be to implement things like template engines... On Sun, Aug 26, 2012 at 2:34 PM, Peter Nguyen wrote: > That's why I thnk the extension is superior to all other solutions, > because it doesn't require code generation in userland. Also, it will be > possible to backtrace to the declaration of the aspects. > > > 2012/8/26 Rasmus Schultz > >> > >> > On Thu, Aug 23, 2012 at 7:36 AM, Peter Nguyen wrote: >> > I know very little about AOP and don't pretend to know a lot, but how >> > would we benefit >> > from directly adding it into core instead of taking the approach FLOW3 >> did? >> >> >> as I see it, the problem with AOP in PHP is the same as with any other >> technique that requires code-generation, in some form or another, >> including code-manipulation, pre-processing, transpilers, and so >> forth: traceability of errors. >> >> languages that are popular as intermediary languages generally support a >> directive that makes it possible to trace errors back to their source. >> >> I raised this issue on the list recently, and no one seemed to react with >> any interest... >> > > --14dae9d24d3c3f15f204c83450dd--