Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62820 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48539 invoked from network); 4 Sep 2012 22:00:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2012 22:00:21 -0000 Authentication-Results: pb1.pair.com header.from=adamjonr@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adamjonr@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.170 as permitted sender) X-PHP-List-Original-Sender: adamjonr@gmail.com X-Host-Fingerprint: 209.85.223.170 mail-ie0-f170.google.com Received: from [209.85.223.170] ([209.85.223.170:43191] helo=mail-ie0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/57-12568-3F976405 for ; Tue, 04 Sep 2012 18:00:20 -0400 Received: by ied7 with SMTP id 7so6842700ied.29 for ; Tue, 04 Sep 2012 15:00:17 -0700 (PDT) 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 :content-type; bh=YsFTIzLF3pf1BsjWc1OnwjZq4utAB7ierRc/aXHww/k=; b=Fo3ln5iOoybSsw71tR4QpzsvlhEPRqokMWMhkofM1Vu/2rYthtq6NphuFZH+EB6gx7 qYBOz5VVgsaOpo6j72cn1H9RdgH03T2gUPnIqATFogDD7gteQ3nANbrQdmlCW0itpb8E Gx9p9M6knSSrM2mcd44rFN+Wb/h9ic9rbC3LZ7wocmJK6atj7pDKLtcutGuwQQGFEQSV ijfD+gG/H0W60ldQQ/Dl1KrOyiVdj4EbEwbquuJCDipAPtLbcTEcA4aY2c42M+j5ti7T WizHnbxy9jEBRpiBOWv+1iRKtDBe1muwy7XNxa6uUuBdH7h2Mj+0kSnF0AtDX6fCmacM xgow== MIME-Version: 1.0 Received: by 10.182.152.97 with SMTP id ux1mr16654977obb.13.1346796016696; Tue, 04 Sep 2012 15:00:16 -0700 (PDT) Received: by 10.76.95.198 with HTTP; Tue, 4 Sep 2012 15:00:16 -0700 (PDT) In-Reply-To: References: Date: Tue, 4 Sep 2012 18:00:16 -0400 Message-ID: To: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Moving to an AST-based parsing/compilation process From: adamjonr@gmail.com (Adam Jon Richardson) On Tue, Sep 4, 2012 at 3:57 PM, Nikita Popov wrote: > Hey folks! > > Some people asked me what the advantages of using an AST-based > parsing/compilation process are, so I put together a few quick notes > in an RFC: > > https://wiki.php.net/rfc/ast_based_parsing_compilation_process > > It would be nice to get a few comments from other core devs on this. I''m not a core developer, but I do have some concerns about this type of approach: As noted in the RFC, most languages do use an Abstract Syntax Tree (AST), however, as is also noted in the RFC, PHP opcodes are regenerated by request, which makes PHP very unique amongst languages, so there is perhaps a reason to be different here. The disadvantages of the AST approach are noted as the potential for increased resource requirements. When viewed in the RFC, the brevity of the section and the visual weight of its contents perhaps understates just how much of a big deal this could be. PHP as a web technology is run on a myriad of servers and processes a huge amount of requests every second across the world. Adding even a couple cycles to every request is a very big deal in the scheme of things, especially when we live in an age where many other industries are making great efforts to reduce resources required for goods/services. There was some mention of caching to alleviate the potential issues, and this could bring the cost down, perhaps even saving cycles in the long run. Or, perhaps some brilliant work on the processing could yield significant resource savings compared to the single-pass approach. My point is that I'm all for improving the PHP internals so as to facilitate future work on the core. However, these considerations must be carefully weighed against the resource footprint PHP now has, and the hope of continuing to make reasonable strides to reduce that footprint. Asking a few core developers to use more resources to handle hacks, quirks, and decoupling technical issues CAN be the preferred alternative if there are real savings in server resources used worldwide. That's not to say this area of work should be avoided. Rather, I am saying that I hope any work in this area would give the potential for additional resource usage very serious consideration. Adam