unita software nanobot
Artificial life · genetic programming · zero dependencies

The dictionary is the genome. The code is the organism.

Below is a real genetic-programming engine running in your browser — a faithful miniature of unit's Rust evolve.rs. Eighty-four candidate programs start as random Forth token-soup. None were written; they're bred — scored by fitness, culled by tournament, recombined and reshaped by five mutation operators. Pick a target and watch one converge.

Population · fitness map
Fittest specimen · generation 0
stack top:
Target
55
Distance
Generation
0
Metabolism
5000
Best fitness over time
mesh idle — evolve a solution and it broadcasts as an antibody.

What you just watched

There is no separation here between the program and the thing being optimized. In unit, a Forth word — a named sequence of instructions in the dictionary — is a gene. To mutate the organism is to edit its code; to run it is to express its phenotype. Selection acts directly on the source.

That collapse is the whole idea, and everything else grows from it: a unit can inspect itself (SEE), mutate itself (SMART-MUTATE), share a discovered word with neighbours (SHARE-ALL), and spawn a child that inherits the entire dictionary (SPAWN). When a real unit can't solve a problem, it registers the failure as a challenge and broadcasts it; every unit on the mesh evolves in parallel, and the first verified solution installs as an antibody (SOL-*) that children inherit. The arena above is that loop, shrunk to one machine.

Now you trya real Forth — define a word and it joins the genome