Hacker News new | ask | show | jobs
by mseebach 3217 days ago
I'd argue that it's a compiler if it treats JS as a lower language - that the output is simply an intermediate artefact for executing Scala on a JS engine, and not meant for human consumption. If, on the other hand, the output is meant to be developed further by hand, if the output is considered an equivalent and not lower representation, then it's a transpiler.
1 comments

> If, on the other hand, the output is meant to be developed further by hand, if the output is considered an equivalent and not lower representation, then it's a transpiler.

Which is also still a compiler.

I would argue that it isn't, if it is, then what's the distinction between a compiler and a transpiler?
If all birds are dinosaurs, then what's the distinction between a dinosaur and a bird? Well, there used to be dinosaurs who weren't birds.

Likewise, there are compilers I wouldn't call transpilers.

So you suggest that transpilers are a subset of compilers, where I suggest that they are disjoint sets. No need for snark.
"Transpiler" is short for "transcompiler". Has been since the 80's.

And what verb do you use with a transpiler? It compiles one form into another.

A transpiler is a source-to-source compiler. What you do with the output afterwards hardly matters, when it is performing the act of compilation.

There is no distinction here. One is merely a subset of the other. Which is good for communicating purpose, but you can't just assume one is seperate from the other when they employ the same process.

A compiler may not compile to a source language, though it might.

A transpiler is a compiler that compiles to a source language.

> "Transpiler" is short for "transcompiler". Has been since the 80's.

Citation needed that either of these terms actually existed before 2013.

https://books.google.com/ngrams/graph?content=compiler%2Ctra...

https://trends.google.com/trends/explore?date=all&q=transpil...

https://trends.google.com/trends/explore?date=all&q=transcom...