4 ms·
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!"
by sjrd 9y ago
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.
- mseebach 9y agoI'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.
- wtetzner 9y ago> 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.
- mseebach 9y agoI would argue that it isn't, if it is, then what's the distinction between a compiler and a transpiler?
- yorwba 9y agoIf 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.
- mseebach 9y agoSo you suggest that transpilers are a subset of compilers, where I suggest that they are disjoint sets. No need for snark.
- shakna 9y ago"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.
- tom_mellior 9y ago> "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%2Ctranscompiler%2Ctranspiler&year_start=1800&year_end=2017&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Ccompiler%3B%2Cc0 https://books.google.com/ngrams/graph?content=compiler%2Ctra... https://trends.google.com/trends/explore?date=all&q=transpiler https://trends.google.com/trends/explore?date=all&q=transpil... https://trends.google.com/trends/explore?date=all&q=transcompiler https://trends.google.com/trends/explore?date=all&q=transcom...
- shakna 9y ago> 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.
- shakna 9y agoI'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.
- TeMPOraL 9y agoWelcome 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...