Re:JSweet: A transpiler from Java to TypeScript/JavaScript
by monocasa on Wednesday December 16, 2015 @01:07PM
(#10746016)
So if I run gcc with -O0, it's a transpiler? Remember that gcc outputs a human readable language that another program (the assembler) converts into machine code.
Re:JSweet: A transpiler from Java to TypeScript/JavaScript
by cromwellian on Wednesday December 16, 2015 @06:51PM
(#10748374)
In one sense yes, but GCC the utility is an optimizing compiler.
Would you call a sed script which converted Java to ES6 via regexes a compiler, even though not an ounce of compiler theory was used?
I would define transpilers as a subset of compilers that are are only interested in high level language conversion.
It's the difference between say, translating books between foreign languages, and being an editor who rewrites a book to be better.
Re:JSweet: A transpiler from Java to TypeScript/JavaScript
by monocasa on Thursday December 17, 2015 @05:41PM
(#10755157)
I mean... sed is Turing complete. Yeah, it's in the Turing tarpit, but if you were able to successfully translate Java to ES6 in a sed script, yes I would call that a compiler. In a lot of ways, much of compiler theory is concerned with the best way to write a compiler (for many different optimization functions of "best"), not the only ways to do so. Just being a crappy compiler doesn't make it any less of a compiler.
Putting GWT or Closure in the same category as JSweet, TypeScript, or CoffeeScript obfuscates what these tools do.