3 ms·
> > compile step the way typescript [does] > Typescript transpiles to JS. I don't 'believe' there is a compilation step. This is a common misconception. Trans
by Stratoscope 4y ago
> > compile step the way typescript [does]
> Typescript transpiles to JS. I don't 'believe' there is a compilation step.
This is a common misconception. Transpiling is not something distinct from compiling. "Transpiler" is just a trendy name for a certain subset of compilers. Just because it compiles to another "high level" language doesn't mean it's not a compiler.
Every "transpiler" is a compiler.
Sources:
On BIX in the 1980s, when the only implementation of C++ was Cfront, which translated to C, I asked Bjarne Stroustrup if it was a preprocessor. He told me quite emphatically, "No, Cfront is a compiler." (I don't think the term "transpiler" was in common use at that time.)
The Wikipedia article on Cfront agrees:
> Cfront was the original compiler for C++ (then known as "C with Classes") from around 1983, which converted C++ to C
https://en.wikipedia.org/wiki/Cfront https://en.wikipedia.org/wiki/Cfront
More recently, and relevant to this discussion, the TypeScript team specifically calls tsc a compiler:
> Let’s get acquainted with our new friend tsc, the TypeScript compiler.
https://www.typescriptlang.org/docs/handbook/2/basic-types.html#tsc-the-typescript-compiler https://www.typescriptlang.org/docs/handbook/2/basic-types.h...
In fact, if you search that page for "pil", you will find nine references to "compile" and none for "transpile".
- bilekas 4y agoThis is probably the best comment I've ever received here. I've always seen them as different, but as you lay out, they're all doing the same thing in the end.. Thanks for making me a little more aware!