News for hackers. Stuff that matters.
Re:A Simple Compiler in JavaScript by adtac on Sunday January 21, 2018 @03:09AM (#16197282)
*interpreter/transpiler, not a compiler
Re:A Simple Compiler in JavaScript by tomsmeding on Sunday January 21, 2018 @03:16AM (#16197297)
The interpreter is certainly an interpreter, but a transpiler is arguably also a compiler, be it maybe with an easier target than most conventional compilers. Assembly language and machine code are also languages you can program in; in that sense you'd also have to call gcc a transpiler ;)
Re:A Simple Compiler in JavaScript by adtac on Sunday January 21, 2018 @03:20AM (#16197307)
Indeed, every compiler is a transpiler: it transpiles into asm. But not every transpiler is a compiler in the truest sense of the term. IMO only transpiling to machine language qualifies as compiling.

But we're just arguing about semantics here :) My comment was more directed towards the interpreter part of things.

Re:A Simple Compiler in JavaScript by wtetzner on Sunday January 21, 2018 @10:12AM (#16198320)
> Indeed, every compiler is a transpiler: it transpiles into asm. But not every transpiler is a compiler in the truest sense of the term.

I think you have it backwards. Every transpiler is a compiler, but the reverse is not necessarily true.

Re:A Simple Compiler in JavaScript by sebazzz on Sunday January 21, 2018 @04:47AM (#16197461)
> IMO only transpiling to machine language qualifies as compiling.

It is not black and white, compiling to IL or bytecode qualifies as compiling. Perhaps compiling means compilation to a binary executable format?

Re:A Simple Compiler in JavaScript by pjmlp on Sunday January 21, 2018 @05:50AM (#16197575)
Bytecode is machine language, specially on mainframes and computer architectures up to early 80's.

It is all a matter how the CPU executes it, direct mapping of machine code into gates, or micro-coded translation layer.

Re:A Simple Compiler in JavaScript by Vendan on Tuesday January 23, 2018 @02:14AM (#16211645)
GCC compiles C to assembly, and then uses GAS to turn that into actual machine code... So is GCC a transpiler, and GAS the compiler?
Re:A Simple Compiler in JavaScript by always_good on Sunday January 21, 2018 @09:26AM (#16198137)
Can you update the first sentence of this wikipedia article to point out that a transpiler is not a compiler? https://en.wikipedia.org/wiki/Source-to-source_compiler

It would help squelch the confusion for future forum bike shedding.

Someone seems to try and point this out every time it comes up like they're winning some sort of pedantry points, but I don't see how they could be. Please illuminate me so I understand the next time someone says this and possibly join la resistencia.