Quines

:quine: /kwi:n/ /n./ [from the name of the logician Willard van Orman Quine, via Douglas Hofstadter] A program that generates a copy of its own source text as its complete output. Devising the shortest possible quine in some given programming language is a common hackish amusement.

<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”&gt;
<xsl:output method=”xml” encoding=”utf-8″ />
<xsl:variable name=”s”></xsl:variable>
<xsl:template match=”/”>
<xsl:value-of select=”substring($s,1,148)” disable-output-escaping=”yes” />
<xsl:value-of select=”$s” />
<xsl:value-of select=”substring($s,149)” disable-output-escaping=”yes” />
</xsl:template>
</xsl:stylesheet>

quite amusing, yet ultimately boring as it always reconstructs only itself. it would be cool to add in some mutation, but apparently the problem is not so easy to solve:

It may be that the problem is not amenable to being solved by evolutionary methods. There may be too many local maxima, which give fair to middling scores, but no good way to step from a local maximum to the global maximum without ever getting a lower score.
It may be that the randomprog and mutate functions produced too many offspring with syntax errors or other obvious problems, so that it would have taken longer to generate an optimum solution that I had patience.

JohnnyVon, being rooted more firmly in the (simulated) world of physics and biology, might fare better.


JohnnyVon is an implementation of self-replicating machines in continuous 2D space. 2 types of particles drift about in a virtual liquid. The particles are automata with discrete internal states but continuous external relationships. Their internal states are governed by finite state machines but their external relationships are governed by a simulated physics that includes Brownian motion, viscosity, and spring-like attractive and repulsive forces. The particles can be assembled into patterns that can encode arbitrary strings of bits. We demonstrate that, if an arbitrary “seed” pattern is put in a “soup” of separate individual particles, the pattern will replicate by assembling the individual particles into copies of itself. We also show that, given sufficient time, a soup of separate individual particles will eventually spontaneously form self-replicating patterns. We discuss the implications of JohnnyVon for research in nanotechnology, theoretical biology, and artificial life.

Leave a comment