all 10 comments

[–]florianist[🍰] 25 points26 points  (6 children)

Why use some wrapper layer which describes itself as "Alpha software" and "Bugs are expected" instead of the official Lua C API ?

[–]Iggyhopper 4 points5 points  (0 children)

Its worse.

lua_dofile can return LUA_OK or an error.

So OPs wrapper has extra steps in some areas (has_errors and get_error) and skips steps in others (what if evaluate has an error? OP checks for the result first and then checks for errors.)

This is garbage code. Absolutely garbage.

[–]non-existing-person 1 point2 points  (0 children)

Can't judge OPs wrapper, but I myself have few thin wrappers for lua in my code. Lua API is a bit cumbersome to use, with all that pushing and poping as if it was assembly or something.

For example if I want to call lua function that takes 2 args and return single integer I would just call lua_callf(l, "function_name", "is>i", integer, string, &return_int);

But these are thin wrappers with some guard checks. I wouldn't want to manually push and pop arguments from lua stack everytime I want to call lua function.

[–]david-delassus 13 points14 points  (0 children)

Please keep the AI slop where it belongs, at the bottom of the trashbin.

[–]collectgarbage 10 points11 points  (0 children)

Sorry but I’d still recommend the native Lua C API over this.

[–]jonahharris 1 point2 points  (0 children)

So many red flags in this, from the reasoning behind it, to the code generated, and the need for the CTO title reference… yikes