// the find
cloudwu/luaecs
A minimal Entity-Component library for Lua by cloudwu (of skynet fame), aimed at game developers who need C-side component storage for performance but want Lua flexibility for the rest. It's a library, not a framework — no systems scheduler, no built-in game loop, just storage and query.
The C/Lua component split is the actual design win: hot-path components (vectors, floats, tags) live as packed C structs you can walk from C via entity_iter/entity_sibling, while arbitrary Lua values (strings, tables) get their own storage path — you get cache-friendly iteration without losing Lua's flexibility everywhere else. The select pattern syntax ("vector:in name:in absent:foo") is compact and maps directly onto the query without building intermediate tables. It also exposes a real C API (luaecs.h), so systems written entirely in C can bypass the Lua boundary for the inner loop, which matters if you're building anything with thousands of entities.
Persistence only covers C components — any Lua-side component silently doesn't round-trip through save/load, which is a hard limit for anything beyond a prototype. Documentation is one README with terse examples; subtle invariants like "iterator is invalid outside the loop" or "you must clear a component before using the `new` action" are called out in prose NOTICE blocks with no compiler or runtime check backing them up, so violating them is a silent bug, not an error. The repo has 30+ loose test*.lua files with no naming scheme and no CI configured, so there's no clear way to know the library still works after a change short of reading and running them by hand. No LuaRocks packaging or changelog either, so pinning a version means diffing commits yourself.