[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [ANN] Lust (Lua String Templates)
- From: Wesley Smith <wesley.hoke@...>
- Date: Sat, 13 Apr 2013 02:33:24 -0700
This is to announce a new templating system for Lua inspired by Terrence Parr's StringTemplate . 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.