Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62840 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57623 invoked from network); 5 Sep 2012 22:39:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2012 22:39:42 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.131 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.131 smtp131.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.131] ([67.192.241.131:37343] helo=smtp131.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/C1-45911-CA4D7405 for ; Wed, 05 Sep 2012 18:39:41 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp29.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id D4BE13981EC; Wed, 5 Sep 2012 18:39:37 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp29.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 804C93981CA; Wed, 5 Sep 2012 18:39:37 -0400 (EDT) Message-ID: <5047D4A6.9030003@sugarcrm.com> Date: Wed, 05 Sep 2012 15:39:34 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: "Morgan L. Owens" CC: PHP internals References: <50474A30.1090802@nznet.gen.nz> In-Reply-To: <50474A30.1090802@nznet.gen.nz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Moving to an AST-based parsing/compilation process From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > To date, I've been basing work, which exposes syntactic structure, on > phc's maketea grammar (Phalanger's is more up to date, but also more > complicated what with its provenance and the Linq and generics and all), > but it's reverse-engineered and certainly wrong (oh, that reminds > me...); the existing grammar is unsuitable because no-one wants to see > _that_. Well, now if you start to implement yet another AST grammar, it would be "wrong" too, at least for substantial time until the kinks are worked out - just because it's different approach which probably would work differently in some corner cases. So what we're getting on the plus side is more academically nice parser with potential optimizations, of which nobody knows if they'd have any real effect and all indications point to the possibility they won't, and we have some benefits for third parties doing some (unknown to us) work on PHP. On the minus side we have major disruption of the code base, virtually certain BC problems and stability problems, slower compiler and no real benefit for average PHP user. I'm not sure this equation has the positives outweigh the negatives. It'd be nice to support third-part work but I'd propose to start with writing the actual parser (e.g. as an extension or third-party library) and see if we can make it as fast and 100% compliant and if it turns out good then we could talk about replacing current parser with it. In the meantime you could also use it as base for your work too. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227