During a reactJS session that I was attending, the presenter used a term transpiler for some code conversion/porting happening. I've always used and heard the terms compiler and interpreter when it comes to converting a language code to a runnable form on a computer system/machine. Transpiler is new to me. How is a transpiler different from a compiler or an interpreter and why it is really needed?
Compiler - compiles code to a lower level code.
Example:
"Developer code"
-> "Machine code"
PHP
-> C
Java
-> bytecode
Transpiler - compiles code to same level of code/abstraction.
Example:
"Developer code"
-> "Another developer code or version"
JavaScript ES2015+
-> JavaScript ES5
Interpreter - interprets code, not really in the same class/league/context with the two above.
Example: php.exe
index.php
" -> "Results to html
or just like pure index.html
"