We present grammatical evolution, an evolutionary algorithm that can evolve
complete programs in an arbitrary language using a variable-length binary
string. The binary genome determines which production rules in a Backus-Nau
r form grammar definition are used in a genotype-to-phenotype mapping proce
ss to a program. We demonstrate how expressions and programs of arbitrary c
omplexity may be evolved and compare its performance to genetic programming
.