UniLua icon indicating copy to clipboard operation
UniLua copied to clipboard

The FFI library

Open matiasah opened this issue 11 years ago • 6 comments

Hello, UniLua has most of the standard libraries from Lua (they're understandable because it's documentation can be found on lua.org), but the FFI library used in UniLua is quite different from LuaFFI, can you provide some documentation to it or at least some examples of the usage?

matiasah avatar Oct 10 '14 10:10 matiasah

the FFI library is experimental, and it is not recommended to use it. so right now there is no document.

On Fri, Oct 10, 2014 at 6:56 PM, Starkkz [email protected] wrote:

Hello, UniLua has most of the standard libraries from Lua (they're understandable because it's documentation can be found on lua.org), but the FFI library used in UniLua is quite different from LuaFFI, can you provide some documentation to it or at least some examples of the usage?

— Reply to this email directly or view it on GitHub https://github.com/xebecnan/UniLua/issues/46.

xebecnan avatar Oct 10 '14 16:10 xebecnan

Hello again, I'm not actually using UniLua for development but I know someone that does, that means the only way we could mod UniLua is either with DLL(s) or FFI. The DLL way seems too complicated for me, so I just wanted to come with three questions. 1.- The FFI library might lead the program to crash if not used correctly, is it functional if its used correctly? 2.- Is the FFI library integrated by default whenever you load the base libraries? 3.- I saw one of the Lua coded files (ffi.lua) being requiring a plain .cs file, I'm not used to C# but from what I understood they're code files and that means you can load it as if it was a dynamic library, am I wrong?

matiasah avatar Jan 31 '15 23:01 matiasah

hi Starkkz, I think the best way using UniLua is making implementation of API which you need. You could find a example here.

gillonline avatar Feb 02 '15 15:02 gillonline

Hmmmm.... Link?

matiasah avatar Feb 03 '15 02:02 matiasah

https://github.com/xebecnan/UniLua/wiki/%E4%BB%8E-Lua-%E8%B0%83%E7%94%A8-C%23-%E5%87%BD%E6%95%B0-%28-Calling-C%23-funcitons-from-Lua-%29 sorry for lost the url

gillonline avatar Feb 03 '15 05:02 gillonline

I'm a bit confused for the language used there, is libfoo.cs included in the binary (as well as a module name) or just a file that can be loaded from the executable's folder?

matiasah avatar Feb 03 '15 18:02 matiasah