Re: Re: Moving to an AST-based parsing/compilation process

From: Date: Wed, 05 Sep 2012 22:39:34 +0000
Subject: Re: Re: Moving to an AST-based parsing/compilation process
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-62840@lists.php.net to get a copy of this message
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

« previous php.internals (#62840) next »