lua-users home
lua-l archive

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

PS: at the risk of not getting precise answers for my more technical
questions, I would like to hear your opinions about the need of
metaprogramming in lua. As scheme, lua provides powerful basic
mechanisms that lend themselves to implement new control structures,
programming paradigms, etc. This often implies boilerplate code that
cannot always be abstracted out into reusable functions (maybe because
the function calling syntax isn't ideal for the specific construct,
maybe because the function calling semantics is inadequate).

On Fri, Jul 4, 2014 at 2:45 PM, Carlos Pita <> wrote:
> Hi all,
> as I'm coming to lua from the lisp/scheme world, metaprogramming
> facilities are at the top of my checklist. Also, since lua is
> minimalistic and provide powerful and generic building blocks
> (resembling scheme in both aspects) metaprogramming is synergic with
> the language design principles.
> I know of metalua, which is a compiler, and of luamacro, which is a
> preprocessor. But, as a newcomer, I'm still unable to completely grasp
> many details about versions, interoperability, tooling, and the like.
> So some questions are in order:
> 1) As metalua produces bytecode and luajit doesn't read any bytecode
> but its own, is it possible to combine metalua with luajit somehow? Is
> it possible to use metalua as a preprocessor? If it is, are there
> convenient tools to do this or will I instantly become a maverick
> (which I don't want at all)?
> 2) Is there any editors/ides supporting syntax extensions out of the
> box? I mean editors that become syntax-extension aware without a lot
> of effort from the user.
> 3) Up to this point my plan is to:
>    i) Use luamacro, as it produces standard lua source code, which
> makes it more interoperable with other tools.
>    ii) Use scintillua (inside textadept) to quickly hack new syntax
> constructs support using a bit of lpeg.
> What do you think of this approach?
> Any informed opinion will be very welcomed.
> Cheers
> --
> Carlos