Who can do genetic programming with Python

Erik Max Francis max at alcyone.com
Wed Nov 21 20:41:25 CET 2001

"J.Jacob" wrote:

> Does anyone have code that produces correct but random Python code ?
> This would be useful for a genetic programming (GP) test we want to
> do.

Python is not a very good choice for genetic programming.  Its syntax is
too complicated, especially if we take into account that it is
indentation sensitive.

This is why languages such as LISP are used for genetic programming;
their syntax is simple and it's easy to verify if a program is legal or
not and to keep it legal while performing genetic operations (mutation,
crossover, etc.).

I myself in the past have used stack-based languages which are promising
since even the constraint on program legality is dropped, provided you
make certain concessions such as allowing a bottomless operand stack,
having the key variables of the simulation available by means of special
operators, etc.  With a suitable choice for environment, every sequence
of legal operators is itself a legal program.

 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.

More information about the Python-list mailing list