Differences between a transpiler and a compiler [duplicate]

2

You've heard a lot about the term transpiler ( transpiler ) lately. However, the difference of a transpiler (Babel, for example) to a traditional compiler does not seem clear to me. The two translate code from one language to another, do not you?

What are the real differences between a compiler and a transpiler?

    
asked by anonymous 25.05.2017 / 22:01

2 answers

3

Clearly and objectively:

  • Compiler: receives source code in high / medium level (closest to humans) as input and, as output, produces low-level language code (closer to the machine). Ex .: C -> object code, Java - > JVM bytecode.

  • Transpiler: receives source code in high / medium level as input and, as output, produces code in another high / medium level language. Ex: Typescript - > Javascript.

25.05.2017 / 22:16
0

In general terms, transpiler is a type of compiler that translates code written in a medium / high level language into a code of another medium / high level language.

The compiler translates the medium / high-level language into a lower-level language, for example, a assembly language.

Font

    
25.05.2017 / 22:16