RE: [SMARTY-DEV] Smarty compiler
| From: | Brandon Inman | Date: | Fri, 08 Nov 2002 00:34:08 +0000 |
| Subject: | RE: [SMARTY-DEV] Smarty compiler | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-329@lists.php.net to get a copy of this message | ||
Perhaps I should have been more specific in what I meant by
a "real compiler"! I didn't mean to suggest that smarty
should create binary files at all, but rather change the internal
workings of smarty to function as a complier and produce php code,
as Smarty does now.
I can see that the majority isn't interested in making the switch,
but I'll offer my opinions anyway. I am still offering to help in
other areas, assuming I haven't offended anyone too badly ;)
> 4) In other words, why is a 'real' compiler an improvement?
The first advantage is that syntax checking would be much easier.
Smarty would no longer produce php code that was invalid, thus saving
debugging time. How many people haven't wasted some amount of time
trying to track down a bug to find out that they were simply missing a
{/foreach}?
The second advantage is one that was mentioned previously, that
mathmatical and other language constructs could more easily be
introduced into the smarty grammar.
What will not be changed greatly is speed. That was never
my intention. In fact, I would venture to say that the compiling
phase of Smarty would be slower than now, and runtime would
be the same to slightly slower.
> 5) Can it be done without breaking backward compatibility,
> given current Smarty syntax?
Yes.
> 7) What are some other other pros and cons?
The main con I see is that it will take some time and effort to convert
Smarty over. That time and effort could better be spent improving the existing
code.
The main pro is that future development work on Smarty would be easier
and the results of Smarty more consistant, especially when the template
itself is invalid.
Brandon Inman
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2