Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua 5.3 features used #49

Open
turbo opened this issue May 20, 2020 · 1 comment
Open

Lua 5.3 features used #49

turbo opened this issue May 20, 2020 · 1 comment

Comments

@turbo
Copy link

turbo commented May 20, 2020

Hi, first of all, thanks for this lib!

I'm using LuaJIT 2 exclusively and would like to know what the main features are that this lib uses which are exclusive to Lua 5.3 (vs 5.1 for JIT) just to gauge how much effort it would be for me to adapt this to my purposes.

Thanks!

@SatyendraBanjare
Copy link
Owner

Hi @turbo , thanks for reaching out !

Firstly I'd like to clarify that this library uses the Lua-C Api and not the JIT for the purpose. When developing the project we thought to make it for the latest available version of lua i.e 5.3 . I therefore did not look for the differences explicitly between 5.3 vs 5.1 for the Lua-C Api.

The reason we thought to use this was because Libgit2 has quite complex codebase written in C and if we did use the FFI, we might had to rewrite a lot of the functions. Also at the time of writing this project, the FFI did not support the include statements in C ( I am not very sure about the current status) .

Finally as a small explanation on the working of the project, we have all the Libgit2 code available that is installed as a shared library. We use Lua-C Api to form a bridge by creating a shared stack that is accessible from C. Using the stack we can properly control the number of arguments passed from Lua to C and returned after processing from C to Lua. Also we can check for the errors using the luaL_error() function.

Please look here for the official documentation https://www.lua.org/pil/24.3.2.html

Hope that helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants