4 ms·
What is the difference between cross-compile and transpile? (Honest question, no sarcasm)
by diegoperini 9y ago
What is the difference between cross-compile and transpile? (Honest question, no sarcasm)
- nothrabannosir 9y agoThe way you write them.
- Touche 9y agoDoesn't "cross-compile" mean to compile a binary meant to run on a different platform than the host? Like, compiling a Linux binary on a Mac... If I'm right then that's nothing like what "transpile" means.
- progman 9y ago"Transpile" is an artificial buzzword, just meaning source-to-source translation, from Pascal to C for instance. Actually, there is no such thing as a "transpiler". There are only compilers which are programs which translate from one regular language A into another regular language B. It doesn't matter whether B is a high-level language or low-level machine code.
- Touche 9y agoYes, it's another word for source-to-source translation, you are right. It is not, however, cross-compilation, which is what I was responding to. So I'm not sure why you replied to me with this statement. In any event, is it so bad to have another word for source-to-source compilation? What is it that angers you about it?
- progman 9y ago> is it so bad to have another word for source-to-source compilation? If you compile C to Assembler then you compile from one code (C) to another code (Asm, or machine code which is the compact form of Asm). What's the difference to a "transpiler"? Wikipedia states that the difference is just the (almost) equal level of abstraction. I would call such a thing a high-level source-to-source compiler. The word "transpiler" is uncertain and barely known, hence the people here who ask what a transpiler is. Cross-compilation is another thing since it means compiling on one platform for another platform. In all three cases we deal with compilers from one regular language A into another regular language B.
- frostmatthew 9y agocompile: convert from one language to another (though usually used in the specific context of converting from high level source code to lower level code like assembly/machine/etc) cross-compile: convert from one language to another that will be executed on another platform (e.g. compiling something on a linux box to be ran on a windows machine) transpile: convert from one (typically high level) source language to another (high level) source language