2 ms·
It is a rather ill-defined form of compilation; i.e., it's not clear what that form is. Compilation means translation from one language to another; every compil
by pron 7y ago
It is a rather ill-defined form of compilation; i.e., it's not clear what that form is. Compilation means translation from one language to another; every compiler does that. Transpile was born because people were used to the fact that the target language of many compilers is machine code, but it's entirely unnecessary to have a separate word for that, as it doesn't add any information. There could be a meaningful term for the word, to refer to some sort of "shallow" compiler, that compiles a source language to a target language of a similar level of abstraction and preserves the source code structure in the output, but people often use the word in other cases, too. In other words, transpile and compile are synonymous, making the newer, hybrid word redundant.
- Stratoscope 7y agoHere's a recent comment of mine making a similar point with a couple of citations: https://news.ycombinator.com/item?id=22441298 https://news.ycombinator.com/item?id=22441298
- 7thaccount 7y agoI think this is just the way human language generally works being that it is organic and messy. In my field, there are numerous overlapping and even contradictory terms. I like the added distinction "transpiler" provides as I immediately know what the author means. Or the author could just use the term "compiler" plus another sentence to describe which kind. Transpiler seems like the more efficient way to convey the concept.
- pron 7y agoThere is no "kind" though. "It compiles C to JS" and "it transpiles C to JS" mean the exact same thing. No added clarification is necessary, because there is just no distinction between the terms. On the contrary, if people think that "transpilation" has some distinct meaning, they are just being confused about what compilation is.
- dom96 7y agoMost people use the word transpiler incorrectly (if we look at Wikipedia’s definition). Nim to C is compiling because Nim is at a higher level of abstraction than C. If you think that any program that translates code from one language to another is a transpiler then I’ve got news for you, gcc and clang are transpilers. They translate C/C++ to Assembly after all.