At the end of the day, you will always need to take values, plug them into a function, and return that value back to to the VM if desired.
Lua, Ruby, V8, you name it, they all do it. Are you expecting to magically pass a function and have some metaprogramming do everything for you? I mean this was certainly possible with LuaBind but then you suddenly take on Boost, and any experienced integrator will realize some systems quickly need more control than this.
There might be no better way of doing it (or maybe there might be - I have no opinion), but that wouldn't in my view automatically make the C API "remarkably excellent", "absolutely painless", nor the sort of thing that you might describe as "as easy as it is" (as were the original claims). It would just make it no more inconvenient than it has to be. Forgive me for not getting overly excited at that ;)
Suppose you have a function in lua, `f(x,y)' that you want to forward to your C function, `int f(int x,double y)'. You need to do something like this:
(It's worth having a scrabble through to see what the luaL stuff is doing internally, because some of it is string-happier than you might like. luaL_checkudata seems particularly rude. But checkinteger and checknumber seem benign enough.)If you don't use a debugger, and you're certain you'll never need any logging or whatever, and you're sure future you won't mind having to split things all out when they are in the middle of something else and discover they need logging after all, you could do it maybe more like this:
But even that still doesn't strike me as particularly convenient.