5 ms·
> There is no fundamental difference between compilers, code formatters, preprocessors or transpilers. Anything that takes a program and outputs another program
by xg15 5y ago
> There is no fundamental difference between compilers, code formatters, preprocessors or transpilers. Anything that takes a program and outputs another program related to it by some semantics is a compiler.
That is arguing semantics and, while not wrong, I think it muddies the waters: By that logic, sed and awk are compilers.
In the end, only machine code can be executed, so you'll need something at the end of your chain that produces machine code or at least executes your DSL in an interpreter loop.
So I think a distinction between "compilers" that generate machine code and "compilers" that don't is worthwhile.
- dgb23 5y agoWhere do you draw the line? Is javac not a compiler?