According to Wikipedia "In computer science, a programming language is a conventional notation for formulating algorithms and producing computer programs that apply them. In a similar way to a natural language, a programming language is composed of an alphabet, vocabulary, grammar rules, and meanings. "
Indeed, computers and processors are dumb. They know how to perform certain calculations in binary and sequentially with only access to memory and some registers.
They use an instruction set called ISA to perform tasks.
An example of a simplified instruction set:
ADD: Adds some datas
ADDI: Makes an addition to the intermediate registers
NAND: Do a Not And operation on a register
HIM: Load an intermediate register in a register
SW: Saves a word (series of bits usually one byte) in a register
LW: Load a word in a register
BEQ: Performs the operation if equal and goes to a certain memory address if the condition is good.
JALR: Jump to a memory address
As you can see, a processor may have a very few instructions. In reality today processors have a lot more. But it's not practical for a developer to work directly with an instruction set for big programs. The code is completely sequential and not very legible for a human. Also you may not want to learn everything about a thousands of instructions.
I talked about registers ?
This is where things get more complicated.
In my example there are only three registers: regA, regB and regC and an intermediate register representing memory.
This leaves us only three "variables", usable only by a few instructions and a stack of data, which must be popped up and stacked in the right order.
My goal here is not to do an assembly course but to explain why we have moved on to more modern programming languages so I did jump many things.
And now ?
Now, and for quite some time now, developers have been using a so-called programming language. As well as a compiler used to transcribe the program into the machine ISA.
- Easier to read and understand for a human.
- More operations and logic possible.
- The language can be compatible with several ISAs without the developer having to do anything with his program. Only the compiler changes.
The major disadvantage is that we may lost optimization and features of the ISA. Some compilers compile for a precise ISA but without using all the instructions. Or some operations require direct use of the ISA of the machine. For this purpose some languages leave the possibility to insert pieces of assembly language.
But we can easily guess that programming languages makes life easier for developers.