[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Calling Lua from C
- From: Marc Balmer <marc@...>
- Date: Fri, 07 Oct 2011 22:25:59 +0200
Am 07.10.11 22:05, schrieb Patrick Rapin:
> 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?
The Lua C API.
> 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.
I disagree. It is 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.
C++ is not popular in my community.
> I feel frustrated, because I wrote two open-source libraries to simply
> call Lua from C++ . LuaClassBasedCall is particularly powerful
> and easy to use.
It is irrelevant to C programmers like me. I dislike C++ and don't use it.
> 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
>  https://github.com/prapin/LuaGenericCall
>  https://github.com/prapin/LuaClassBasedCall