Foundations: What a Computer Is

layers of abstraction

When you drive a car, you turn a wheel and press pedals; you do not think about pistons firing or fuel injectors timing. Each layer hides the messy details of the one below and offers you a simpler handle. Computers are built as a tall stack of such layers, and learning to work at one layer without drowning in the others is the single most important survival skill in this whole field.

From top to bottom the stack runs roughly: the application you use, written in a high-level language like Python or C, which a compiler translates into assembly language, which an assembler turns into machine code (raw bits) defined by the ISA. The ISA is the contract the hardware honours. Below it the microarchitecture implements that contract using logic gates, which are themselves built from transistors — tiny electronic switches. Each level offers a clean interface to the one above and hides how it works inside.

Abstraction is what makes computers humanly possible to build and reason about. A web programmer need not understand transistors; a chip designer need not read your web app. Each can focus on their own layer trusting the interface below. The honest caveat is that abstractions leak: a layer's hidden details sometimes bleed through and bite you — cache behaviour you cannot see can make code mysteriously slow, and good engineers know when to peek one level down.

A single line like total = total + price climbs the whole stack: high-level language, then assembly add, then machine-code bits, executed by the microarchitecture, run on gates, switched by transistors. Each layer translated for the next.

One statement, many layers, each hiding the one below.

Abstractions are powerful but not perfect — they leak. Performance, in particular, is where lower layers (caches, branch prediction) show through, which is exactly why architecture is worth learning.

Also called
levels of abstractionthe abstraction stack抽象階層