3 ms·
I've looked at this codebase and that of the XL version. Can a neone explain why there's C code there if it's meant to be lua? Genuine novice question. Thanks.
by account-5 4y ago
I've looked at this codebase and that of the XL version. Can a neone explain why there's C code there if it's meant to be lua? Genuine novice question. Thanks.
- ever1337 4y agoNo idea about this project in particular, but Lua is designed with C operability in mind. It's very easy to integrate the two languages together and this is often done so that you can have performance-constrained code written in C with higher level scripting done in Lua.
- nateb2022 4y agoThe C is mainly used to wrap the Lua interpreter, so that the editor can be distributed without the need for the user to have a compatible Lua interpreter installed.
- cturtle 4y agoThe other replies are correct, but there is a bit more to it. Lua is a very small language with a tiny standard library. To extend it you write modules in C (or another language with bindings). This allows connecting the Lua code to various libraries. A notable example in lite is SDL. Without the C code in this repo the Lua code wouldn’t be able to use SDL for drawing or inputs