Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62847 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86907 invoked from network); 6 Sep 2012 07:52:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2012 07:52:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:36346] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/74-01139-C4658405 for ; Thu, 06 Sep 2012 03:52:44 -0400 Received: from Hwhost2.local (162-95.79-83.cust.bluewin.ch [83.79.95.162]) by host1.trois-doubles.net (Postfix) with ESMTPA id 39DD8209594 for ; Thu, 6 Sep 2012 09:52:41 +0200 (CEST) Message-ID: <50485647.1060102@hoa-project.net> Date: Thu, 06 Sep 2012 09:52:39 +0200 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/17.0 Thunderbird/17.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <504836A3.20904@zend.com> In-Reply-To: <504836A3.20904@zend.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Moving to an AST-based parsing/compilation process From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") Hi Dmitry, On 06/09/12 07:37, Dmitry Stogov wrote: > Hi Nikita, > > Personally, I don't see any reason to build AST. As you mentioned=20 > yourself, it will be slower and will require more memory. On the other = > hand AST itself would allow to perform only very basic optimizations.=20 > Most of them can be easily done on VM opcode level as well. The lexing and parsing processes will not be slower than actual, and the = construction of an AST is a new process. Well, as usual, new process=20 requires new resources. But if we look further, it will certainly be a=20 nice tool to perform better opcode caching, it will remove a lot of=20 hacks, it will allow third-part tools working on safeness, security,=20 quality etc. to go deeper at low-costs which is very important for PHP=20 community, it will facilitate future works (implementations, features=20 etc.) for PHP=85 Moreover, it may be possible that compiler compilers hav= e=20 a better lexing and parsing processes than actual? Someone said that AST is more =93academical=94, yes it is and that is why= we=20 can benefit from already done researches in this area to avoid memory=20 overhead (one among others). We are not the first ones facing this=20 problem. It requires some researches before starting to develop this.=20 Let's try as a POC and we will quickly see if this is a wrong way or not.= Cheers. > > Also, as it's not an easy task, the old "ugly hacks" will be replaced=20 > with new mistakes, which would require new "hacks" in the future :) > > The only real advantage could be an ability to expose AST to PHP=20 > scripts, but only few people may need it. > > Thanks. Dmitry. > > On 09/04/2012 11: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. >> >> Nikita >> > > --=20 Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/