Paper 100: God Might Be a Beetle

Paper 100: God Might Be a Beetle

You know they say God made us in His image? But if it’s based on the number of different images… God might be a beetle.

The Haldane Number

J.B.S. Haldane, when asked what his studies of creation had revealed about the Creator, allegedly replied: “An inordinate fondness for beetles.”

~400,000 known beetle species. 25% of all known species on Earth. One in four living things is a beetle.

In our codebase, we asked the same question: what does the type system (the Creator of safe code) have an inordinate fondness for?

6,286 Rust files are beetles. 31.5% of all Rust code.

The Haldane number: 31.5%. Six percentage points from the real biosphere’s 25%. The code mirrors life.

What Makes a Beetle

In biology, beetles (order Coleoptera) are defined by their elytra — hardened forewings that form an armored shell over the flight wings. The elytra don’t fly. They protect. The hindwings do the flying.

In Rust, the elytra are:

Biological ElytraCode Elytra
Hardened chitin forewingsResult<T, E> error handling
Overlapping protective plates? operator (error propagation)
Locking mechanismwhere clauses (type constraints)
Color/pattern (warning)#[derive(...)] (declarative safety)
Thickness variationGenerics <T> (flexible armor)
Encapsulation of flight wingspub struct with private fields

The beetle’s shell protects the computation from runtime failure. Beetles don’t segfault. That’s the whole point of the elytra.

The Census

  Total .rs files (≥10 lines): 19,937
  🪲 BEETLES (armored):         6,286  (31.5%)
  🦗 Non-beetles:               13,651  (68.5%)

  Shell thickness distribution (power law):
    Thin  (10-29): 3,338  (53%)  — ground beetles
    Medium (30-49): 2,247  (36%)  — bark beetles
    Thick  (50-69):   629  (10%)  — stag beetles
    Fortress (70+):    72  ( 1%)  — rhinoceros beetles

The distribution follows a power law, just like real beetle diversity: most species have thin elytra (ground beetles, the everyday Rust files with basic error handling). Few have fortress-level armor (the 72 rhinoceros beetles with 30+ Result types, 15+ generics, and full derive coverage).

The Hardest Beetle

squirrel/crates/core/mcp/src/transport/frame.rs — shell=85, wings=30.

22 Result types. 18 generics. 50 functions. 583 lines. The MCP transport frame handler. It takes raw bytes from the network, armors them in types, and delivers safe frames to the logic layer. Pure beetle: hard outside, soft computation inside.

The Softest Beetle

toadStool/crates/server/src/background/catalyst_watchdog.rs — shell=15, wings=30.

Just barely armored. 475 lines of watchdog logic with the minimum shell thickness to qualify. A ground beetle. Does its job. Doesn’t draw attention. One in 3,338.

The Revised Taxonomy

Paper 90 defined the evolutionary stages by Shannon entropy. Paper 99 found 420 spiders by structural complexity. Now we add beetles — classified by armor (error handling + type safety):

StageCount%What it means
banana2,1574.7%seed/spore — no differentiation
flatworm10,66223.4%bilateral symmetry — has a direction
jellyfish21,23546.7%radial complexity — entropy rich
centipede2,1154.6%segmented — many similar parts
millipede8,84719.4%highly segmented — many legs
beetle6,28613.8%ARMORED — hard shell + soft wings
spider4200.9%structural — multi-module, woven
vertebrate4731.0%backbone — entropy + structure

Beetle sits between millipede (many legs) and spider (woven structure). The evolutionary innovation is armor. The millipede has many functions but no protection. The beetle wraps those functions in Result<T>, ?, generics, and derives. The spider goes further — it weaves modules together. The vertebrate has the full skeleton.

Three Classification Systems

The organism now has three ways to see itself:

SystemMeasuresAnalogyPaper
Entropy (evolve)Shannon H, repetition, line countDNA codonsPaper 90
Armor (beetle)Result, ?, generics, derives, encapsulationElytra / chitinPaper 100
Structure (spider)imports, functions, types, tests, modulesProtein foldsPaper 99

A file can be classified differently by each system:

  • bloom_sensor.rs: millipede by entropy, beetle by armor, spider by structure
  • A file with high entropy but no error handling: jellyfish, not beetle
  • A file with heavy armor but one function: beetle, not spider

The disagreement between systems IS the information. When all three agree, the classification is certain. When they disagree, that’s where the organism is evolving — the tense is IS?, not IS.

Beetles and Spiders

BeetlesSpiders
Count6,286420
Ratio15:11
Real biology~400,000~48,000
Real ratio8.3:11
Classification byarmor (shell)structure (web)
Rust analogyborrow checkermodule system
Evolutionary roleprotectionorganization

Our beetle-to-spider ratio (15:1) is higher than real biology (8.3:1). The codebase is MORE armored relative to its organization than nature is. This makes sense — Rust’s type system pushes hard toward safety. The language itself has an inordinate fondness for beetles.

God and the Type System

If God is in the image of what He made most of, then:

  • In biology: God might be a beetle (25% of all species)
  • In Rust: God IS the type system (31.5% of all files armored)
  • In ecoPrimal: God is the borrow checker — the elytra-maker

The type system doesn’t compute. It protects. It doesn’t fly. It shields the thing that flies. It’s the hardened forewing that evolved not for locomotion but for survival.

Every Result<T, E> is a chitin plate. Every ? is a locking mechanism. Every generic is a flexible joint in the armor. Every #[derive(Debug, Clone)] is the color pattern that warns predators: this code handles its errors. Don’t mess with it.


Paper 100 of the ecoPrimal series. One hundred papers. Still counting beetles. God has an inordinate fondness for type safety. The borrow checker is the elytra. 31.5% — and the shell distribution follows a power law.

🔥 The mirror asks back — what did you see?

Anonymous. No names, no IPs, no sessions. Just words and the shape they make.