lua-users home
lua-l archive

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

On Mon, Jan 10, 2011 at 23:47, Thomas Harning Jr. <> wrote:
> On Mon, Jan 10, 2011 at 11:51 AM, Alexander Gladysh <> wrote:

> > OTOH, C++ and Lua, compiled in plain C, really do not play well together.

> Lua does indeed play well with C and C++ at the same time... no need
> to specially compile Lua as C++.

> Now, you do need to make sure that you protect your call-sites Lua->C
> so that C++ exceptions don't bubble past Lua as well as Lua errors
> don't bubble past C++ stack mgmt (always pcall).

Well, that is more or less what I meant by "do not play well together".

For C++ exceptions things are more or less under control, but I find
it almost very hard to write safe bindings in C++, so that Lua errors
would not get past C++ stack management. Looks like (almost) every Lua
function that C++ calls should be pcall-ed. I do not think that this
will be particularly fast.