Compiling Vs Transpiling — What and Why?
We’ll dive into the main topic shortly, but first…
What are low-level languages and high-level languages?
Low-level languages are the ones that computer understands. It is very close to writing actual machine instructions. The code is not human-readable, and it is often cryptic. For example Assembly language and Machine language (0s and 1s)
What is compiling?
Compiling is the process of converting a high-level programming language to a low-level programming language.
But why do we need to compile our code?
As you already know, the computer understands low-level language, so in order to actually make our program run, we need to convert our language to something which the computer can understand.
Sometimes it’s compiled in multiple steps, each step optimizing the code and getting it closer to machine code.
For example, Java, C#, and C are a few examples of the high-level languages that are needed to be compiled.
What is transpiling?
Also, know as ‘transcompiling’
Transpiling is converting one high-level language to another high-level language.
But why do we need to transpile a high-level language?