Programming Language Levels: From Machine Code to SQL
Every programming language sits somewhere between the binary a processor runs and a plain description of the result you want. Here are the levels, with the same task written at each one.
Every programming language sits somewhere between two extremes: the raw binary instructions a processor executes, and a plain description of the result you want. Where a language sits is its level of abstraction. It decides how much the language does for you, how much control you keep, and how fast the finished program runs.
The levels at a glance
Most textbooks split languages into low-level and high-level, with a middle level for languages like C that sit in between. A finer split uses the five “generations” of programming languages, abbreviated 1GL to 5GL:
| Level | Generation | Examples | What you write |
|---|---|---|---|
| Machine code | 1GL | x86-64 or ARM instructions in binary | The exact instructions the processor runs |
| Assembly | 2GL | x86-64 assembly, ARM assembly | Readable names for those same instructions |
| Middle level | 3GL | C, C++, Rust | Portable code with direct control of memory |
| High level | 3GL | Java, C#, Go, JavaScript, Python | Program logic; the language manages memory and hardware |
| Declarative | 4GL and 5GL | SQL, Prolog | The result you want, not the steps to get it |
What “level” actually means
A language’s level measures how far it sits from the hardware. In a low-level language, each line maps to one processor instruction or a handful of them, and you manage registers and memory yourself. In a high-level language, one line can expand into hundreds of instructions, and the language handles memory, data types and the operating system for you.
Higher isn’t better or worse. It’s a trade:
- Higher level: faster to write, easier to read, and portable across machines, but harder to tune for raw performance.
- Lower level: full control over memory and hardware and often faster, but slower to write and easier to get wrong.
That’s why operating systems, game engines and device drivers are still written in C, C++ and Rust, while most web apps, data analysis and automation scripts use Python, JavaScript or Java.
The same task at every level
The quickest way to feel the difference is to see similar work written at each level.
Machine code
This is what the processor actually runs. These five bytes, written in hexadecimal, tell an x86-64 processor to put the number 2 in a register called eax. The next three bytes add 3 to it:
B8 02 00 00 00
83 C0 03
Hexadecimal is only a compact way to write the binary; the processor sees 10111000 00000010 and so on. It isn’t a separate level. Machine code is specific to a processor family, so x86 code won’t run on an ARM chip like the ones in Apple’s M-series Macs and most phones.
Assembly
Assembly gives each instruction a readable name. A program called an assembler translates it, almost line for line, into the bytes above:
mov eax, 2 ; put 2 in the eax register
add eax, 3 ; eax now holds 5
Like machine code, assembly is tied to one processor family. Kathleen Booth is credited with creating the first assembly language in 1947. Today it’s used for performance-critical routines, embedded systems, compilers and reverse engineering, and most CS students meet it in a computer organization or architecture class.
C, the middle level
C adds variables, loops and functions, and the same source code compiles for almost any processor. You still work with memory directly, though. Summing an array looks like this:
int sum = 0;
for (int i = 0; i < n; i++) {
sum += nums[i];
}
Dennis Ritchie created C at Bell Labs in 1972, and at the time it was a high-level language. Next to Python or Java it looks close to the hardware, so it’s often called middle-level today. Pointers and manual memory management give you control, along with bugs like buffer overflows. C++ and Rust sit in the same band; Rust adds compile-time checks that rule out many of those memory bugs.
Java
Java manages memory for you with a garbage collector and runs on a virtual machine, so the same compiled program runs on Windows, macOS and Linux. Summing an array takes one line:
int sum = Arrays.stream(nums).sum();
Python
Python goes further: no type declarations, no compile step for you to run, and a large standard library.
total = sum(nums)
SQL and Prolog, the declarative level
In SQL you don’t describe the steps at all. You state the result, and the database works out how to compute it:
SELECT SUM(amount) FROM orders;
Prolog works the same way with logic. You give it facts and rules, then ask it questions:
parent(tom, bob).
parent(bob, ann).
grandparent(X, Z) :- parent(X, Y), parent(Y, Z).
?- grandparent(tom, ann).
true.
Nowhere did you tell Prolog how to search for the answer. That’s why declarative languages usually sit at the top of the ladder.
How high-level code reaches the processor
The processor only understands machine code, so every level above it needs translating. There are three common approaches:
- Compiled ahead of time. A compiler turns the whole program into machine code before it runs. C, C++, Rust and Go work this way, which is a big part of why they’re fast.
- Interpreted. An interpreter reads the program and carries it out step by step. Early BASIC and shell scripts are classic examples.
- Bytecode on a virtual machine. The code is compiled to an intermediate bytecode, which a virtual machine runs. The busiest parts are often compiled to machine code while the program runs, called just-in-time or JIT compilation. Java, C# and JavaScript engines like Chrome’s V8 work this way.
Strictly, “compiled” and “interpreted” describe implementations, not languages, and most modern languages mix the approaches.
Is Python compiled or interpreted?
Both. The standard implementation, CPython, first compiles your source code to bytecode (the .pyc files in __pycache__ folders), then interprets that bytecode in a virtual machine. You never run a separate compile step, which is why Python is usually called an interpreted language. Python 3.13 added an experimental JIT compiler, and other implementations such as PyPy use JIT compilation to run Python code much faster.
Is Python a high-level language?
Yes. Python is one of the highest-level general-purpose languages in wide use. It manages memory automatically, needs no type declarations and reads close to English, which is why many universities now teach it first. The trade-off is speed: pure Python is much slower than C at heavy number crunching, so libraries like NumPy do their heavy lifting in compiled C code underneath.
Languages from lowest to highest level
There’s no official ranking, but this order roughly reflects how much each language hides the hardware from you:
- Machine code: binary instructions for one processor family.
- Assembly: readable names for machine instructions.
- C: portable, with direct access to memory.
- C++ and Rust: C-level control plus higher-level features.
- Go: compiled and fast, with garbage collection and a deliberately small language.
- Java and C#: managed memory on a virtual machine.
- JavaScript and TypeScript: dynamic and garbage-collected, JIT-compiled in browsers and Node.js.
- Python and Ruby: very high-level, dynamic and light on boilerplate.
- SQL: declarative queries over data.
- Prolog: declarative logic programming.
Common questions
What is the lowest-level programming language?
Machine code. It’s the binary the processor executes directly, with no translation and no abstraction. Assembly is the lowest level people realistically write by hand.
What is the highest-level programming language?
Declarative languages such as SQL and Prolog are usually considered the highest level, because you describe the result rather than the steps. Some people count plain-English prompts to AI coding assistants as the next rung up, though those aren’t programming languages in the formal sense.
Is C a high-level or low-level language?
Formally, C is a high-level (third-generation) language: it’s portable and has variables, loops and functions. In practice it’s usually called middle-level, because it lets you work directly with memory addresses in a way Java and Python don’t.
Is HTML a programming language?
No. HTML is a markup language: it describes the structure of a page but has no logic, loops or variables. CSS describes how the page looks. JavaScript is the programming language of the web.
Which level should I learn first?
Most students start with a high-level language like Python or Java, then meet C and assembly in systems courses such as computer architecture and operating systems, which regularly rank among the hardest computer science classes. If you’re starting out, build something real early: our Python projects and Java projects for beginners go from first program to full stack.
A short timeline of programming languages
- 1947: Kathleen Booth creates the first assembly language.
- 1957: FORTRAN, from John Backus’s team at IBM, becomes the first widely used high-level language.
- 1958: LISP, by John McCarthy, introduces ideas still at the heart of functional programming.
- 1959: COBOL brings English-like code to business computing.
- 1964: BASIC, by John Kemeny and Thomas Kurtz at Dartmouth.
- 1972: C, by Dennis Ritchie at Bell Labs, and Prolog, by Alain Colmerauer and Philippe Roussel.
- 1974: SQL, first called SEQUEL, by Donald Chamberlin and Raymond Boyce at IBM.
- 1985: C++, by Bjarne Stroustrup, is released commercially.
- 1987: Perl, by Larry Wall.
- 1991: Python, by Guido van Rossum.
- 1995: Java (James Gosling at Sun Microsystems), JavaScript (Brendan Eich at Netscape) and PHP (Rasmus Lerdorf).
- 2000: C#, from Anders Hejlsberg’s team at Microsoft.
- 2009: Go, from Google.
- 2012: TypeScript, from Microsoft.
- 2015: Rust 1.0, originally developed at Mozilla.
For the machines these languages were written for, see our history of computers.


