This is my first relatively-serious Zig project. It is a very easy to use library that helps you implement hot reloading for your application in just a couple of minutes. The dynamically loaded symbols are actually statically typed thanks to some meta-programming, so it's very safe to use, and it supports a "turn-off" switch that disables dynamic library shenanigans and just links the symbols statically.
Additionally it solves 2/4 of the biggest caveats of hot reloading with dynamic libraries, which are static/global variables and function pointers. With zr you can use them relatively seamlessly.
I would like to make this the best hot-reloading solution for Zig until the compiler gets support for hot-patching binaries on its own with eldritch magic. I think it already is that, but I would like some help if anyone's interested. I've tested this fully works on Linux, and it cross-compiles just fine to Windows but I'm not sure if it runs just fine. I would appreciate someone with a Windows computer to help me test if anything's wrong. MacOS should work fine but it's the same story.
I also think this can solve caveat 3 (threading) with some kind of thread tracker, and caveat 4 (struct size/layout changes) could potentially be something zr detects on its own with meta-programming shenanigans, to either crash or allow for custom handling. But that's in the future for now.
https://codeberg.org/zwynd/zr