4 ms·
Also, source-to-source compiler can be shortened to compiler. The phrase source-to-source is redundant.
by sigjuice 8y ago
Also, source-to-source compiler can be shortened to compiler. The phrase source-to-source is redundant.
- sakuronto 8y agowhat about high-level-language-to-high-level-language compiler?
- monocasa 8y agoNope. There's the (albeit not 100% correct) meme that C is portable PDP-11 asm. What is correct in my mind is that PCC has much fewer, much less complicated transformations to go to PDP-11 (or M68k) asm than Babel does to go from ES-next to ES5. But for some reason Babel is a transpiler because it's all high level and that's magically different. And no one in their right mind would attempt to call the c compiler of the 1980s a transpiler.
- svnsets 8y agoThe only difference between the two in my mind is that the output from a transpiler is likely going to have a ton of bloat, require additional transforming, and be a much larger amount of code than the sum of the inputs. Whereas something like the Closure Compiler actually optimizes and eliminates dead code. They are the same thing though from an ideological standpoint though.
- monocasa 8y agoI mean, early PCC didn't have data flow analysis, or eliminate dead code, and was known for head scratching levels of stuff like spilling registers on the stack that didn't need to be spilled. Was the c compiler of the 1980s a transpiler?
- sigjuice 8y agoEven the Babel project has the good taste to call themselves a compiler. https://babeljs.io https://babeljs.io says this in very large letters Babel is a JavaScript compiler.
- tlrobinson 8y agoShould this Wikipedia page not exist then? https://en.wikipedia.org/wiki/Source-to-source_compiler https://en.wikipedia.org/wiki/Source-to-source_compiler
- monocasa 8y agoI mean, it should exist according to wiki's rules since there are so many people using the term. Wiki intentionally doesn't try to independently verify any research, but just serves as a collation of ideas. What I would do is ask 'what part there is any different than any other compiler?'
- tlrobinson 8y agoIt's a type of compiler. Just like a truck is a type of vehicle, and a car is another type of vehicle.
- omeid2 8y agoThey both have four wheels and transport atoms. Why do you think it is helpful to be unambiguous between atoms that make up a human or atoms of any goods in the back of a truck? /s
- monocasa 8y agoExcept that there's a true formal (in fact legal) distinction between a car and a truck (they have different emissions standards). The whole distinction between a 'transpilers' and other compilers on the other hand is 'what is the user going to do with the output'.
- tlrobinson 8y agoThat's not the disinction I've seen. I like Wikipedia's: > translates between programming languages that operate at approximately the same level of abstraction That's fairly straightforward, though a bit subjective (which doesn't preclude a word from having meaning)