Part 1·1.2·12 min read

The Molecules of Life

Four classes of macromolecules — nucleic acids, proteins, carbohydrates, and lipids — form the type system of biology.

biochemistrymacromoleculesfoundations

Every programming language has a type system. Some are strict, some are loose, but they all define what kinds of data exist and what operations can be performed on each. Biology has the same thing — and it's been running without type errors for billions of years.

The uses four classes of large molecules, called macromolecules, to build itself, store information, generate energy, and transmit signals. Each class has a distinct structure, a distinct set of operations, and a distinct role in the system. Understanding them is like reading the type definitions before you the code.

The Monomer-Polymer Pattern

Before we look at each class, there's a universal design pattern you need to recognize: monomers and polymers.

Biology builds large molecules the same way you build strings from characters:

  • A monomer is the unit — a small molecule with defined chemical properties
  • A polymer is a chain of monomers linked together — a macromolecule with emergent properties

The sequence of monomers in a polymer encodes information and determines function. This is exactly like a string (array of chars), or a linked list of typed nodes, or a sequence of instructions in bytecode. The type of monomer, and its order, determines everything.

char → string → data structure
monomer → polymer → macromolecule → functional system

build polymers by forming covalent bonds between monomers — a process that requires energy (ATP). They break polymers by adding water (hydrolysis). The has dedicated machinery for building and destroying each class of polymer. Think of it as a typed allocator/deallocator for each data type.

Nucleic Acids: The Source Code

and are nucleic acids — polymers made of .

Each has three components:

  1. A sugar (deoxyribose in , ribose in )
  2. A phosphate group (provides the backbone linkage)
  3. A nitrogenous (carries the information)

The are the alphabet. uses four: A (adenine), T (thymine), G (guanine), C (cytosine). replaces T with U (uracil). That's it — a 4-letter alphabet for all of life's information storage.

is double-stranded: two complementary strands wind around each other in the famous double helix. The pair by hydrogen bonding: A always pairs with T (2 bonds), and G always pairs with C (3 bonds). This -pairing rule is what makes replication possible — each strand serves as a template for copying the other.

{ }DNA as a Version-Controlled Source File

Think of as a version-controlled source file written in a 4-character alphabet. The double-stranded structure is like keeping both the file and its exact checksum — if one strand is damaged, the other serves as a recovery template.

Each is a separate source file. The human has 23 pairs of — 46 files in total — totaling about 3.2 billion pairs. That's roughly 750 MB of data if you encoded it naively as ASCII (2 bits per × 3.2 billion ≈ 800 MB). The stores this in a nucleus about 6 μm wide.

is single-stranded and shorter-lived. It's the working copy from , used temporarily, then degraded. Different types of serve different roles: carries the message to ribosomes, tRNA brings the right during , rRNA is part of the ribosome itself. We'll cover this in depth in Part 2.

Proteins: The Executables

If is source code, are the compiled executables. They do almost everything in the : catalyze reactions, provide structure, transmit signals, regulate , transport molecules across membranes, and defend against pathogens.

are polymers of . There are 20 canonical , each with a different side chain that gives it distinct chemical properties: some are charged, some are hydrophobic, some can form special bonds. The ribosome chains them together in a sequence specified by an molecule.

The critical insight: sequence determines structure, and structure determines function.

A folds into a precise 3D shape — driven by thermodynamics, as the molecule seeks its lowest energy state. The shape creates specific surfaces and pockets that allow the to bind to other molecules with high specificity. use this to catalyze reactions; use it to detect signals; structural use it to form scaffolds.

{ }Proteins as Compiled Executables with Runtime Shapes

Imagine writing a program where the source code ( sequence) gets compiled into a binary (folded 3D structure), and the binary's shape determines what APIs it can call and what data it can bind.

A 's "active site" is literally a shaped socket — a pocket engineered by millions of years of evolution to bind a specific molecule (the substrate) with near-perfect precision. This is like a hardware interface: the shape and charge distribution must match for the connection to work.

The field of structure prediction (think AlphaFold) is essentially the problem of inferring the compiled binary's 3D shape directly from the source code, without running it.

20 amino acids × sequence length = enormous diversity

A 300 long can take 20^300 possible sequences — a number so large it dwarfs the number of atoms in the observable universe. Evolution has found functional solutions in this space by incremental search. Most of that space is non-functional noise, but the viable region is rich and diverse enough to produce all the molecular machinery of life.

Carbohydrates: Energy Storage and Signaling Tags

Carbohydrates are polymers of sugars (monosaccharides). Glucose is the most important monomer — it's the primary fuel the burns for ATP production.

As polymers:

  • Glycogen (in animals) and starch (in plants) are branched glucose polymers used for energy storage — think of them as a cache of pre-built ATP precursors
  • Cellulose and chitin are structural polysaccharides — used to build walls in plants and fungi

Beyond energy, carbohydrates serve a crucial signaling role: glycosylation. Many and lipids have sugar chains attached to them on the surface. These glycan chains act like barcodes — they label by type, provide immune system recognition signals, and mediate -to- communication.

If you've ever heard of blood types (A, B, AB, O), those are defined by which sugar modifications are present on red blood surface . Your immune system these tags to decide if a is "self" or "foreign."

Lipids: Membranes, Energy Reserves, and Signals

Lipids are not polymers in the same sense — they're a diverse group defined by their shared property: hydrophobicity (they don't dissolve in water).

The most important lipids for biology are phospholipids — the primary building block of membranes. A phospholipid has:

  • A hydrophilic head (phosphate group, loves water)
  • Two hydrophobic tails (fatty acid chains, avoid water)

This amphipathic structure (both water-loving and water-fearing in the same molecule) causes phospholipids to spontaneously self-assemble into bilayers in water. You don't have to build the — thermodynamics builds it for you. We'll go deep on this in Chapter 1.3.

Other important lipids include:

  • Triglycerides — long-term energy storage (fat). More energy-dense than carbohydrates — ~9 kcal/g vs ~4 kcal/g
  • Steroids (like cholesterol) — fluidity regulators and precursors for signaling molecules like hormones
  • Signaling lipids — second messengers like diacylglycerol (DAG) and phosphatidylinositol derivatives that propagate signals inside the

The Chemistry That Holds It All Together

Two types of chemical bonds define how molecules interact in biology:

Covalent bonds are strong (~200–400 kJ/mol). They form the backbone of all macromolecules. Breaking them requires or harsh conditions. Think of them as persistent storage: the data survives environmental fluctuations.

Non-covalent bonds are weak individually (~1–5 kJ/mol each): hydrogen bonds, ionic interactions, van der Waals forces, hydrophobic interactions. But molecules can have dozens or hundreds of non-covalent interactions simultaneously, making the combined effect highly specific and substantial.

The magic of non-covalent interactions is their reversibility. Two can bind tightly enough to function together, then release each other without damage. This is how all molecular recognition works — binding substrates, binding , binding . It's the biological equivalent of mutable state: specific, temporary binding that can be switched on or off.

{ }Bond Types as Storage Classes

Covalent bonds are like data written to disk — persistent, high-energy to write and erase, stable across conditions.

Non-covalent bonds are like data in RAM — fast to set and unset, reversible, context-dependent. The uses non-covalent interactions for all its "" and "runtime state" — binding events that need to happen quickly, reversibly, and in response to conditions.

This is why can act as switches, sensors, and regulators: their shape changes in response to non-covalent binding events, propagating information through the system without permanently altering the molecular structure.

ATP: The Energy Token

One molecule deserves special mention: ATP (adenosine triphosphate). It's not one of the four macromolecule classes, but it's the energy currency that powers nearly everything in the .

ATP has three phosphate groups in a row. The bond between the second and third phosphate is high-energy. Hydrolyzing it (breaking it with water) releases ~30 kJ/mol and produces ADP (adenosine diphosphate). The then regenerates ATP from ADP using the energy from food oxidation.

ATP as rate-limiting token

Think of ATP as a rate-limiting token in a distributed system. Every process that costs energy — building a , transporting an ion, moving a motor — requires spending ATP tokens. The 's rate of metabolism is literally the rate at which it can regenerate ATP.

A typical human consumes and regenerates its entire ATP pool every 1–2 minutes at rest. Under intense exercise, can cycle through ATP even faster. The mitochondria are running a continuous token-regeneration loop.

The Type System of Life

Stepping back: the four macromolecules form a coherent type system.

  • Nucleic acids are the -only store of heritable information
  • are the active executors of cellular functions
  • Carbohydrates are the energy reserves and identity labels
  • Lipids are the architectural substrate and the chemical messengers

These four types interact through specific, defined interfaces. is by (polymerases). is by - complexes (ribosomes). recognize lipid components through specific domains. The whole system is typed and interfaces are explicit.

When a changes a sequence, it can change the sequence, which changes the shape, which changes which other molecules it can bind, which changes behavior. This is a type error propagating through the system — and depending on where it happens and what it changes, the consequences range from silent (synonymous ) to catastrophic (loss of a tumor suppressor).

Understanding the molecules is understanding the type system. Once you have that, the code starts to make sense.

DECODER
Biology

The four classes of biomolecules — nucleic acids, proteins, lipids, and carbohydrates — are the building materials of all living systems. Each class has a distinct structure that dictates its function.

{ } For Developers

Four data types, each with a different use: DNA/RNA are storage (strings), proteins are executable code (functions and structures), lipids are infrastructure (membranes, insulation), carbohydrates are fuel and cache (energy storage, signaling). The whole system runs on four types.