A
source-to-source compiler,
transcompiler or
transpiler is a type of
compiler that takes the
source code of a program written in one
programming language as its input and produces the equivalent source code in another programming language. A source-to-source compiler translates between programming languages that operate at approximately the same level of
abstraction, while a traditional
compiler translates from a
higher level programming language to a
lower level programming language. For example, a source-to-source compiler may perform a translation of a program from
Pascal to
C. An automatic
parallelizing compiler will frequently take in a high level language program as an input and then transform the code and annotate it with parallel code annotations (e.g.,
OpenMP) or language constructs (e.g.
Fortran's
forall
statements).