r/lua • u/Kaan0002 • Feb 01 '26
morolua, a small, engine-agnostic Lua utility library to avoid rewriting common helpers every project. I’d appreciate feedback on the API design and scope.
20
Upvotes
2
u/PianoDogg Feb 01 '26
How would you compare and contrast this to penlight?
2
u/Mig_Moog Feb 02 '26
Cool stuff! Would you accept a PR for shapes + shape collisions?
1
u/vitiral Feb 01 '26
Looks pretty cool.
This code should recursively call is callable in case
__callis set to a callable table1
u/PazzoG Feb 01 '26
I like it, especially the class wrapper which was my favorite part in a similar but niche project I wrote before. This is exactly my favorite part about writing Lua code: having a reusable API that makes everything easier and more fun to work with.
In
taskx, I think it would be better to leave taskx itself as the orchestrator and expose ataskobject that taskx returns on creation. That way, if you want to interact with just one task, you won't have to iterate through all tasks. For exampletask:cancel()would mark the task for cancellation, same for resume and similar methods. Then your update loop handles each task depending on state. You can keeptaskx.cancelastaskx.cancel_alland remove the if statement. For now I think this is just sugar but if you want to expand this in the future, I think going this route would be cleaner.0
u/[deleted] Feb 02 '26
That's just some other shtt it's low quality bro
2
u/[deleted] Feb 02 '26
[removed] — view removed comment