"The solution (hint: there wasn't one until now)..." That's quite the bold statement. I actually thought of IUP/Lua when I saw this line, and it turns out you precisely used IUP for the UI portion of your framework! Except you didn't use the Lua binding, instead you created a Janet binding.
Using something like luastatic[1], with whatever Lua libraries you want (including IUP), you can get something pretty similar to this system, except of course you'd be using Lua instead of Janet. Janet is really interesting and that alone justifies this framework very well.