7 ms·
Tangential, but I cringe everytime I see the word "transpiler". A compiler is a compiler is a compiler. Previous discussion on this: https://news.ycombinator.c
by crescentfresh 9y ago
Tangential, but I cringe everytime I see the word "transpiler". A compiler is a compiler is a compiler.
Previous discussion on this: https://news.ycombinator.com/item?id=15154994 https://news.ycombinator.com/item?id=15154994
- bringtheaction 9y agoI 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'?
- colanderman 9y agoDo you also disapprove of the word "assembler"? (Honest question.)
- squeaky-clean 9y agoA square is a square is a square. But it's also a rectangle.
- mmjaa 9y agoMeh: Compiler: collects sources from various places, assembles the result into machine code. Transpiler: collects sources from various places, converts the source to another language. Personally I cringe at the newspeak you seem to imply we should all be applying to our lives. These words mean things - quite different things, it turns out. There's a difference between human-readable source code language, and machine-executable binary code. These tools function in different ways entirely; your optimization to the language is not only un-warranted, but leads to a desultory effect: programmers get stupider when they don't know what their tools are actually doing.
- cat199 9y ago> newspeak you seem to imply we should all be applying to our lives. http://foldoc.org/transpiler http://foldoc.org/transpiler ^ no match. transpiler is the newspeak.
- mmjaa 9y agofoldoc.org is the product of a single individuals' construction of definitions of computing terms and is by no means a complete and authoritative source of technical terms. It says so right there on the site... However, this is a fun game, so lets play: http://www.yourdictionary.com/transpiler http://www.yourdictionary.com/transpiler https://en.wiktionary.org/wiki/transpiler https://en.wiktionary.org/wiki/transpiler https://www.thefreedictionary.com/transpiler https://www.thefreedictionary.com/transpiler https://www.quora.com/What-is-a-transpiler https://www.quora.com/What-is-a-transpiler
- cat199 9y agoplease feel free to attribute or posit another source w/r/t etymology within computing, I'm all ears. I doubt you'll find 'transpiler' at the origins of computing history; see also C++/cfront post
- mmjaa 9y ago4 refs in my post, check it. You won't find "full stack development" in the roots of computing history either; language is malleable and useful. Get over it.
- sigjuice 9y agoCompletely agree. Even the Babel project has the good taste to simply call themselves a compiler. https://babeljs.io https://babeljs.io Babel is a JavaScript compiler.