My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

This project aims to develop an in-memory compiler for StringTemplate that will produce a compiled delegate (or a set of delegates) using DynamicMethod/ILGenerator objects of .NET class library, to allow templates run many times faster than their original speed.

To keep the compiler simpler and easier to develop, currently no parser is planned. Compiler will directly walk a StringTemplate object's in memory chunks, which are simply a set of expression trees.

The compiled delegate will be used in a special subclass of StringTemplate with overriden methods that use the compiled template delegate internally, rather than the actual AST expressions. This will enable a StringTemplate instance to be compiled into another fake StringTemplate instance, and used as if it is the original template, so the code using templates won't have to be modified. Such functionality will also allow templates to be optionally compiled (with a configuration flag).

StringTemplate is a popular template engine by Terrence Parr (http://www.stringtemplate.org/) that enforces strict model-view separation. It is available in Java, C#/.NET, Python and some other environments.

Powered by Google Project Hosting