lua-users home
lua-l archive

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


Hi Luiz,

> I expect that most 5.1 libraries are easily ported to 5.2, especially
> if they are written in C. See this thread: http://lua-users.org/lists/lua-l/2012-09/msg00596.html

This is interesting. Given that there are only few functions that need to be mapped, is there a "good" way to provide a library that could work with both Lua 5.1 and Lua 5.2 run-times?

Both Linux and OSX provide a way to do dynamic symbol lookup (-undefined dynamic_lookup). It should be possible to provide "proxy" for those functions that have changed between 5.1 and 5.2 and resolve them at run time depending on the version of loaded Lua libraries.

Windows may be a bit more challenging, but could be doable too using something like this proxy DLL (http://lua-users.org/wiki/LuaProxyDllFour) using statically compiled Lua executables.

Or am I completely off with this idea?

Paul.


On Mon, Apr 8, 2013 at 5:20 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> if libraries you need are 5.1-only and are not easily ported

I expect that most 5.1 libraries are easily ported to 5.2, especially
if they are written in C. See this thread:
        http://lua-users.org/lists/lua-l/2012-09/msg00596.html

For 5.1 libraries written in Lua, the only difficulty will be dealing
with setfenv. Ideally this should be handled by rewritten them using the
new _ENV mechanism or using the new env arg in load. The other common
problem is the removal of the module function; it is recommended that
libraries be rewritten in the current, simpler scheme.

I thought there was a wiki page on porting 5.1 libraries to 5.2 but
I can't find it now.