News for hackers. Stuff that matters.
Re:My first fifteen compilers by shakna on Saturday September 02, 2017 @03:12AM (#15154743)
> But if somebody believes that writing a transpiler isn’t fundamentally the same thing as writing a compiler,

I'd be surprised if anyone did.

The use of transpiler is more about audience expectation, a specificity.

It's shorter than writing "source-to-source compiler", and acknowledges compiler as its superset, right there in its name

Re:My first fifteen compilers by sjrd on Saturday September 02, 2017 @04:44AM (#15154977)
That's unfortunately not my experience. I'm appalled every time someone tells me "But Scala.js is not a compiler, it's a transpiler, since it compiles to JS!"

I assume other language users and authors suffer the same kind of comments on a regular basis.

Re:My first fifteen compilers by shakna on Saturday September 02, 2017 @12:41PM (#15156915)
I'm now horrified to learn that you experience is the norm.

And that the cognitive dissonance to say:

> ...is not a compiler, it's a transpiler, since it compiles to...

is alive and well.

Mea culpa.

Re:My first fifteen compilers by TeMPOraL on Sunday September 03, 2017 @03:28AM (#15160130)
Welcome to the webdev world. It keeps inventing new terms for things that already have established terms for decades, probably because it's rare anyone bothers to look back at the decades of stuff not done in JS...
Re:My first fifteen compilers by mseebach on Saturday September 02, 2017 @08:40AM (#15155663)
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.
Re:My first fifteen compilers by wtetzner on Saturday September 02, 2017 @09:01AM (#15155754)
> 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.

Re:My first fifteen compilers by mseebach on Saturday September 02, 2017 @09:37AM (#15155908)
I would argue that it isn't, if it is, then what's the distinction between a compiler and a transpiler?
Re:My first fifteen compilers by yorwba on Saturday September 02, 2017 @10:22AM (#15156101)
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.

Re:My first fifteen compilers by mseebach on Saturday September 02, 2017 @10:31AM (#15156140)
So you suggest that transpilers are a subset of compilers, where I suggest that they are disjoint sets. No need for snark.
Re:My first fifteen compilers by shakna on Saturday September 02, 2017 @12:31PM (#15156843)
"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.

Re:My first fifteen compilers by tom_mellior on Saturday September 02, 2017 @01:06PM (#15157050)
> "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...

Re:My first fifteen compilers by shakna on Saturday September 02, 2017 @01:48PM (#15157286)
> Citation needed that either of these terms actually existed before 2013.

Your own sources have references in '03, which contradicts that.

But I'll oblige.

Sitting on my shelf is

"XLT86 - 8080 to 8086 Assembly Language Translator, User Guide", dated 1982. (But not the version you can find online, which is September, '81. I'm not quite sure on the release, as the user guides didn't include a revision number).

Here's a quote:

> XLT86·is a Digital Research software product that aids in the translation of 8080 assembly language programs to equivalent 8086 programs.

...

> Unlike other 8086 trans-compilers, XLT86...

> The XLT86 trans-compiler is available for operation under CP/M and MP/M for the 8080, 8085, and Z80...

So, I would say Digital Research coined the term in '81, but their usage suggests that others in that circle would occasionally use the term, or have a passing familiarity with such a term.

Re:My first fifteen compilers by tom_mellior on Sunday September 03, 2017 @05:56AM (#15160588)
Nicely spotted! Still, individuals trying (and failing) to "make" it a word doesn't convince me of any significant amount of use.
Re:My first fifteen compilers by chrisseaton on Sunday September 03, 2017 @02:38AM (#15160024)
'Transpiler' has existed since at least 1964, 'communication of algorithms' by Parker-Rhodes.
Re:My first fifteen compilers by tom_mellior on Saturday September 02, 2017 @01:23PM (#15157151)
> It's shorter than writing "source-to-source compiler"

Brevity isn't everything. But more importantly, "transpiler" (like "source-to-source compiler") does not say what you are compiling from, and what you are compiling to. In order for the term "transpiler" to be useful, you need to specify those things. Anything you think you imply by using the term is not, in fact, implied.

If you compare the lengths of "JavaScript to Pascal compiler" and "JavaScript to Pascal transpiler", you might be in for a surprise!

Re:My first fifteen compilers by TeMPOraL on Sunday September 03, 2017 @03:29AM (#15160135)
I think the current definition of "transpiler", the way it's used in the wild, means "compiles $something to JavaScript". I haven't seen anyone using this word for anything else than compiling to JS.
Re:My first fifteen compilers by shakna on Saturday September 02, 2017 @01:55PM (#15157317)
It may lack some specificity, but it makes you look for the terms for "from" and "to".

It eliminates bytecode compilers and native compilers from the conversation immediately.

> It's not a native compiler, it's a transpiler

If this was said, you wouldn't then ask if it compiled for a VM, or if it could directly produce small binaries.

I wouldn't say the term is completely redundant. Only when you introduce it for the first time.

E.g.

> That's not possible. It's a transpiler. Back to the topic at hand...