When compiling a Solidity contract, if you try to instantiate a version of the contract from within the contract's constructor, you get:
Internal compiler error: Compiled contract not found.
If you break it into two contracts that instantiate each other, and then try to compile, the second (from the top down) will succeed (as it knows the one before), but the first will fail (because it doesn't yet know about the other contract) with the same error as above. Hence, the circuit can never be closed.
But I had a thought: Couldn't you "force-compile" a bytecode version of a cyclical contract (one that instantiates itself in the constructor) and then publish it to the blockchain? Or maybe you could publish a kosher contract like you'd normally do, but the contract contains a bytecode string of itself so that it can self-replicate.
Why would anyone want to do this?
One huge benefit would be a cron-like daemon. If you could create a contract that creates a new version of itself on each new block, then a list of jobs to be executed by block number could be passed from contract to contract, executing on the given schedule.
(Contracts using this mechanism would merely tell this block head crawler which block they want a transaction to happen on, give it the ether/gas to do it and tell it how to do it. Once the cron-like block head crawler calls the function of the requesting contract, it could then make a new request to do it again on block.number + 10 blocks, and so on.)
Side question, why can't contracts self replicate? What's the concern so long as gas prices are paid?
And a noob question: Can contracts be re-infused with new gas after creation?