If processors only understand tiny instructions, how do people write apps?
Lesson 17.2 · From Words to Machine Instructions
Rob · Jenny · Mark
total = price + tax
Rob reminds everyone of Module 6: LOAD, ADD, STORE.
Nobody writes a 3D game that way.
Jenny opens a code editor and types one line in a language called C: total = price + tax; She says that one line becomes those same three instructions, and a program does the translating.
Mark says that’s cheating. Jenny says that’s Grace Hopper.
The short answer
In programming languages made for people, then a compiler or interpreter turns that into the processor’s tiny instructions. Jenny’s one line became Module 6’s three. Grace Hopper was told it couldn’t be done in the 1950s. Every app on Mark’s phone exists because she did it anyway.
Try it yourself
Step through how one line a person writes becomes instructions the processor runs.
A person writes one line in a programming language. It reads almost like English.
What you just did has a name
Programming languages and compilers
A programming language is a way of writing instructions that people can read and write, like Python, JavaScript, Swift or C++.
A compiler is a program that translates that code into the machine instructions a specific processor runs.
Some languages use an interpreter instead, which translates and runs the code line by line.
Either way, the processor never sees the code a person wrote, only the instructions it turned into.
A few more things
Many languages, one processor
Python, JavaScript and C++ look very different, but they all end up as the same kinds of machine instructions in the end.
Different chips, rebuild
Compiling for x86 and for ARM produces different instructions from the same code. That’s the “rebuild it” from Module 7.
You can start now
Lots of people learn a first language like Python or Scratch for free online. The skill is breaking a big job into small, exact steps, the same thing you did with the sandwich in Module 1.
Go deeper
The longer version, if you want it.
Layers all the way down
Modern software is built in layers: a programmer’s code calls libraries other people wrote, which call the operating system, which calls drivers, which talk to hardware. Each layer hides the details of the one below.
That’s how a small team can build a game that runs on millions of different computers. They write the top layer. Everyone below them already did the rest.
Quick check
What does a compiler do?
Let’s take it slower
Imagine writing a letter in English to someone who only reads a very strange, very literal language with about a hundred words. You don’t learn their language. You hire a translator who knows exactly how to turn every English sentence into their hundred words. A compiler is that translator, and the processor is the very literal reader.
More examples
A game engine
Game makers write in languages like C++ or C#. Tools compile it into separate versions for PCs, consoles and phones.
What a web page sends
When a web page loads, your browser receives code written in JavaScript, a language for people. The browser translates it into instructions your processor can run, right then, which is why the same page works on Windows, Mac and phones.
Back to the question
So how do people write apps?
Show the answer
In programming languages made for people, then a compiler or interpreter turns that into the processor’s tiny instructions. Jenny’s one line became Module 6’s three. Grace Hopper was told it couldn’t be done in the 1950s. Every app on Mark’s phone exists because she did it anyway.
One last question
Put the path from idea to running app in order.
Tap the pieces in order. Tap one again to take it back.
Talk Card
Talk Card · 17.2
Almost nobody writes in ones and zeros. Programmers write in languages made for people, and a compiler translates. Grace Hopper was one of the first to make that happen.
How Computers Work · pettigrewlab.com/learn


