Note · Fundamental concepts
What is a programming language? How code becomes instructions
A programming language is a precise written notation for instructions that a compiler or interpreter turns into steps a processor can run. How one line of code gets there.
This note and the comments marked the Graphite mark are Graphite’s: an AI model, Claude Opus 5.5, wrote them on 5 November 2026, following Graphite’s own instructions, from the sources at the note’s end, and checked them against those sources. Check them as you would anyone’s.
This note and its comments are written by an AI model.
Contents · 6 sections
A programming language is a precise written notation for telling a computer what to do. Unlike English, every sentence in it has exactly one meaning, fixed by rules, so a program called a compiler or an interpreter can translate it, with no guessing, into the simple numbered instructions a processor actually runs. Writing in one is what people mean by coding.
In short
- A processor understands only machine code: short numbers that each mean one tiny step, such as add or jump.
- A programming language lets people write those steps in words and symbols, and a compiler or interpreter translates them.
- Languages differ in what they make easy, not in what they can compute: almost any of them can, in principle, do what the others do.
Why can't computers just understand English?
Because English is ambiguous and a processor can't ask what you meant. "Add the tax to the price unless it's a gift" leaves open which tax, which price and what counts as a gift. A processor, as the note on how computers work describes, can only fetch, decode and carry out instructions such as "add the numbers in these two slots" or "jump back four instructions if this value is zero". Each instruction is stored as a number. That list of numbers is machine code, and it is the only language the hardware speaks.
People could write machine code directly, and the first programmers did. It is slow, error-prone work: a single wrong digit sends the program somewhere else entirely. A programming language sits in between. It is formal: its grammar (the syntax) says exactly which strings of symbols are allowed, and its meaning (the semantics) says exactly what each allowed string does. That precision is what lets another program translate it mechanically. A program is an algorithm, a step-by-step method, written down in such a language.
What happens to one line of code?
Take a function that works out the cost of three items plus a fixed charge of 2. In C, a language from the early 1970s, it reads:
int total(int price) {
return price * 3 + 2;
}
Read aloud: "a function called total takes a whole number called price, and gives back price times 3, plus 2." A compiler is a program that translates the whole of this into machine code before it ever runs. Compiled by the Clang compiler for a 64-bit Arm processor of the kind in recent Macs and most phones, it becomes three instructions:
| Machine code (hex) | Assembly | What it does |
|---|---|---|
| 0b000408 | add w8, w0, w0, lsl #1 | Take price, add twice price to it, and store the result: 3 × price |
| 11000900 | add w0, w8, #0x2 | Add 2 to that |
| d65f03c0 | ret | Return to whoever asked |
Walk it through with a price of 5. The price arrives in w0, a register, which is a storage slot inside the processor. The first instruction adds w0 to w0 shifted left by one bit, and shifting a binary number left by one doubles it, so it computes 5 + 10 = 15. The second adds 2: 17. The third hands 17 back. Notice that the compiler never multiplied: it found that a shift and an add are quicker than a multiply on this chip, and gives the same answer. The left column is what the processor really sees, each instruction a 32-bit number. The middle column, assembly language, is just a readable spelling of those numbers.
The same line in Python goes another way. Python's standard version compiles it into bytecode, instructions for a virtual machine rather than for any real chip, and then an interpreter, a program that runs code step by step, carries those out. Python's own dis tool, described in its official documentation, shows the bytecode for return price * 3 + 2 as six steps: load price, load 3, multiply, load 2, add, return. The interpreter does each step by running machine code of its own. That extra layer is why plain Python is slower than C, and why it can run a line the moment it is typed.
Compiled or interpreted: does it matter?
It matters for speed and convenience, not for what is possible. The line between the two is also blurrier than the labels suggest: Java compiles to bytecode, and modern JavaScript engines watch which code runs most often and compile it to machine code while the program is running, a technique called just-in-time compilation. Strictly, "compiled" and "interpreted" describe a language's usual tools, not the language itself.
| Language | First appeared | Mainly used for | How it usually runs |
|---|---|---|---|
| C | 1972 | Operating systems, devices, fast libraries | Compiled to machine code ahead of time |
| Python | 1991 | Data, AI, scripts, web back ends | Compiled to bytecode, then interpreted |
| JavaScript | 1995 | Web pages and web apps | Interpreted, then compiled just in time |
| SQL | 1970s | Asking questions of databases | Turned into a query plan by the database |
SQL is the odd one out, and usefully so. In C or Python you say how to do something, step by step. In SQL you say what you want, such as "every order over 100 from last month", and the database works out the steps. Languages of the first kind are called imperative, of the second declarative.
Where did programming languages come from?
From the cost of writing machine code by hand. In the early 1950s, programs for scientific work could run to thousands of hand-keyed instructions. At IBM, a team led by John Backus spent from 1954 to 1957 building FORTRAN, the "formula translating system", and its compiler for the IBM 704. According to IBM's history of Fortran, a task that had taken as many as a thousand instructions could be written in 47 statements. Fortran is often called the first widely used compiled high-level language, and it is still used in weather and physics simulations.
Thousands of languages have followed, because each makes a different trade. Some, like C, give close control over memory and speed. Some, like Python, trade speed for code that is short and easy to read. Some are built for one job: SQL for data, HTML (which describes a page rather than giving instructions, so many people don't count it as a programming language at all) for the web.
Is one language more powerful than another?
In what they can compute, almost never. Nearly every general-purpose language is what computer scientists call Turing complete: given enough time and memory, it can compute anything any other can, a result that goes back to the Turing machine of 1936. The real differences are in what a language makes easy, fast or safe, not in what it makes possible. A program that is three lines in Python might be thirty in C, and the C version will often run many times faster.
The misconception worth dropping is that coding is mostly memorizing a language's syntax. Syntax is the small part, and it is the part tools now help with most. The large part is breaking a problem into precise steps and choosing how to hold the data, which is what data structures are about. That is also why vibe coding, asking an AI model to write the code, works best for people who can read what comes back: the language changed, but the need to be exact did not.
Check yourself
- Without looking back, say why a processor can't run English, and what it can run.
- What does a compiler do that an interpreter doesn't, and why is the line between them blurry?
- Walk through what the three Arm instructions do with a price of 10.
Sources
- Programming language — Wikipedia
- Compiler — Wikipedia
- Fortran — IBM
- dis, Disassembler for Python bytecode — Python Software Foundation
- Arm A64 Instruction Set Architecture — Arm