Before we learn about the execution of Programming languages. first, we need to learn about what is programming languages and for which purpose they made.
A computer is a tool and it only understands bits and bytes. so back in the past when the computer was big in size and hard to manage, and low in memory size to store data went to a tiny microscopic piece of metal with positive and negative charges making it cheaper easier, and more efficient to work, manage, and with large size of memory to store tons of data within a second.
the people who build things like computers can manage them. but the things that come into mind for whom we are developing these things. like computers are built for individual persons to use them in their daily life. but they don’t understand the bit and bytes and can’t even program in ones and zeros. so here we need a medium that can understand by both computers and humans. and that medium is called Programming language.
Why do we need a Programming Language?
The reason why we came up with programming languages is that it is more effective to communicate with computers. well, think about a scenario where you have two teachers one is good and one is the bed. so how could you find that which one is good for you? well, here we need to find which one is more effective to communicate with others and how easily he can teach new things to others.
The same thing goes for programming languages. we could code in ones and zeros but that is not the efficient and simplest way in terms of building large applications. even we can write ones and zeros but we can’t find the combinations like which one will be more efficient. so we need a language that we could easily understand like we speak our native language to communicate with others.
so programming languages are for us not for computers. but the thing is computers don’t understand programming languages they only understand bits and bytes. so think about a scenario where we have to communicate with people that don’t understand our language. so here we need a translator that understands both person’s languages and can translate our words into another language. so another person could easily understand.
the same thing goes for programming languages. every programming language comes up with a compiler or interpreter that takes human-written code as input and generates a type of machine code that our machine or computer can easily understand.
What is a Compiler?
A compiler is a system that takes human-readable code as input and generates machine code that can easily understand by a computer or hardware.
but the thing is there are many programming languages like c, c++, java, python, etc. and each one of these has its own syntax and each of them comes up with its own compiler. so we have a different compiler for different programming languages. there is another type of compiler called transpiler.
What is Transpiler?
A transpiler is a compiler that takes code written in a programming language and converts it into another type of programming language. but why do we need to do that it is still not readable by a computer or machine?
so here the things come up that we have different systems like Windows, Linux, Mac, Android, and ios. and each one of them uses different technologies and different programming languages. just like Windows and ios using c# programming and Mac, ios, and Linux use C++ as a programming language.
so in terms of building a program for all of them, we need to learn different programming languages. instead of learning different programming languages, we can use a programming language to code and convert that type of code into another type of programming language using a transpiler. so that’s why we need a transpiler to convert one programming language into another.