If you are learning to code or coding for a living, you use one of these. They’re source of endless online debates, and, as a programmer, are your most important tool. But what is a programming language exactly? Why do we need them? and What does compiled and interpreted mean anyway?
A matter of communication
Computers are meant to aid us in whatever task we want them to do, from keeping client information to performing complex mathematical operations. They’re quite obedient, and will do whatever we want them to, but in order to do something, we must tell them how to do it. That’s the programmer’s job, to give the computer instructions on how to perform a task.
The issue is that computers don’t speak English, Spanish, or any other human language. A computer’s actual language is the so-called machine code, the instructions it actually understands, and which vary according to its processor architecture (the machine code for x86_64, used in most PCs is different than that for ARM, used in mobile devices). While a programmer can give instructions to a computer in its native language (and in fact, its how it was done at first), the process its quite tedious, prone to error, and requires entering binary code (or hexadecimal representation).

Example of machine code for an Intel 8088 processor. Machine code is in red, memory addresses in blue, and equivalent assembly in magenta. Image from Wikimedia Commons
That’s when programming languages make an appearance. They’re meant to be a middle ground between what a computer understands, and what a human is comfortable speaking. However, they’re not meant to be understood directly by a computer. A computer doesn’t actually speak C, Python, or Java, or any other programming language at all. What is written in a programming language needs to be further “translated” into the corresponding machine code that it actually understands. This process is itself done by a computer program, called compiler, that’s specific to each language.
The first compiler was A-0, developed by Grace Hopper in 1949. From then on, a multitude of compilers and languages have appeared, each with its own characteristics.
The “humanness” spectrum
Not all languages are created equal. I usually think of programming languages as lying on a spectrum, from machine code-like to human-like.

In this spectrum, assembly (an architecture-dependent language that is really close to machine code, but uses keywords to ease its writing) lies on the left side, while other higher-level languages lie on the right.
C and C++, for example, are easier to understand and manage by a human, while still maintaining a relationship with what the computer would actually do (these languages have, for example, data types and direct memory management).
On the right side of this example lies Scratch, a language which uses colourful blocks to represent orders to be executed in a certain order, and is meant to teach programming basics.
Compiled and Interpreted
Programming languages are divided into two categories, compiled languages and interpreted languages. The difference between them lies in the approach taken to “translate” the source code (written in a programming language) to machine code, given the fact that the end result (machine code) is specific to the platform we’re developing for.
Compiled languages
They to be translated once, and the resulting machine code will be distributed as the program and executed as many times as wanted. Compiled languages:
- Don’t need the end user to install a compiler, since the machine code is already distributed
- Need to be compiled (and most of the times modified) for each platform, such as Windows 64-bit, Windows 32-bit, Linux, Mac OS Intel, Mac OS Apple silicon, etc. and then distributed (which represents more work for the developers)
Some compiled languages are C++, Rust and Go.
Interpreted languages
Interpreted languages however, do the translation on the go. Every time a program written in an interpreted language is ran, it will be converted to machine code and executed. The conversion is usually done as code is needed, not all at once. Interpreted languages:
- Need the end user to install the language’s interpreter (such as JVM for Java code), since the conversion to machine code will be done on every execution
- Can be written only once, and distributed for the interpreter on the user machine to translate it to adequate machine code (which eases the work of the developers, but comes at the cost of speed, since the program translation must be done every execution).
Some examples are JavaScript, Python and Java. It is worth noting that Java actually compiles to something called bytecode (an intermediate between source code and machine code), which is then given to the interpreter, in order to improve performance.
Sources
- Massachusetts Institute of Technology. (n.d.). Grace Hopper (The compiler). Lemelson. Retrieved February 6, 2023, from https://lemelson.mit.edu/resources/grace-hopper
Featured Image by Gabriel Heinzer on Unsplash
Leave a Reply