Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


I 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.


There 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.


Most 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.


Here's a recent comment of mine making a similar point with a couple of citations:

https://news.ycombinator.com/item?id=22441298




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: