The Levels of Programming Languages
One day, I was coding using Ruby at home when I was struck by the thought: “What are the different levels of programming languages?“. You know those people that need to know all the back logic and details of everything? Well, I am that kind of person and the thought of not knowing the answer was bugging me for a while so I decided to search up the levels of Programming Languages.
There are 3 different levels of programming languages:
- Machine Language
- Assembly Language
- High-Level Language
Obviously, computers do not understand human languages, so programs must be written in a language a computer can use. All programs must be converted into the instructions the computer can execute. Before I explain the 3 levels of programming languages, we need to know the hierarchy.
Machine Language: Machine language is the computer’s native language. It is a set of built-in primitive instructions in the form of binary code. If you want to give a computer an instruction, you have to enter the instruction as binary code. Here is an example:
Assembly Language: Assembly Language was created as an alternative to machine languages, because machine languages are so difficult to read and modify. Assembly language uses a short descriptive word, known as a mnemonic, to represent each of the machine-language instructions. For example, the mnemonic “add” means add numbers and “sub” means subtract numbers. In order to get 2 + 3 = 5, you might write an instruction in assembly code as: “add 2, 3, result”. Although assembly languages were developed to make programming easier, the computer cannot execute assembly language. Another program called “Assembler” is used to translate assembly language programs into machine code.
High-Level Language: In the 1950s, high-level languages came out. These languages are the common programming languages we know today, such as Java, Ruby and Python. You can write high-level languages and run it in different types of machines. They are english-like and easy to learn and use. There are many high-level languages out there and each was created for a specific purpose. A high-level language consists of a compiler and source code. A compiler is a translator program which translates a high level programming language into equivalent machine language programs. Source code is the input of a procedural language. When you compile your program, the compiler reads your code and if it contains no mistakes, converts it to assembly code. Then when you run your program, the operating system reads your assembly program and it converts it to machine code readable by the machine hardware.
These were the steps of languages to get to all the actual coding we do today with high-level languages. A developer using high-level languages should at least know how we got to the languages we use today, and even if you do not care, it doesn’t hurt to know right?