Variables are often used in Scribunto Modules to keep persistent data between invocations and to allow communication with templates and other wikicode. Currently the only way to do this is to use something like mw.getCurrentFrame():callParserFunction( '#vardefine', { 'foo', 'bar' } ) (or a separate extension like VariablesLua).
I'd like to suggest adding a native Scribunto support to the extension itself to improve usability and performance when using variables from Lua.
The best way to implement this would probably be using metamethods instead of just creating bindings to the already existing functions. Some examples for the suggested syntax can be found below:
- vars.foo = 'bar' instead of vars.setVarValue( 'foo', 'bar' )
- vars.foo instead of vars.getVarValue( 'foo' )
- vars.foo = nil instead of vars.unbindVar( 'foo' )
Additionally it would be useful to have access to the raw variable table ($mVariables).