lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I call Lua from C++, and I just use the Lua C API to do it. I don't
find manipulating the Lua stack that troublesome, it seems easier to
use than the Python C API. But then, I'm not calling oodles and oodles
of Lua functions and classes, just a few.

Regards,
Mike



On Fri, Oct 7, 2011 at 4:05 PM, Patrick Rapin <toupie300@gmail.com> wrote:
> Hello,
>
> I have two questions to ask to the entire community. Because for me,
> there is a mystery.
>
>  - Do you run Lua scripts from within a C or C++ application ?
>  - If yes, what API are you using for it?
>
> I thought that calling Lua from C[++] should be very common. Lua is
> designed to be embedded, and is written in "clean C" to simplify
> compilation in various environments.
> The standard Lua API is powerful and complete, but not really handy.
> You have to load the code (compile), push the arguments, make the
> call, take the results back from the stack, and at most stages check
> whether an error happened and retrieve error message. The sub-API
> d'Arc does not simplify the task neither.
>
> There are numerous Lua-C++ bindings that ease the process. None of
> them seems popular however.
> I feel frustrated, because I wrote two open-source libraries to simply
> call Lua from C++ [1][2]. LuaClassBasedCall is particularly powerful
> and easy to use.
> It looks like nearly nobody uses it ! And I would like to understand
> why, to decide if I should definitely stop any development on it.
>
> Thank you,
> Patrick Rapin
>
> [1] https://github.com/prapin/LuaGenericCall
> [2] https://github.com/prapin/LuaClassBasedCall
>
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com