top | item 21382513

(no title)

antisemiotic | 6 years ago

It's always "from one language to another", sometimes the destination is machine language. The output is generally not meant to be meant to be human-readable in any case. "Transpile" is an ugly and unnecessary word, please don't push it as "more correct".

discuss

order

brianzelip|6 years ago

> It's always "from one language to another“

Hmmm, sometimes it’s “from one version of a language to another version of the same language”. As is the case with Babel[0] and JavaScript.

[0] https://babeljs.io/

LordDragonfang|6 years ago

I mean, arguably ES6 and TS are as close or closer to being "the same language" than ES6 and Babel targets.

chrisseaton|6 years ago

It's just a more specific word. You can say all words are unnecessary because you can express the same thing using more words.

antisemiotic|6 years ago

"Transpilation" and "compilation" describe the exact same concept. From user's perspective, readable code is translated into runnable code. From theoretical perspective, code in a more complex language is translated into a less complex language while preserving semantics. From a compiler writer's perspective, it's a totem pole of compilers, with at least one middle-level language usually. Plenty of people use the term "compiles to JavaScript" to describe languages like TS or Elm. It's just some overly pedantic people insist on the term "transpile" when the target is also, in a completely unrelated way, used to write code directly by a significant number of contemporary programmers.