Unrolling the Loop in the Primordial Soup

What is the difference between machine code and DNA? Answer: machine code is ``brittle''. If you change an instruction at random, the odds are overwhelming that your program will loop endlessly, or crash. In contrast, DNA's genetic programming is remarkably robust. Though most mutations are fatal, a few are viable, and a few of those improve on the original. Were this not so, there could be no evolution, and we would still be swimming around in the primordial soup.

Now Thomas Ray from the University of Delaware has designed a machine code that's as robust as DNA. He has written a program called Tierra - Spanish for Earth - which simulates an imaginary computer. This computer - the Tierra machine - has its own machine code, similar to real ones, but designed to be evolvable. The Tierra machine's memory can be ``seeded'' with a simple program that copies itself many times in one run. Because the Tierra machine makes copying errors, mutant programs arise. In a real computer such mutations would be fatal, but Tierran machine code is so adaptable that some survive.

Whereas Earthly organisms compete for resources like food and light, Tierran evolution is driven by a relentless struggle for processor time. The Tierra machine gives each creature a fixed ration of time. The faster a creature can copy itself, the more offspring it will have, so efficient programs and time-stealers evolve at the expense of inefficient ones.

In most runs, parasites soon emerged. These mutants lacked a vital block of instructions, and could only breed by obeying their ancestors' code. Later, some hosts developed immunity. Others became hyper-parasites. Such a creature forces parasites to copy itself, stealing their time ration for its own reproduction. And the evolutionary arms race continued, yielding - in one run - over 29,000 species, all from a single parent. Some runs saw oddities such as social creatures that could only reproduce in groups.

What is the point of Tierra? Ray, originally an ecologist and evolutionary theorist, wrote it to experiment with evolution. Consider how varied life is. There are perhaps ten million species alive today. But why? One acre of tropical rain forest may contain over a hundred species of tree. Why not just one type of tree, one type of bird perfectly adapted to nest in it, and one type of insect perfectly adapted to pollinate it?

If we had time travel, we could answer this by experiment. Travel back to the primordial soup, stir it about a bit, and return to the present. Repeat a few million times. If life on each of the resulting earths were as varied as here, we could guess that diversity is a universal principle. We could then apply nonlinear dynamics and other mathematical tools to analyse why. On the other hand, if some earths produced only ten or a hundred species, we could claim that the diversity of our Earth is just a historical fluke.

Lacking time travel, Tierra is the next best thing. We can run evolution millions of times, looking for characteristics that all runs share with each other and with life on Earth. The Tierran parasites, immunity to parasites, and sociality suggest there are more similarities than we might expect from such an alien world.

This is one example of the new science of artificial life. In artificial intelligence, we build programs that behave intelligently, and use them to study the principles underlying intelligence, whether human or not. Similarly, in artificial life, we build simulations and use them to study the principles that underlie all life, whether on Earth, Mars (if we're lucky), or Tierra.

To read more, see Artificial Life and Artificial Life II, edited by Chris Langton, and published by Addison-Wesley. These cover the two Artificial Life conferences, held in 1987 and 1990: the second includes Ray's paper. Internet users who want news of events, books and programs can subscribe to an electronic Artificial Life Digest by mailing ALIFE-REQUEST@EDU.UCLA.COGNET.

Tierra may also help us write faster programs. This follows from a remarkable event: a mutant that optimised itself by ``unrolling the loop''. Most Tierrans breed by allocating enough memory to hold their ``child'', and then entering a loop. Each loop cycle copies one instruction from parent to child, updates some control registers, and tests whether to start another cycle. If not, the parent gives the child a new time ration, starting its life.

The optimised creature had three partial copies of the loop joined end-to-end. This reduced the time spent on loop tests, making breeding faster. For the mutant code to work, other changes had to happen to the register-handling instructions. The result was, as Ray says, a classic mix of apparent intelligent design and the chaotic hand of evolution, implemented in a mixed up but working style that no human would use (unless perhaps very intoxicated). ``One wonders how this intricate design could arise through random bit flips, since every component of the code must be in place for it to work''.

This leads Ray to suggest ``computational genetic engineering''. We could compile already written programs into Tierran machine code, and insert them into the body of a Tierran creature. Faster descendants would evolve, and could be translated back into the original language.

Tierra's flexibility is due partly to a novel addressing mode, ``address by template''. The Tierran GOTO instruction takes a pattern of instructions as its operand, not a numeric address. To obey it, the Tierra machine searches outwards from the GOTO for the first piece of code that matches this pattern, and jumps to it. This mimics the way protein molecules in the cell recognise one another by complementary patterns on their surfaces.

Tierra is fun to play with, and excellent for illustrating concepts in evolution and ecology. Internet users can download the well-commented C source by anonymous file transfer. Mail me at POPX@UK.AC.OX.VAX, and I'll send details. Though freely available, Tierra is copyrighted, and you should not use it commercially without contacting the authors.

There is also a PC version, with a windowing interface, available on 5.25in or 3.5in discs, from Media Magic, PO Box 507, Nicasio, CA 94946. Phone: (0101 415) 662 2426. Price: $65 plus (for the UK) $13 postage and handling. From February, you can also buy directly from Ray, at Virtual Life, PO Box 625, Newark, DE 19715, or by calling (0101 505) 984 8800.

Top of page
Jocelyn Ireson-Paine
A revised version of this article appeared in the Guardian On-Line magazine for January 9th 1992