Re: Moving to an AST-based parsing/compilation process
| From: | Dmitry Stogov | Date: | Thu, 06 Sep 2012 05:37:39 +0000 |
| Subject: | Re: Moving to an AST-based parsing/compilation process | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62842@lists.php.net to get a copy of this message | ||
Hi Nikita,
Personally, I don't see any reason to build AST. As you mentioned yourself, it will be slower and will require more memory. On the other hand AST itself would allow to perform only very basic optimizations. Most of them can be easily done on VM opcode level as well.
Also, as it's not an easy task, the old "ugly hacks" will be replaced with new mistakes, which would require new "hacks" in the future :)
The only real advantage could be an ability to expose AST to PHP 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