RE: [SMARTY-DEV] Smarty compiler
| From: | Lee Coltrane | Date: | Wed, 06 Nov 2002 16:39:58 +0000 |
| Subject: | RE: [SMARTY-DEV] Smarty compiler | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-321@lists.php.net to get a copy of this message | ||
It seems to me that, unless we are aware of specific features that would
require a true grammar-driven compiler (ie. significant grammatical changes,
complex constructs, or other language-like features), we should stick with
what we've got.
There are only three things that I can think of, that we would gain from
driving the compiler off a LALR parser that was generated from a grammar:
1) it would be easier to change the inner workings of the compiler (add a
new grammatical construct, or extend an existing one) without worrying about
messing up something deep in the existing parsing logic, and breaking some
other feature.
2) we could make the smarty compiler give better "compile errors", when
there is a serious grammatical problem encountered during compilation.
3) we could include "native" support for mathematical operations (ie-
without the use of the -somewhat confusing and slow- {math ...} function).
Of course, I assume that we (collectively) want to keep the "language
features" of the smarty template as simple as possible. After all, this is
what templating is all about. Keep the template language simple, and force
the hard logic work back into the controller layer, so that designers (in
the view layer) deal only with design and layout. If this is our collective
view of things, then we might even be shooting ourselves in the foot if we
went towards a grammar-driven compiler. We might be opening the door for
people to make smarty templates as confusing as most jsp templates that I've
seen.
...imho, of course. :-)
-Lee
-----Original Message-----
From: Gary Loescher [mailto:gary@loescher.org]
Sent: Tuesday, November 05, 2002 10:29 PM
To: 'Monte Ohrt'
Cc: smarty-dev@lists.php.net
Subject: RE: [SMARTY-DEV] Smarty compiler
Monte wrote:
>would outweigh the drawbacks. It's already damn fast anyways,
>what's the
>problem? ;-)
That sounds like a good official tag line for Smarty:
"Smarty - It's already damn fast."
:)
>The overhead of regular expressions isn't such a big issue, it only
does
>this at compile time.
You brought up a good point about the time regexs take. Since
recompilation (should) only be occasional, it really isn't an
issue.
Anybody have a strong feeling on the pro side? I'm coming down on
the anti.
Gary
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php