compiler-constructionlanguage-agnosticterminologyinterpretertranspiler

Compiler vs Interpreter vs Transpiler


During a ReactJS session that I was attending, the presenter used a term transpiler for some code conversion/porting happening. In the past, I have heard the terms compiler and interpreter. I've used in the context of converting a user written language code to a runnable form on a computer system. Transpiler is new to me. How is a transpiler different from a compiler or an interpreter and why is it needed?


Solution

  • As is mentioned in this Wiki article, it is a type of compiler which translates source code from one programming language to another programming language. The source code might be in some language no longer used, or doesn't support latest hardware/software advancements, or as per programmer's convenience/favoritism.

    A VB6 to VB.NET converter can be thought of as a Transpiler. I might think of COBOL to C# / C++ / Java tool as a transpiler.