Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Why use a custom interpretter over mod_perl?

Quote Reply
Why use a custom interpretter over mod_perl?
I was talking to someone who said GT have created their own interpretter in pure Perl to support their templating scheme, but this was "a bit silly" because the precompilation of code and caching could be done by mod_perl, fast cgi etc, instead of their own interpretter.

Question is then, why the custom interpretter? What advantages does this offer over mod_perl?

Jason
Quote Reply
Re: [wickedmoon] Why use a custom interpretter over mod_perl? In reply to
>>I was talking to someone who said GT have created their own interpretter in pure Perl to support their templating scheme<<

I may be totally wrong here but I don't think that is true at all...not sure who told you or where they are getting their info from :)

The template parser builds its output in perl which then gets evaluated, it doesn't have its own interpreter.
Quote Reply
Re: [Paul] Why use a custom interpretter over mod_perl? In reply to
Can anyone at GT give a definate answer on this?

Jason
Quote Reply
Re: [wickedmoon] Why use a custom interpretter over mod_perl? In reply to
Hi,

I think I'm losing something in the translation, as what you are saying doesn't make much sense. GT::Template and mod_perl are not competing technologies. mod_perl embeds perl inside of Apache. GT::Template parses our <% .. %> template language into perl code.

Both applications can be used together, and offer great speed improvements when used together.

Can you get your friend to explain what he means a bit better?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Why use a custom interpretter over mod_perl? In reply to
He says, "What I don't understand is why they've created their own CACHE of Perl code internally to the the GT code rather than creating separate code files which could be run as mod_perl or CGI or fast CGI etc."

Jason
Quote Reply
Re: [wickedmoon] Why use a custom interpretter over mod_perl? In reply to
Does he mean the /compiled template directory?

....if so, those files contain the built up perl code for displaying templates and so instead of parsing a template everytime it can just pick it out from /compiled and eval it straight away which makes things much quicker.
Quote Reply
Re: [wickedmoon] Why use a custom interpretter over mod_perl? In reply to
Hi Jason,

I'm afraid I still don't understand. What section of the code is he referring to? Is he talking about the compiled directory? GT::Template::Parser will take your template, and convert it to perl code and save it in the compiled directory, so next time you parse the template, all you do is run a perl function, no parsing involved.

Again, this is completely different then mod_perl/fastcgi. If you are running under mod_perl, then the code is stored in memory, and your template simply becomes a perl function that is run for very fast performance.

Try and explain what "own CACHE of Perl code internally to the GT code" is.

Cheers,

Alex
--
Gossamer Threads Inc.