4 ms·
I think it’s useful to distinguish compilation whose target is another language that was originally intended to be human-readable (transpilation) from compilati
by bringtheaction 9y ago
I think it’s useful to distinguish compilation whose target is another language that was originally intended to be human-readable (transpilation) from compilation to a form intended exclusively for machines (compilation to machine code or bytecode).
- masklinn 9y ago> I think it’s useful to distinguish How and why? And what do you do of compilers which can do either based simply on the backend you select?
- drabiega 9y agoPersonally, I think of transpilation as a subset of compilation. So a transpiler is also a compiler, and a compiler that has a readable language backend can do transpilation, which is a type of compilation.
- crescentfresh 9y agou/masklinn still asks a good question though: there are tools that act on the source code for both "compilation" and "transpilation" (eg Kotlin), depending on the target platform. They do not distinguish, why should we?
- drabiega 9y agoFor the same reasons you might ever want a more specific term? What about assemblers or disassemblers? Given a suitably broad definition of compiler that includes transpilers, are they not also included? Wouldn't the same arguments apply?
- masklinn 9y ago> For the same reasons you might ever want a more specific term? I asked why you might want this here and there's been no answer yet. Having a term for something you don't need or want to know isn't actually useful. > What about assemblers or disassemblers? Given a suitably broad definition of compiler that includes transpilers, are they not also included? Wouldn't the same arguments apply? Because these are actually useful qualifier, in the same way that "a C compiler" is a useful qualifier.
- crescentfresh 9y agoCompilation is the act of going from one language to another, machine or not. This is what I was taught at least. "Machine code" or "bytecode" holds no special distinction. In this article's case, there a reasonable exception to made when JavaScript is being "compiled" into JavaScript itself. For that, I don't know what the term is (or if there even is one).
- dagw 9y agoFor that, I don't know what the term is (or if there even is one). Transpiler? Transpiler has been around as a term in CS for a while now. Initially it was used for compilers that compiled from one dialect of assembly to another.
- monocasa 9y agoThat was retconned. They didn't call it a 'transpiler' at the time.
- munificent 9y ago"Transcompiler" was the older term for assembly -> assembly. I don't think it's too much of a stretch to shorten that to "transpiler". I think people hate the term because they associate it with JavaScript hipsters who have no sense of CS history and presume they've invented something new. The same as how you cringe when someone refers to the "#" character as "hashtag". But "transpiler" is a useful term. We're in a world now where source-to-source compilers are much more prevalent than they were ten years ago, and there are real workflow differences between working with a compiler that targets a low-level language versus a high-level one. Things like how you debug the output are very different.
- monocasa 9y ago> there are real workflow differences between working with a compiler that targets a low-level language versus a high-level one. Things like how you debug the output are very different. Like what? When I've had to debug GCC, I just dumped out the GIMPLE et al.; what do you do differently with a 'transpiler'?