Hello and welcome to another blog. In this blog I am going to talk about Compiler and Transpiler. So lets dive deep!
TABLE OF CONTENTS
- Working of Compiler
- Working of Transpiler
- To Summarise and Main Difference
- End Note
The term compiler was coined by American computer scientist Grace Hopper, who designed one of the first compilers in the early 1950s.
As we all know that computers only understand binary language but we people don’t. So to translate our code in binary language we need compilers.
Basically, a compiler is a program which converts high level language to low level language. OR in more simpler terms we can say that it takes the code written by us in human understandable language to the language which machines understand(binary).
Working of Compiler
Whenever we write some code and when we compile it the compiler scans the whole code and check for errors etc. and after checking it converts the source code to machine code and also generates intermediate object code which further requires linking, hence requires more memory. Compiler also optimise the code so that it can run quickly and takes less memory space. The execution time is fast in the compilers. Programming languages like C, C++, java uses compilers.
Unlike compilers, Transpilers convert code to code. Transpilers also known as source-to-source compiler because it takes source code written in one language and transform it into another language that has a similar level of abstraction. Let us understand it with an example, ES6 is latest
Working of Transpiler
To Summarise and Main Difference
Compiler usually produces a directly usable artifact (executable binary of some sort). Simply it takes your code and convert in executable format. While Transpiler software that converts the source code of one language into the source code of another.
Hope this blog have cleared your most of the doubts related to Compiler and Transpiler. I would like to get your feedback so that I can enhance more.