Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!rutgers!mcnc!ecsvax!utoddl From: utoddl@ecsvax.UUCP (Todd M. Lewis) Newsgroups: comp.std.c Subject: Re: Portable Self-Replicating C Contest Message-ID: <6728@ecsvax.UUCP> Date: 27 Mar 89 13:42:39 GMT References: <2179@fireball.cs.vu.nl> <2976@goofy.megatest.UUCP> <9929@smoke.BRL.MIL> Organization: UNC Educational Computing Service Lines: 48 In article <9929@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > In article <1417@sw1e.UUCP> uucibg@sw1e.UUCP (Brian Gilstrap [5-3929]) writes: > >It seems that it would be impossible to create a program which generates it's > >source as output because you have a self-referential system and will end up > >with an infinite recursion. > > Nope. If you try to make that line of reasoning precise you'll find > gaps in the logic. In fact self-replicating systems can be quite small. > Self-reference need not imply infinite recursion, and self-replication > need not imply self-reference. That's a bit theoretical. If it doesn't convince you, try thinking about it this way. Most programs that will be submitted will use some form of put or printf call, yet the source to printf will not be printed. The point is that it could be. Think of the token "printf" as expanding to the entire source to printf. The program would still work, but the string produced by the program would have to be longer. That may make it more tricky, but not any harder, er, theoretically. Note also that this printf need not use the OS, but could go right to the hardware so that it could work without any OS at all. (How it would have gotten into the machine is another question.) Now that the magic is done, consider this: this program will only work on specific hardware. You have to consider this because each op-code is in fact "expanded" to the hardware design that supports it, just as printf is expanded on a higher level. Programs can only reproduce themselves in a suitable environment. (That goes for lizards, fish, people, and other self-replicating systems.) So work back from this perspective to our self-replicating program and you will see that the OS and library routines and the hardware all work together to create an environment in which our programs can "live" (dont take this too far..) and in which some programs can reproduce. You are right in thinking that programs can't really reproduce without some greater reference capabilities. Self-replicating systems rely heavily on building on the structure of their environments, whether that means computer op-codes and address spaces or atoms and the Universe. The "meaning" of our programms' op-codes derives from the hardware. Now, about that entropy thingy ... :) _____ | Todd M. Lewis Disclaimer: If you want my employer's ||\/| utoddl@ecsvax.uncecs.edu ideas, you'll have to || || _buy_ them. | || |___ (Never write a program bigger than your screen.)