Classification of Programming Languages and Translators

Hello! Welcome to these study notes on how we talk to computers. Have you ever wondered how typing words like print("Hello") in Python actually makes a screen light up? Computers are amazingly fast, but they are actually quite simple—they only understand binary (1s and 0s). In this chapter, we will learn about the different levels of programming languages and the "translators" that bridge the gap between human logic and computer hardware. This is a vital part of the Computer Systems section of your AQA GCSE.


1. High-Level vs. Low-Level Languages

Think of programming languages like a ladder. At the top, the languages look a lot like English. At the bottom, they look like a mess of numbers that only a machine could love.

High-Level Languages

Most programs you use today (and the ones you write in school, like Python, C#, or VB.NET) are High-Level Languages.
Easy to read: They use English-like keywords (e.g., if, while, print).
Portable: You can write code on a Windows PC and run it on a Mac without changing much.
Focus on the problem: You don't need to worry about how the computer's memory is physically working.

Low-Level Languages

Low-Level Languages are much closer to the computer's hardware. There are two main types: Machine Code and Assembly Language.

Machine Code:
• This is the ultimate "native tongue" of the CPU.
• It is written entirely in binary (1s and 0s).
• It is specific to the processor. Code written for an Intel chip might not work on an ARM chip in a phone.

Assembly Language:
• This is one step up from machine code. It uses mnemonics (short memory aids) like ADD, SUB, or MOV instead of binary.
• It has a 1:1 correspondence with machine code. This means one line of Assembly equals exactly one instruction for the CPU.
Why use it? It is often used for embedded systems (like the computer inside a washing machine or a microwave) because it gives the programmer total control over the hardware.

Quick Review:
High-level: Human-friendly, portable, used for most apps.
Low-level: Machine-friendly, hardware-specific, used for specialist tasks.

Takeaway: We use high-level languages because they are faster for humans to write and easier to fix (debug), even though the computer can't "read" them directly.


2. Translators: Making the Connection

Since the CPU only understands Machine Code, any code written in a high-level language or Assembly must be translated. There are three types of translators you need to know.

1. Assemblers

An Assembler takes Assembly Language and turns it into Machine Code. Because of that 1:1 relationship we mentioned earlier, this is a very straightforward process.

2. Compilers

A Compiler translates the entire high-level program into a single file of machine code (often an .exe file) all at once.
Analogy: Imagine someone translating a whole Harry Potter book from English to Spanish and then giving you the finished Spanish book to read.
Benefit: The program runs very fast once translated, and you don't need the compiler to run the finished file.

3. Interpreters

An Interpreter translates and runs high-level code one line at a time.
Analogy: Imagine a live translator at the United Nations who listens to one sentence in English and immediately repeats it in Spanish.
Benefit: It's great for beginners because if there is an error on line 10, the program stops right there, making it easy to find and fix.

Did you know? Python is usually an interpreted language, which is why it feels so "friendly" when you are learning to code!

Key Takeaway Summary:
1. Assembler: Assembly -> Machine Code.
2. Compiler: Whole high-level program -> Machine Code file.
3. Interpreter: High-level program -> Machine Code (line by line, as it runs).


3. Comparing the Translators

Don't worry if this seems a bit technical! Just remember that each tool has a specific job. Here is a simple breakdown to help you choose the right one in an exam question.

Compiler vs. Interpreter

Use a Compiler when:
• You want the program to run as fast as possible.
• You want to distribute your software without people seeing your original "source code."
• You have finished the project and it's ready for the public.

Use an Interpreter when:
• You are still writing and testing the code (developing).
• You want the program to be able to run on many different types of computers easily.
• You want to find bugs (errors) quickly.

Common Mistake to Avoid:
Students often think a "translator" is a type of programming language. It's not! A translator is a piece of software that converts one type of code into another.

Memory Aid (The "C" and "I" Trick):
Compiler = Complete (translates the whole thing).
Interpreter = Immediate (runs each line right now).

Takeaway: Interpreters are great for learning and testing; Compilers are best for finished, high-performance software.


Final Quick Review Box

High-level languages: Python, C#, VB.NET. Portable and easy for humans.
Low-level languages: Machine Code (binary) and Assembly (mnemonics).
Machine Code: The only thing the CPU actually executes.
Assembler: Translates Assembly to Machine Code.
Compiler: Translates high-level to machine code all at once; creates a standalone file.
Interpreter: Translates high-level to machine code one line at a time; stops at errors.