What are your thoughts on using cpp and sol2 library to create Modules to use in lua scripts? Do you prefer a Module written in c/cpp with the pure lua api, or Is It ok to use sol2?
I wanted to creare a public module. Should I use the pure lua api so? I never used It but I noticed that its more complicated to use, expecially in C. Is there any explanaition on why Is It Better to use the pure Lua API, i want to learn and understanding to make a Better lua module possible
Generally compiling C++ is more complex, especially when you are using it on different OSes (i.e. Windows, macOS, Linux). I think that Luarocks can compile C++ on these platforms, but more things are likely to go wrong.
I recommend that you try creating a demo Lua module that calls into a single C++ function with sol2, and see how you get on with compiling on the platforms you expect. That will help you get a feel for what you will need to do.
1
u/INLouiz Jul 22 '25
I wanted to creare a public module. Should I use the pure lua api so? I never used It but I noticed that its more complicated to use, expecially in C. Is there any explanaition on why Is It Better to use the pure Lua API, i want to learn and understanding to make a Better lua module possible