No I'm not, please read my last post again if you got that impression. I explicitly mentioned that there will be a flexibility trade-off.
Nexus, pick, do you have to or do you not have to learn it? This is YOUR post:
A good binding abstracts from the C interface, so you don't have to learn it.
Which one is it? Learn or not?
You should really read the blog post of Selene I've link in an earlier post, it explains exactly what I mean. Code is much shorter and expressive when you use a C++ binding. Again: for a flexibility trade-off.
I read it long before this thread appeared. Selene is 10% feature complete, if that. Also, show me the C++ version. Unless there was a commit of VERY significant work, that adds upvalues to Selene in time between now and back when I downloaded it originally, it doesn't have them yet!
C++ version must be trivial.
Show the example code or go away with your 'claims'. If the way of the super C++ binding is so easy that using 4 methods is 'much' why did you not produce any so far to enlighten me?
Here is a C version, half of lines are setup required for other things, lines with x are 'dangerous'
like a slightly untame little kitten.
int iwantthreeupvals(lua_State * L)
{
const int a = luaL_checknumber(L, lua_upvalueindex(1));
const int b = luaL_checknumber(L, lua_upvalueindex(2));
const int c = luaL_checknumber(L, lua_upvalueindex(3));
lua_pushnumber(L, a + b + c);
return 1; //x
}
int main(int argc, char ** argv)
{
lua_State * L = luaL_newstate();
luaL_openlibs(L);
lua_pushinteger(L, 10);
lua_pushinteger(L, 20);
lua_pushinteger(L, 30);
lua_pushcclosure(L, &iwantthreeupvals, 3); //x
lua_setglobal(L, "iwant");
if(luaL_dostring(L, "print(iwant())"))
{
std::printf("%s\n", lua_tostring(L, -1));
}
lua_close(L);
}
Nexus - I'm tired of asking for clarifications of your convoluted statements, you have clear anti C, anti old C++ styles and anti C is ok to mix with C++ biases. Either you provide a clear answer, is C part of API good to know or not, and code examples of where C++ heavily beats C or you stop your raving against C API which had immense work put into it to become this clean.
LuaBridge is apparently not looked after anymore, Selene lacks a tonne of features, the blog post is at some times biased (but still more informative than your raving) and making code look longer in Lua version and omitting details. Slightly longer code in itself is not a downside, if the code is clearer and does one thing at a time as opposed to 5 that Selene likes to do. No other binding has been brough up by you or anyone. Probably none can compete against the fact that Lua:
0. has excellent documentation on itself, book PiL on the langauge and tons of tutorials that focus solely on the C API
1. is manatined
2. is developed (at a snail's pace but still, it is likely not going to die soon), and some bindings go back to 5.1 or 5.0 while Lua 5.3 is in sort of 'testing' right now
3. has a C API that is very clear and with superior feature set to most bindings when not
overwhelmingly complex
4. has a C API that happens to largely overlap with one of fastest dynamic JITs - LuaJIT