Native modules support #77
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lua is rich with its modules. But LuaJ seem to lack the part which is C-modules.
Anyone have an idea how C-modules can be used?
I'd ask in a community forum or chat but didn't find one.
LuaJ's "userdata" types are Java objects. You'd have to use JNI to wrap the C modules as Java objects. Non-trivial.
I understand. That's why asking about "ideas".
Maybe there's a tool that will produce a JNI wrapping for a C API that you could use as a first step? It looks like SWIG has some kind of support for making JNI wrappers for C code.
This whole situation with C modules makes LuaJ somewhat separated from Lua
existing ecosystem, right? Or i take it wrong?
Bearing in mind that I'm a newcomer to Lua: LuaJ strikes me as a way to embed Lua in Java apps and libraries, NOT as a platform for general Lua programming. I wouldn't expect everything in the normal Lua ecosystem to work with LuaJ. It's based on Lua 5.1 to begin with; any Lua library that requires 5.2+ is going to have trouble.
LuaJ not support or implement Lua C layer. So you can not use Lua C libraries.
If you need run C code you can load and run libs via Java calls like System.loadLibrary().
Go to Readme and re-read LuaJ goals.