4us
This is quite an interesting read: Virology 101 (gzipped postscript; via). In it, Doug McIlroy describes how to write a simple “virus”, in Unix shell script.
Back in the MS-DOS days, I thought of viruses as “viral code, usually written in assembly, that attaches to executables”, and while there were many viruses of that kind in that time, the definition is much too narrow. All a program needs to do to qualify as a virus, is:
1. do something.
2. replicate.
In fact, it doesn’t even need to “do anything”; replication is enough. And it doesn’t take very complex code to accomplish this, as demonstrated by the simple scripts in the paper. Nor does it require an “unsafe” system like Windows (although it helps in case the virus writer intends to do a lot of damage :-).
(No, I’m not going to try and write one in Scheme…)