VST/AU plugin as Host

I repackaged some software recently to compile as plugins (used to be standalone).

One of the programs was, among other things, a JUCE based VST/AU host. I assumed I would have to change the config and drop out that portion of the code to get it to run properly, but left it in at first, thinking JUCE would probably be smart enough to change config flags as needed.

To my great surprise, not only did it compile perfectly straight away, but it even maintained the hosting capability. The plugin read an xml config and successfully loaded several other plugins immediately. I checked the sound, and everything seemed fine.

I am amazed that a plugin can also function as a host, but wonder if there aren’t some serious issues here I am not seeing here.
Other than the expected latency concerns - there must be some other reason not to let a plugin be a host?

The only thing I can think of that might be a problem is that if you load the same plugin into both the host and the sub-host, then that plugin is running in the same address space, but in two different hosts, so if it keeps any static state that reflects the host, things may get a bit confused. But that’s not really something you could fix, it’s just down to the plugins being robust enough.

Right - got that one. I had noticed before that multiple instances of the same plugin have the same memory space for externs and singletons, which makes sense. I have generally avoided that, but still have a little cleaning to do in that regard.

And on the plugin that is host thing - WOW!! That rocks. I had entertained the notion that it could be done, but didn’t think it feasible really. Are there other mainstream programs that do that? I mean, many DAWs can be run in plugin mode, but I am pretty sure they lose their hosting capabilities when in plugin mode, right?