Hey, today I released a new version of naylib. As always, it tracks the latest upstream, but this update also includes a breaking change with LoadModelFromMesh. Since the raylib API doesn’t use reference counting (as it probably should…), I had to come up with some clever, but fragile, workarounds to distinguish between weak and owning references using distinct types.
The main reason I’m writing this thread, though, is to let you know that the workflow for updating naylib is now done using AI agents. Why? Because a simple shell script would break, updates usually include API changes, and those need to be filtered and properly applied to the wrapper. The process has to be done step by step, fixing any errors along the way.
You can see how it works here: https://github.com/planetis-m/naylib/issues/179. Most of the time it’s automatic, but when there are API changes, I still need to guide the agent toward the correct fixes, which it then applies by itself!
The examples also include a translation guide for agents, to give context when converting examples to Nim. Setting this up was difficult, it includes rules of thumb and patterns, for example for float types:
Prevent unintended type mismatches: Use literal suffixes ('f32) or explicit conversion (float32(value)),
(e.g., lineThick*0.5'f32, float32(screenWidth)/2) to ensure float32 precision.
That said, I haven’t been as successful with this part. The agent usually fails to follow the guide on the first try, so I often have to ask it to review the file and apply fixes according to the rules, and doesn't alwys go well.
"Debugging" is also interesting, I ask the agent to review the file based on the guide, spot issues then ask it to improve the phrasing of the guide. Finally I paste the conversation to a "judge" LLM and refine it from there. This helps fix some ambiguites on my instructions.
Anyway, since many people are solo-maintaining big wrappers, I thought you might find this interesting. Cheers!