I was thinking of a system generating code in the same language, and still keeping the root object, so that you can experiment, add some new dependencies, and regenerate dependenceis, many times.
But you can at any moment pass null from the main loop instead of the proper root object to see if the code is generated properly and works only with the functional part.
It's more complicated than a system that just regenerates everything from scratch every time. And removing dependencies would be tricky. So maybe your idea is better.