Live data from Hacker News

The world's smallest self-replicating program

ioccc.org

51–60 of 65 posts

Re: The world's smallest self-replicating program

#51

I hang out on /r/dailyprogrammer sometimes - they had a challenge about these types of programs the other day and called them "quines." Check through some of these if you're interested, a few are 2 characters long (not sure how many bytes that is): http://www.reddit.com/r/dailyprogrammer/comments/2n11w8/2014...

2 characters is usually 2 bytes, unless they are using some weird unicode format, in which case it shouldn't be longer than 8 i think.

Re: The world's smallest self-replicating program

#53

Earlier quoted context omitted.

I'll be darned if I can find the URL to the story, but it is a brilliant application of giving the customer what they wanted. The short of it is that when you dropped back to the command line, early versions of DOS didn't clear the memory. That meant that the program really just went into stasis, but in practice it meant restarting; see, the program ran off the floppy then, so to save or load to another disk was tric…

Here you go: http://peetm.com/blog/?p=55

I wish I could edit my comment - it wasn't even MS-DOS! But, yep, that is the story. Hopefully I won't forget GO.COM in the future.

Thanks a mil for finding the link! I had a feeling I read the story from HN, and so it was:

https://news.ycombinator.com/item?id=5920732

Re: The world's smallest self-replicating program

#54
post #48
post #40

Earlier quoted context omitted.

That's pretty amazing. I'm guessing DNA compactness is a survival advantage for viruses, and that's how this emerged? Is gene overlap common in other species?

I would think the opposite may be true, given that compressed information tends to be more sensitive to error, than uncompressed.

Redundancy helps resistance to error, yeah. This thing could be quite easily damaged in transmission.

Re: The world's smallest self-replicating program

#55

Earlier quoted context omitted.

Correct. A file will only be considered a binary executable if it has a proper header (ELF, Mach-O, etc) The default if no header and no shebang is to treat it like a shell script. In fact, an empty executable file has been used to implement /bin/true on some old systems. Why take the added cost of a disk seek when just the information in the inode will do?

>In fact, an empty executable file has been used to implement /bin/true on some old systems. Why take the added cost of a disk seek when just the information in the inode will do? why is this only on old systems? it seems very efficient.

It's not as efficient as it seems, as that means the shell is invoked.

Re: The world's smallest self-replicating program

#56

Earlier quoted context omitted.

Correct. A file will only be considered a binary executable if it has a proper header (ELF, Mach-O, etc) The default if no header and no shebang is to treat it like a shell script. In fact, an empty executable file has been used to implement /bin/true on some old systems. Why take the added cost of a disk seek when just the information in the inode will do?

>In fact, an empty executable file has been used to implement /bin/true on some old systems. Why take the added cost of a disk seek when just the information in the inode will do? why is this only on old systems? it seems very efficient.

What's more efficient is that most shells don't bother running /bin/true at all. "true" is just a shell builtin, so it doesn't need to spawn a process just to get an obvious return value out of it.

Re: The world's smallest self-replicating program

#57

phiX174 virus - one of the world's smallest self-replicating programs :-) http://www.ncbi.nlm.nih.gov/nuccore/NC_001422.1 Enterobacteria phage phiX174 sensu lato, complete genome 5386 bp ss-DNA

Hehe funny that you mention phiX174 in the context of programming, that virus is amazing... Part of the reason phiX174 is so small is that it is "compressed" by having overlapping genes; in one area, three genes overlap in the same place! This is possible because there are 6 valid reading frames (direction and start point) for reading DNA: {forward or backward} x {address % 3 == 0, 1, or 2}. In college I actually got…

Why funny? biology is coding. 1,0 or A,T,G,C - all the same :-)

Get your genome compiler here: http://genomecompiler.com

Re: The world's smallest self-replicating program

#58
post #38
post #36

Earlier quoted context omitted.

yes, but is using an external program (make and cp) really count? I wouldn't consider that really as "self-replicating".

every self replicating entry in the competition is compiled with other binaries.

And most of biology (including you).

Re: The world's smallest self-replicating program

#60

Isn't this a quine, rather than a self-replicating program? A quine produces the source, and a self-replicating program should produce an executable - no? This seems to be a fallacy of equivocation.

If you run it, it will replicate itself...

  $ ./smr >smr.out
  $ diff smr smr.out
Post reply on HN