Difference between Compiler and Transpiler ?.

Difference between Compiler and Transpiler ?.

background-g239ab88da_1920.jpg To understand the difference between Transpiler and a compiler. First of all, we will see that what does this compiler and transpiler actually means.

Compiler - It is a program that converts code from High-level language to low-level language. Such as conversion of Java language or javascript to binary language. Whenever we interact with computers, we write code in High-level language that means a language similar to having English words so that it creates easiness for us to write the code. But this language can't be understood by the computer because it only understands matching language that is 0 and 1. So here compiler helps us to convert out a language so that computer can understand it.

Transpiler - It is a program that converts code from One language to another at the same level. Such as conversion of ES6 to Es5 or Typescript to javascript etc. Here comes the question that why do we convert languages at the same level - Because whenever we are using any language and if that language does not support in that browser then our code will not run. For example, let take the case of a Browser. The majority of the people write code in ES6, but most of the browsers don't support ES6, so here transpiler will help to convert ES6 to ES5. So that with the help of this we will be able to run the code.

The difference between compiler and transpiler is that - The compiler is used to convert code from high-level language to low-level language. So that our code can be converted into binary form, which will help computers to understand that what do we want to communicate.

Tanspiler is used to convert languages at the same level of abstraction.

Thank you so many guys for reading till here. Do let me know any feedback in the comment section. I will be very happy to hear.