Thursday, March 13, 2008

self replication in computer science

The following program (C language) prints on stdout its own source code:

char * f = "char * f=%c%s%c;%cint main(){%c printf(f,34,f,34,10,10,10,10);%c}%c";
int main(){
printf(f,34,f,34,10,10,10,10);
}

It is one of the funniest thing a program can do: replicate itself!
Self replication is one of the most interesting features in the computer science: it intrigues researcher in computer science since the born of this discipline. Computer viruses often replicate their own code to spread themselves on different computers.
The most famous application of the self-replication in the theoretical computer science is the universal
constructor by Von Neumann (look at this link). Here below a fine picture of the universal constructor while is replicating itself:


Embryonics and the related POEtic project are very interesting projects which aim to exploit self-replication to compute and manage faults in HW and consequently in the SW mapped on the (bio-inspired) computational layer. It is described here.


Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home