Hacker News new | past | comments | ask | show | jobs | submit login

I get that we've lost this battle, and some people seem to think there's a useful distinction being made, but man, does the word 'transpile' grate on me.

At the point where we are calling things that compile to assembly "transpilers" I don't think there is any distinction left, much less a useful one. I mean the classic notion of a compiler is a program that turns things into assembly, which is then taken into machine code by an assembler.

I agree with you that we've lost though: no amount of protest is going to make people stop using the word "transpiler".

A compiler is a program that turns programs in a source language into equivalent programs in a target language.

It is generally assumed that a compiler goes from high level to low level, a decompiler low-to-high and a transpiler high-to-high. I guess in this case the transpiler is low-to-low, so maybe "transpiler" is just used to mean "samey-to-samey"

Isn't "low-to-low" typically called static recompilation or binary translation esp. in emulation circles?

That is correct but we are not talking in the context of the emulation circles.

A compiler is a program that translates programs from one language to another.

> At the point where we are calling things that compile to assembly "transpilers" I don't think there is any distinction left

"Transpiler" is grating (apparently).

thank you; some consolation to know it's not just me

does this seems like another instance of the annoying practice in our field of someone giving a name to a thing because they think it's new, though it's not (ie, source-to-source compilers have been around as long as source-to-bytecode compilers)--no need to re-name them

wish they would just stop it and get the hell off my lawn

Yep, like calling themselves Engineer without having the respective degree.

Thankfully in most jurisdictions it is forbidden by law to do as such.

> some people seem to think there's a useful distinction being made

What is that distinction? Excluding the javascript crowd, I doubt this phrase will see extensive use in the field until the term gets properly defined and is meaningfully distinct from the word Compile as used today.

I assume "javascript crowd" knows how to compile their node binary. Thus, they know the distinction between babeljs and gcc, and therefore they know the distinction between compiler and transpiler.

What's the distinction between Compile and transpile then? and is this distinction agreed upon and meaningful?

I agree with drdrey's definition here[1], which is echoed in paragraph two here[2] as well, which provides you with the agreement part at least. Whether if it is meaningful to you, is up to you.

[1] - https://news.ycombinator.com/item?id=16076823 [2] - https://hackernoon.com/moving-to-es6-babel-and-transpilers-3...

There was a battle? Transpile is between human readable sources, and compiler is always into machine readable code. This is the only project that I've seen to (for some reason) not conform to that definition. I guess I don't see the point of contention.

> compiler is always into machine readable code

The frustrating bit is that this is absolutely not true. A compiler is anything that parses some text according to some grammar, manipulates it, and emits it in a different format. While the most well-known and popular compilers are for C, to emit machine code, there's nothing inherent in the definition of a compiler that means it can't emit something human-readable.

I wouldn't have nearly as much issue with this if the JavaScript community instead had decided "compiler isn't specific enough: we need different words for compilers that drop vs. maintain a level of abstraction", rather than "we need a word for a thing like a compiler, but that doesn't, as compilers apparently inherently do, drop a level of abstraction".

Transpilers used to be called "source-to-source compilers", or "compilers" when the "source-to-source" distinction wasn't relevant.

Then the JS world came along and decided to use a new word to make it look more hip and cool.

>decided to use a new word

A friendly FYI... the old word "transpiler" has been around since at least the 1960s. See the 2nd-to-last paragraph on the last page:


It's not a new word. People have been using the word "transpiler" or "transcompiler" for source-to-source compilers since at least the late 80's [0]. They used to be popular for translating between different dialects of assembly. Then they fell out of fashion for a while before gaining popularity again in the last decade for targeting JavaScript. So while the "JS world" is responsible for re-popularizing both the word and the concept, they certainly didn't invent it.

[0]edit: Apparently 60's.

YACC compiles human readable source to human readable source.

Is it YACT now?

well, there's even a wiki page for source-to-source translation. it's not always useful to distinguish 'truck' from 'automobile', but sometimes it is.

It's sometimes useful to distinguish “truck” from “automobile”, but never when the thing being labelled a “truck” is a Honda Civic.

are you saying it's not useful to refer to something as a transpiler if it's not a transpiler? that sounds reasonable.

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