You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Dishara Wijewardana <dd...@gmail.com> on 2012/06/23 09:12:24 UTC

Does velocity engine compile the script before evaluating

Hi ,
In JSR 223,
It has a concept of compiledScript which is a script compiled by the
Compilable class. Then that compiled script is used to do engine.evaluate()

Does velocity engine compile a script before evaluating or does it has at
least such functionality as an optional one ?
As far as I understand this compilation means probably a kind of ANTLR like
compiler which compiles the script grammer.


-- 
Thanks
/Dishara

Re: Does velocity engine compile the script before evaluating

Posted by Dishara Wijewardana <dd...@gmail.com>.
On Tue, Jun 26, 2012 at 1:29 AM, Claude Brisson <cl...@renegat.net> wrote:

> Yes. The Compilable paradigm is optional in the JSR223 specs, one could
> consider template parsing itself as a compilation step, but it sounds
> rather artificial - it's a caching process, with different caching
> strategies which can be configured, and VTL remains an interpreted
> language. Better leave aside this feature.
>
+1

>
>  Claude
>
> On Mon, 25 Jun 2012 12:46:48 -0700
> Nathan Bubna <nb...@gmail.com> wrote:
>
> > Templates are not compiled into any other language (bytecode or
> > otherwise).  They are interpreted into an AST which is then typically
> > cached.  Many years ago, experiments in compilation failed to produce
> > any worthwhile benefit over a cached AST, no one has attempted it
> > since for any java template engine i'm familiar with.
> >
> > On Sat, Jun 23, 2012 at 12:12 AM, Dishara Wijewardana
> > <dd...@gmail.com> wrote:
> > > Hi ,
> > > In JSR 223,
> > > It has a concept of compiledScript which is a script compiled by the
> > > Compilable class. Then that compiled script is used to do
> > > engine.evaluate()
> > >
> > > Does velocity engine compile a script before evaluating or does it
> > > has at least such functionality as an optional one ?
> > > As far as I understand this compilation means probably a kind of
> > > ANTLR like compiler which compiles the script grammer.
> > >
> > >
> > > --
> > > Thanks
> > > /Dishara
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: dev-help@velocity.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>


-- 
Thanks
/Dishara

Re: Does velocity engine compile the script before evaluating

Posted by Claude Brisson <cl...@renegat.net>.
Yes. The Compilable paradigm is optional in the JSR223 specs, one could
consider template parsing itself as a compilation step, but it sounds
rather artificial - it's a caching process, with different caching
strategies which can be configured, and VTL remains an interpreted
language. Better leave aside this feature.

  Claude

On Mon, 25 Jun 2012 12:46:48 -0700
Nathan Bubna <nb...@gmail.com> wrote:

> Templates are not compiled into any other language (bytecode or
> otherwise).  They are interpreted into an AST which is then typically
> cached.  Many years ago, experiments in compilation failed to produce
> any worthwhile benefit over a cached AST, no one has attempted it
> since for any java template engine i'm familiar with.
> 
> On Sat, Jun 23, 2012 at 12:12 AM, Dishara Wijewardana
> <dd...@gmail.com> wrote:
> > Hi ,
> > In JSR 223,
> > It has a concept of compiledScript which is a script compiled by the
> > Compilable class. Then that compiled script is used to do
> > engine.evaluate()
> >
> > Does velocity engine compile a script before evaluating or does it
> > has at least such functionality as an optional one ?
> > As far as I understand this compilation means probably a kind of
> > ANTLR like compiler which compiles the script grammer.
> >
> >
> > --
> > Thanks
> > /Dishara
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: Does velocity engine compile the script before evaluating

Posted by Nathan Bubna <nb...@gmail.com>.
Templates are not compiled into any other language (bytecode or
otherwise).  They are interpreted into an AST which is then typically
cached.  Many years ago, experiments in compilation failed to produce
any worthwhile benefit over a cached AST, no one has attempted it
since for any java template engine i'm familiar with.

On Sat, Jun 23, 2012 at 12:12 AM, Dishara Wijewardana
<dd...@gmail.com> wrote:
> Hi ,
> In JSR 223,
> It has a concept of compiledScript which is a script compiled by the
> Compilable class. Then that compiled script is used to do engine.evaluate()
>
> Does velocity engine compile a script before evaluating or does it has at
> least such functionality as an optional one ?
> As far as I understand this compilation means probably a kind of ANTLR like
> compiler which compiles the script grammer.
>
>
> --
> Thanks
> /Dishara

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org