sro5h/flecs-luajit ? reverse-engineered prompt

Reverse engineered prompt

Build me a small LuaJIT based host for the flecs ECS library, so I can write game or app logic in Lua and run it inside a C flecs world.

I want the C side to initialize flecs, load a Lua script, and let that script create components, entities, and systems, then update the world each frame. Please include a simple example like moving an entity with Position and Velocity, plus a more complete sample in the example folder if that helps show how it works. Keep it working with the current flecs version noted in the README, and make sure the Lua API feels easy to use from a normal script.

Use the existing build setup, and make it compile cleanly with Meson. If you need to check current flecs or LuaJIT docs online while filling in gaps, go ahead and do that.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab