Re: PHP Abstract Syntax Tree
| From: | Richard Lynch | Date: | Fri, 14 Apr 2006 21:44:21 +0000 |
| Subject: | Re: PHP Abstract Syntax Tree | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-22770@lists.php.net to get a copy of this message | ||
On Fri, April 14, 2006 4:26 am, Sebastian Bergmann wrote:
> Dmitry Stogov schrieb:
>> So some optimizations may be done fine on AST level too.
>
> ASTs are useful for performing code transformations (think of
> language
> extensions like William's PHPAspect or automatic refactorings as
> examples).
Naive Input:
So it's a lot like XSLT, which can be really nifty.
But that doesn't make XSLT something that I want to employ on every
XML file that I want to convert and spit out *fast* in a production
application.
Depending on the transformation involved and the source/output needed
(or that you're stuck with, usually) it seems to me that XSLT can be a
big winner or a big loser.
Seems like AST is a great tool for code analysis, development,
debugging, re-factoring, optimizing -- but I don't see how that makes
it a winner for the run-time compilation.
Perhaps, though, a side-by-side comparison of William's AST-compiled
code and PHP native JIT-byte-compiled code would be interesting to
explore...
If the AST could be spliced in as a patch and given a trial run.
'Course, I'm not the guy that is gonna have to do all that work :-)
--
Like Music?
http://l-i-e.com/artists.htm