LPEG-based Lua Macros


Luma is a macro system for the Lua language that is heavily inspired by Scheme's define-syntax/syntax-rules system. The Scheme macro system uses pattern matching to analyze the syntax of a macro, and template substitution to build the code that the macro expands to. This is a powerful yet simple system that builds on top of Scheme's structural regularity (the use of S-expressions for all code).

Luma also separates the expansion process in pattern matching and template substitution phases, but as Lua source is unstructured text the pattern and template languages have to work with text. Luma uses LPEG for pattern matching and Cosmo for templates.


This is the first public release of Luma, version 0.1.


Get Luma from its LuaForge page.


As this is the first release there is no history of previous releases.

Contact Us

For more information please contact the author, Fabio Mascarenhas. Comments are welcome!

Valid XHTML 1.0!