News for hackers. Stuff that matters.
Re:ShiftJS – Swift to JavaScript transpiler by the8472 on Monday August 15, 2016 @12:27AM (#12288631)
Some people treat C as portable assembly.

Does that make gcc a transpiler for converting portable assembly to platform-specific assembly due to their similar semantics?

Re:ShiftJS – Swift to JavaScript transpiler by PeCaN on Monday August 15, 2016 @01:22AM (#12288812)
I knew someone would bring this up.¹

GCC is an optimizing compiler, at which point all bets are off for obvious/trivial translation between C and asm. You could, hypothetically, write a optimizing TypeScript compiler that emits asm.js.

However, while you can reasonably argue C started as a portable assembly, significant differences like a type system, pointer arithmetic, a calling convention, etc, exist now. I don't think it's unreasonable to say C is significantly higher-level than assembly.

1. My parenthetical at the end was anticipating this—then again, the translation between C and asm frequently is easy, albeit tedious.

Re:ShiftJS – Swift to JavaScript transpiler by the8472 on Monday August 15, 2016 @02:25AM (#12289001)
I guess you could replace gcc with a dumb compiler / turn off optimizations. And throw in compiler intrinsics while we're at it, after all people write hot loops with them. And pointer arithmetics actually translate nicely to all those fancy addressing modes you find on x86.

And in the other direction one could argue that those so-called "transpilers" actually compile from a higher-level language when you consider complex type-inference and static type checking. Optimizing is not all a compiler does.