lua-users home
lua-l archive

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




On 2018-02-25 01:26 AM, Sean Conner wrote:
It was thus said that the Great Soni They/Them L. once stated:
On 2018-02-24 07:19 PM, Sean Conner wrote:
It was thus said that the Great Soni They/Them L. once stated:
Why does nobody support renaming modules, it's 2018 :(
   Please rename a module written in C and get it to run, without
recompilation.  Then report your findings back here.

   -spc


Am I allowed to recompile Lua, or monkeypatch require? The default
behaviour is very much crap for C modules and I've been talking about it
for months now.
   Why can't you just rename the modules?

   Hint:  the thread starting here: http://lua-users.org/lists/lua-l/2013-06/msg00464.html

   -spc (You have?)





Yes, Lua likes to hardcode C module names and doesn't call them with their modname + path.

My idea is for a module loading system that looks for "luaopen_" symbol. then "luaopen_submod" and so on.

When requiring something that leads to an .so, it looks for "luaopen_" if the full path matched, "luaopen_submod" if it only matched up to the last, and so on.

And then I'd give it the modname and the path to SO, and maybe also the partial modname used to find the SO.

It would be a much better system that Lua doesn't support. It's so nice being able to pack libs with your scripts (and re-export any of those libs if your API relies on them).

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.