Reloading a shader program where the changes cause compilation errors leads to an invalid program object
This issue forces users to be very careful when editing shaders which are currently in use and reduces the usefulness of shader hot reloading.
The common solution is:
Instead of leaving the shader in an invalid state, switch it with an "error shader" (e.g. the offensively pink material in Unity3D). Of course this does not solve issues where other parts of the pipeline depend on the output of the program.
It might be simpler to switch back to the previous version of the program if compilation errors are detected. I implemented this here naively and it works fine, but I need to make sure I'm cleaning up memory and OpenGL resource properly.