2
VINDIC
5y

I am learning Lua because I am developing in a game. My question is would there be a way to load C into Lua

Comments
  • 1
    Load c into lua?
  • 0
    @Jifuna Like how you can use .js in javascript
  • 0
    @VINDIC You can't load C into Lua, the closest thing you can do is expose wrapped C functions in the Lua env so you can call them from Lua scripts. Are you sure you don't mean the other way round (Use Lua in C)?
  • 0
    @12bitfloat Thank you That is what I meant I am but a novice when it comes to languages like Lua so I don't know the terms for things.
  • 0
    No you can't just #include "file.lua" and have it work. Unfortunately the process is quite a bit more complicated and involves interfacing the two languages together. It takes a lot of research and practice as there aren't a ton of great resources available for such a task. Though, the Lua book is not a bad place to start. The online version is cut down quite immensely.
  • 0
    Luckily the Lua C API is pretty great and mostly intuitive
Add Comment