RE: [SMARTY-DEV] Smarty compiler
| From: | Lee Coltrane | Date: | Wed, 06 Nov 2002 22:09:58 +0000 |
| Subject: | RE: [SMARTY-DEV] Smarty compiler | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-328@lists.php.net to get a copy of this message | ||
SO... the question still remains:
Do the benefits of a token-based parser justify the effort required to
completely rewrite the smarty compiler? Personally, I don't know. I'm
relatively happy with the way smarty works right now, but I acknowledge that
there would/could be some pretty cool pluses to a "cleaner" compiler.
so...I'll just summarize...
(as I've seen it so far on this list)
*The Benefits of writing Cleaner Compiler:
1) Easier to maintain/change/extend
2) More advanced grammatical constructs (like math)
3) better error reporting from the compiler.
4) presumably, it would not: "sometimes produce incorrect code from correct
sources" [boots]
5) a "pluggable parser/tokenizer architecture" [lee] would support
"homegrown extensible parsers" [boots] which would provide a lot of
flexibility.
6) we could support more full-featured compiler plugins
7) "Ability to better optimize the generated php code" [victor] (is this
true?)
...
*The Drawbacks to Writing a Cleaner Compiler:
1) lots of work.
2) could break anyone who has written custom extensions to the existing
compiler that go outside the 'compiler plugin' interface.
3) don't know how it will perform (better? worse? same?) until we write it.
4) Existing compiler works fine - "why fix it if it 'aint broke"...
...
n) ?any others?
-lee