What is a Programming Language

A question that clicks in the mind of every person who has the curiosity to know about programming is What is a Programming Language. We will know about every basic concept like what is programming, what is a programming language, Types of Programming Language, and many other topics in this article. So you will know everything about programming and programming language within a few minutes, keep reading this article.

We all know about computers. We all can define it too in a few sentences.

A computer is a general-purpose machine that can perform many computational tasks that you give it to do. The modern computers we have can perform billions or trillions of calculations in a fraction of a second. Isn’t it an amazing thing?

Now the question which comes into our mind, do these computers work on their own? or it works on the instructions given by someone?

Now what these computers are, they can’t really do anything by themselves. So for a computer to do something, one has to give it instructions and these instructions will contain step-by-step information to perform a specific task and these instructions are called a program.

The person who is going to write these instructions or the program for this miraculous machine is called a programmer and here the programmer will write the instructions or the program and the computer will execute that or the computer will work on those instructions.

Now the computers, that we have, contain a lot of programs in them. There are some programs that manage the hardware resources of the computer and they are called system programs and there are some programs that provide specific functionality to a user, for example Wordpad, Browsers, photo-editor, music player, video player, calculator, etc and all these types of programs are referred to as application programs.

We know that we need to give instructions to the computer so that the computer can work on this given instruction. Now the thing is, how can we give the instruction to the computer or in what language can we give the instructions to the computer?

Now we all know that this computer is a machine, how can we communicate with this machine?

The language in which these instructions are written or the language in which this program is written is called the programming language. Isn’t it simple?

Now we will look at everything and every concept about this programming language from very basics.

There are several types of programming languages ​​and we are going to see the details about these languages. By now you have probably heard that computers can only understand binary language. As its name suggests, this binary language has only two values 0 and 1.

Can you guess how easy or how difficult this binary language could be? Yes, it has only two values 0 and 1 so do you think it would be easy to learn or understand binary language?

What is a Programming Language

So in this binary language what you want to say has to be in the form of this 0 and 1. You will have to give instructions to the computer in the form of only 0 and 1. Now here these computers are built in such a way that they can understand or recognize the pattern of the zeros and ones and then they can work on it accordingly.

Now the question which can click in your mind is why have we built computers to understand this binary language? That is because this binary language that has only two values ​​is easy to create on the hardware level, for example if we have a wire and if the current is flowing through this wire we can say it is 1 if the current does not flow, so we can say it is zero.

So generally we can say that one represents something that exists and zero represents something that doesn’t exist, so since this binary language is easy to create on the hardware level, so the computer is built on the hardware level to recognize this pattern of 0 and 1 and while building the computer for a specific pattern of 0 and 1, specific configuration operations are defined.

So when the computer sees a specific pattern of 0 and 1, it knows what to do. So now computers can understand this binary language and this binary language which computers understand is also called machine language.

Now let’s look at the types of programming languages ​​available. In these modern times, we have many programming languages ​​available. So let’s take a look at the types of programming languages.

So the first type of programming language or the language in which we can communicate with the computer is the language that the computer understands. You all know that this computer can understand this binary language or machine language which is the combination of zeros and ones.

So the first type of programming language is the machine level language and in this machine level language, we have the instructions in the form of 0 and 1.

So whatever you want to say has to be in the form of zero and one and the Computers are built in such a way that they can recognize these zeros and ones and perform some specific operation. The combination of zeros and ones that you provide to the computer can communicate with your computer in this language.

Now the problem with this machine-level language is that to program in this machine-level language, one has to know everything about the computer.

So here the programmer is dealing directly with the hardware level, so he is working directly on memory and data. So the programmer needs to know everything about the computer, the computer processor, the computer architecture, everything he has to know and that is why this machine level language is a bit difficult to learn.

Also, think about this, let’s say you want to write a program in machine-level language or you want to instruct the computer in machine-level language and your program consists of a thousand lines, all of your instructions will contain this 0 and 1, and this combination of zeros and ones. First of all, it is difficult to write the program and also if you make some mistakes in your program then it is difficult to detect and because of all this, a normal guy cannot learn programming easily.

Learning a binary language can be as difficult as learning twenty or thirty different languages at the same time without any mentor.

So to solve this type of problem, another type of programming language was invented and is called assembly language. In this assembly-level language instead of that mnemonic of combination of zeros and ones, the symbolic codes were introduced.

For example, if the programmer has to write an instruction, let’s say he/she wants to add the numbers 1 and 2, then in the machine level language, this has to be in the form of zeros and ones. So in the machine level language, it would be very difficult for a programmer to write codes for even simple addition.

But in assembly level language the mnemonic codes to use and the programmer could write ADD 1 2. Mnemonic or symbolic codes can be used and the programmer could write the program this way very easily as compared to binary language. So it was a much more human-readable format, the programmer could understand the code just by looking at it and it is much easier to code than machine level language.

So now the thing is the source code of the program written in this assembly level language using this mnemonic or the symbol Codes cannot be run directly on this computer because this computer can only understand machine language.

We are better than computers when it comes to understanding different languages because computers can understand only one language (machine language) but we can understand more than one language. Isn’t it a proud moment for us?

So what we have to do is convert the code that is written in assembly language to machine level language so that the computer can understand and execute it.

The program written in the assembly level language must be converted to the machine level language and to convert that a program is used and that program is called an assembler. so this assembler will convert the code written in assembly level language to machine level language.

Now this assembly-level language is much easier to learn and someone can learn programming much easier than the machine-level language, but this assembly-level language also has the same difficulties. Although it is much easier to write the programs than the machine level language in assembly level language, if the size of the program increases, again it is difficult to detect the errors, and also the code written in the assembly level language also depended on the Architecture Computer.

What is a Programming Language

So the return of code for one type of the computer cannot be executed on another type of the computer that has a different architecture, so again to solve these types of problems new types of languages ​​were invented so that many more people can come and write the programs and this type of programming languages ​​are called high-level languages.

The high-level languages ​​are designed in such a way that they are very easy to learn for a beginner and are very close to human-readable language, for example in this higher-level language the instruction could be written to add 1 and 2 in this way 1+2. so this 1 + 2 is much more similar to human language, so just by looking at the code one can understand what we are trying to do and since these higher-level languages ​​were much easier to learn, many people started to learn computer programming and began to create many more programs.

Now again the problem is that the program written in the high-level language cannot be run directly on the computer because the computer can only understand the machine language which can contain 0 and 1, but the high-level language is very close to human languages.

So we have to convert the program that is written in high-level language to machine language that computers can understand and execute. So for these high-level languages, ​​there are two ways that we can convert the source code from a high-level language to a machine language and run it. The two methods that were used to convert the high-level language program to a Machine language, one was the compilation method where a program called a compiler was used.

Another method is called as interpretation and for this interpretation method another type of program called as interpreter was used and we will read about the details of this compilation and interpretation method a little later but here just remember that although these there are two.

With different methods, what they do is convert the program that is written in a high-level language to the machine-level language that computers can understand and execute.

Now here this machine-level language and assembly-level language are called lower-level languages. Because while writing programs in this machine and in assembly language, programmers could easily access the computer’s memory and work directly with the data. But with most of these high-level languages, programmers cannot directly access memory and work with data.

But there are some languages ​​in the high-level language type that allow the programmer to work with the computer memory and data and are called as middle-level languages ​​and these middle-level languages ​​provide all the features of the higher-level languages and they also allow the programmer to work with the computer memory and data directly and since these languages ​​provide the feature of the lower-level language and also the high-level language, they are called middle-level languages. ​​

We have the languages ​​like C and C ++, these are all mid-level languages ​​because they allow the programmer to work with the memory and data of the computer and also provide all the features of this high-level language, and in the high-level languages ​​we have Java, C#, python, etc.

This machine level language that is very close to the machine or the language that the computer understands directly, it runs much faster than all these languages.

Thatswhy the execution speed of this machine language is very high and after this machine-level language, we have assembly languages ​​and their execution speed is better than high-level languages ​​but a little slower than machine-level language, and then we have the high-level languages.

So now, as I said before, in these high-level languages, we can convert the code from a higher-level language to machine code in two different ways, one is the compilation method and the other is the interpretation method.

Let’s look at this compilation and interpretation method in detail. So let’s start with compilation.

In this compilation method a program called a compiler is used and this compiler will take the high-level language program and convert it to machine language and this process is called as compilation method and here what happens is that this compiler will read the high-level language program, and convert it to machine language.

This compiler will convert this entire program’s code into machine language and then this machine language code will be executed.

Then the compiler will convert the entire program that is written in the high-level language to the machine-level language and then the machine-level language code will be executed.

Now let’s take a look at this interpretation method, so here too we will convert the program written in the high-level language to the machine-level language and then run it. For this purpose, we will use a program called as interpreter and this process is called as interpretation.

The process of converting the high-level language program to machine language by using the program interpreter is called as the interpretation method.

Here what happens is this interpreter first read the first line of this source code or the program that is in the high-level language and then it will convert it to machine code and then immediately execute it and then pass to the next line of the high-level language program it will read that it will convert that code and then immediately execute it and then go to the third line and then convert that code again and then execute it.

In the compilation process, the entire program that was written in the high-level language was read first, then it was converted to the machine-level language and then the entire program was executed at once, but with the interpretation method the interpreter will read the program that is in the high-level language line by line and convert and execute each line immediately at once, and in this way the compiler and interpreter work.

There are many languages ​​in the high-level language type and in those languages ​​some follow the compilation method and some follow the interpretation method. The languages ​​that follow the compilation method are called as compiled languages ​​. For example, we have C, C ++, etc these are all compiled languages, where the compilation method is used to convert the program that is written in these languages ​​into machine language. The top-level languages ​​that follow the interpretation method are called as interpreted languages, for example, we have Python and this Python is an interpreted language.

Conclusion:

We saw what is a programming language, why is it created, what are its types, how do they processes in the computer, how do codes execute in the computer and all the basics about programming language.

In simple words, we need a language to interact with people and to tell them what do we want from them. Similarly, to give instruction to a computer, we need a programming language.

Now, if we want to execute any task by humans, we instruct them in that language which they can understand. Otherwise, that person may not get our instructions and will not execute the task. So sometimes, we require a person who can translate our language into that language which can be understandable by that person to whom we want to give instructions.

Similarly, if we want to give instructions to a computer, we will have to give that instruction in that language which a computer can understands (Machine-level language). But writing codes in machine language is not easy at all. So we can use middle-level languages or high level-languages which is easy to write as compared to lower-level languages (Machine-level language and assembly-level language ), to give instructions to a computer, and programs like compiler and interpreter will make this code readable to the computer.

I hope this article may have helped you. Thank you for reading!!

This Post Has 4 Comments

Leave a Reply