lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Cool, thanks for getting this out, Wes!

Another possibly interesting little fact about Lust's implementation is that each template defined is internally reified into a program by generating Lua code specialized to the template, which in some cases can significantly speed up processing.

Graham

On Apr 13, 2013, at 6:33 PM, Wesley Smith wrote:

> Hi List,
> This is to announce a new templating system for Lua inspired by Terrence Parr's StringTemplate [1][2].  We have used Lust to deploy a pretty sizable runtime Lua -> C/C++ code generation system so it has been tested in the field quite extensively.
> 
> Lust operates an Lua tables as directed by operations defined in the template strings.  There is a lot of variation possible in the syntax, so the README is mostly short examples since that's the easiest way to describe the system.
> 
> One of the unique features of Lust is dynamic dispatch within the templating system.  With this feature, it's possible to turn the templates themselves into a description of a state machine, which is extremely useful for complicated templates such as those that synthesize code from an AST.  See the examples/dispatch.lua example script for a short demo of this design pattern.
> 
> Lust can be found on github at: https://github.com/weshoke/Lust
> cheers,
> wes
> 
> [1] http://bit.ly/XIY2G9
> [2] http://www.stringtemplate.org/