Real viruses come in all sorts of flavours. Some are RNA based, and just inject themselves into the cytoplasm. Some are DNA based, and infect the host's actual DNA, injecting itself into the strand. Most of the repetitive, non coding portions of our own genome are probably ancient viruses that got deactivated through some means.
We need to carefully balance the competing needs of viruses-as-evolutionary-partners and viruses-as-weapons for the program itself. Viruses are very useful in zerobot sims. Some of the most impressive developments have been from propogating viruses. Likewise some of the most interesting weapons are viruses, since generally you want a virus to gimp an enemy instead of outright kill them.
As I see it, it's imperitive for viruses to become part of the bot's primary DNA in some way. It's also important for viruses to have access to everything that regular DNA has access to. Both of these are important for horizontal gene transfer. Don't think of viruses as some short of one-shot-kill weapon that DNA needs to protect itself againt. Viruses are bits of cousin DNA without a host to propogate it. They're like uninvited relatives. No more or less legitimate than you are, just annoying
to you.
I still would tweak them. Because virus are placed at the end of the code,
Viruses are placed
after a random gene.
.delgene gives virtual virus inmunity for bots that check for any appended genes. That's neat if it emerges on an evosim, but not so fun for hand made bots.
delgene only gives immunity to bots who can immediately determine where the virus was placed, ie: one gene bots. And even then, only for a single cycle, with some caveats.
If the virus was inserted randomly after any 'stop' it would be more expensive to provide full virus inmunity through code.
It's possible to code a normal bot (not one gened or anything) without any stops. Modern DB DNA is extremely flexible in format. A single cond statement can control many different start/else blocks. This has problems in other places too. Most of the time, parts of the program can't agree on where one gene starts or another ends.
This also has issues with viruses and their cond statements (or lack thereof).
...Such a model may mor eclosely simualte RNA viruses, allowing for the hijack of soem of the functionality of an existing gene. Bots can mutate their own sequences to defend against such recognizers, like evolving a different protein coat. Nature is full of such battles and arms races at the genome level.
Same as my other post, I don't like making the genome part of the phenotype. This is one of the few things I have strong negative feelings toward.
I shoudl point out that the seperation between geneotype and phenotype is not a crisp one, in DB or in nature. An organism's genotype has physical representation, is accessable, manipulatable, corruptable, etc.
In nature, there's a strong disconnect between the blueprint and the protein it creates. DNA->RNA->Protein. Why does such a mechanism exist except to seperate the core "logic" an organism uses from the implementation of that logic.
For Alife sims, I think this seperation is important because if it's
not there, a genome will tend to become extremely brittle and resistant to change, and simplify and streamline itself at the expense of complex behavior (so called retrograde-evolution)
I think I also favor the addition of commands which allow for sequence policing and correcting e.g. computing checksums and BP sequence copy and deletion primitives. One can imagine this leading to bots taking reproduction into their own hands (so to speak) by evolving genome copying machinery with error correction.
I'm not against exploring analogues for DNA repair mechanisms, but I'm strongly against giving bots a clear cut hash test of its DNA. Real DNA is billions of base pairs. It's impossible for the whole genome to know when part of it has been changed.
Take, for example, diploidness and sex. One possible origin is DNA repair. Maybe two cells will join briefly to check the differences in their DNA for errors, and this practice eventually gave rise to what sex is (think sex on the fungal or microscopic level, not mammalian sex).
DNA repair is wonderfully, beautifully, hacked together and error prone. The cell has no way to magically detect foreign DNA and eject it. Even relatively routine repairs cause mutations and other changes to the DNA. Excising a virus that's inserted itself into the genome is flatly improbable.
DNA is the one place where I want to stick as closely to nature as at all possible. The form of life is so varied, but the form of DNA is not. DNA must be doing something right, carefully balancing the competing needs of evolution and conservatism.
This is why my work on the next generational DNA language is so important. Viruses-as-codules or viruses-as-chromosomes allow viruses to infect a cell, alter its workings on par with the rest of the genome, yet without causing interuption to the regular work of the rest of the genome. Viruses can be seen as weapons or horizontal gene transfer depending only on your point of view.
In the short term, the most "fair" way to insert DNA would be randomly at any point. Let viruses easily overpower whatever local DNA they get inserted inside. Let there be no way for a virus to excise this virus. Strengthen the primary viral defense: slime. Get rid of delgene, which can have no useful purpose in such a system, and is grossly overpowered as a weapon. You free DNA from the constrictions of making itself virus proof without overpowering viruses.