3 ms·
> Technically they are all transpilers, but seeing as there is no lower-level for the browser than JS (barring WebASM), one could also argue that they are in fa
by khedoros1 9y ago
> Technically they are all transpilers, but seeing as there is no lower-level for the browser than JS (barring WebASM), one could also argue that they are in fact also compilers.
They're compilers because they translate from one computer language into another. It has nothing to do with how low of a level the browser supports running. They're additionally transpilers (a subset of compilers), because the languages that they translate between are both high-level languages.
- colejohnson66 9y agoSo all transpilers are compilers, but not all compilers are transpilers?
- amorphid 9y agoYes.
- sitkack 9y agoCorrect. Transpilers are a subset of compilers that go from a HLL to a HLL.
- mbrock 9y agoAlthough the following (from Wikipedia) seems to accord with usage: > The name compiler is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language, object code, or machine code) to create an executable program. Maybe we should complicate that a bit by saying that a compiler typically compiles a programming language into a grammar where the higher-level features of the source language must be "expanded" or "linearized" in some substantial way to be expressed in the target language. So, for example, GHCJS is more like a compiler than a transpiler, even though its target language is JavaScript, because the JavaScript that it generates is full of graph reduction stuff that is implicit in the source Haskell. On the other hand, CoffeeScript is more like a transpiler, because it doesn't do any such substantial expansion or linearization.
- sitkack 9y agoI like that. Compilers lower input source into something more linear. Transpilers move input source laterally. They are different, which I dislike people saying they are not.