News for hackers. Stuff that matters.
[dead]
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by burke on Thursday January 04, 2018 @11:03PM (#16076418)
I get that we've lost this battle, and some people seem to think there's a useful distinction being made, but man, does the word 'transpile' grate on me.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by clhodapp on Friday January 05, 2018 @12:15AM (#16076729)
At the point where we are calling things that compile to assembly "transpilers" I don't think there is any distinction left, much less a useful one. I mean the classic notion of a compiler is a program that turns things into assembly, which is then taken into machine code by an assembler.

I agree with you that we've lost though: no amount of protest is going to make people stop using the word "transpiler".

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by drdrey on Friday January 05, 2018 @12:48AM (#16076823)
A compiler is a program that turns programs in a source language into equivalent programs in a target language.

It is generally assumed that a compiler goes from high level to low level, a decompiler low-to-high and a transpiler high-to-high. I guess in this case the transpiler is low-to-low, so maybe "transpiler" is just used to mean "samey-to-samey"

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by lloeki on Friday January 05, 2018 @01:45AM (#16077020)
Isn't "low-to-low" typically called static recompilation or binary translation esp. in emulation circles?
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by iotscale on Friday January 05, 2018 @03:56AM (#16077443)
That is correct but we are not talking in the context of the emulation circles.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by ant6n on Friday January 05, 2018 @12:56AM (#16076848)
A compiler is a program that translates programs from one language to another.

> At the point where we are calling things that compile to assembly "transpilers" I don't think there is any distinction left

"Transpiler" is grating (apparently).

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by doug1001 on Thursday January 04, 2018 @11:17PM (#16076493)
thank you; some consolation to know it's not just me

does this seems like another instance of the annoying practice in our field of someone giving a name to a thing because they think it's new, though it's not (ie, source-to-source compilers have been around as long as source-to-bytecode compilers)--no need to re-name them

wish they would just stop it and get the hell off my lawn

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by pjmlp on Friday January 05, 2018 @02:01AM (#16077077)
Yep, like calling themselves Engineer without having the respective degree.

Thankfully in most jurisdictions it is forbidden by law to do as such.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by abiox on Friday January 05, 2018 @02:33AM (#16077178)
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by gatmne on Friday January 05, 2018 @12:17AM (#16076733)
> some people seem to think there's a useful distinction being made

What is that distinction? Excluding the javascript crowd, I doubt this phrase will see extensive use in the field until the term gets properly defined and is meaningfully distinct from the word Compile as used today.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by nurettin on Friday January 05, 2018 @12:49AM (#16076829)
I assume "javascript crowd" knows how to compile their node binary. Thus, they know the distinction between babeljs and gcc, and therefore they know the distinction between compiler and transpiler.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by gatmne on Friday January 05, 2018 @12:52AM (#16076836)
What's the distinction between Compile and transpile then? and is this distinction agreed upon and meaningful?
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by nurettin on Friday January 05, 2018 @01:01AM (#16076867)
I agree with drdrey's definition here[1], which is echoed in paragraph two here[2] as well, which provides you with the agreement part at least. Whether if it is meaningful to you, is up to you.

[1] - https://news.ycombinator.com/item?id=16076823 [2] - https://hackernoon.com/moving-to-es6-babel-and-transpilers-3...

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by lopatin on Friday January 05, 2018 @04:17AM (#16077509)
There was a battle? Transpile is between human readable sources, and compiler is always into machine readable code. This is the only project that I've seen to (for some reason) not conform to that definition. I guess I don't see the point of contention.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by burke on Friday January 05, 2018 @01:00PM (#16080244)
> compiler is always into machine readable code

The frustrating bit is that this is absolutely not true. A compiler is anything that parses some text according to some grammar, manipulates it, and emits it in a different format. While the most well-known and popular compilers are for C, to emit machine code, there's nothing inherent in the definition of a compiler that means it can't emit something human-readable.

I wouldn't have nearly as much issue with this if the JavaScript community instead had decided "compiler isn't specific enough: we need different words for compilers that drop vs. maintain a level of abstraction", rather than "we need a word for a thing like a compiler, but that doesn't, as compilers apparently inherently do, drop a level of abstraction".

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by stefano on Friday January 05, 2018 @05:10AM (#16077705)
Transpilers used to be called "source-to-source compilers", or "compilers" when the "source-to-source" distinction wasn't relevant.

Then the JS world came along and decided to use a new word to make it look more hip and cool.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by jasode on Friday January 05, 2018 @07:18AM (#16078157)
>decided to use a new word

A friendly FYI... the old word "transpiler" has been around since at least the 1960s. See the 2nd-to-last paragraph on the last page:

http://comjnl.oxfordjournals.org/content/7/1/28.full.pdf+htm...

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by dagw on Friday January 05, 2018 @07:15AM (#16078146)
It's not a new word. People have been using the word "transpiler" or "transcompiler" for source-to-source compilers since at least the late 80's [0]. They used to be popular for translating between different dialects of assembly. Then they fell out of fashion for a while before gaining popularity again in the last decade for targeting JavaScript. So while the "JS world" is responsible for re-popularizing both the word and the concept, they certainly didn't invent it.

[0]edit: Apparently 60's.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by lurr on Friday January 05, 2018 @06:56PM (#16082837)
YACC compiles human readable source to human readable source.

Is it YACT now?

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by abiox on Friday January 05, 2018 @02:44AM (#16077209)
well, there's even a wiki page for source-to-source translation. it's not always useful to distinguish 'truck' from 'automobile', but sometimes it is.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by dragonwriter on Friday January 05, 2018 @02:46AM (#16077222)
It's sometimes useful to distinguish “truck” from “automobile”, but never when the thing being labelled a “truck” is a Honda Civic.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by abiox on Friday January 05, 2018 @02:53AM (#16077240)
are you saying it's not useful to refer to something as a transpiler if it's not a transpiler? that sounds reasonable.
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by gatmne on Friday January 05, 2018 @12:13AM (#16076717)
Agreed especially given that "transpile" lacks a well-defined meaning.

Just ask folks how this term differentiates from Compile and you'll get wildly varying answers and definitions.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by dragonwriter on Friday January 05, 2018 @12:46AM (#16076819)
“Transpile” is a proper subset of “compile”, where both the source and target of compilation are languages designed primarily for direct human editing (source code); it is source-to-source compilation.

Using the term for anything where the source is JVM bytecode is plain wrong, and it's also dubious for anything targeting WebAssembly (though if the target is specifically .wat/.wast, it may perhaps be arguably defensible.)

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by abiox on Friday January 05, 2018 @02:55AM (#16077245)
there existed "translators" from one asm variant to another in the past. [0][1]

so i guess one might use "transpile" wrt bytecode in the spirit of that. but i guess asm source files are still "human readable", where bytecode generally isn't considered as such.

[0] P47, "TRANS": http://www.patersontech.com/dos/Docs/86_Dos_usr_03.pdf

[1] http://www.s100computers.com/Software%20Folder/Assembler%20C...

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by gatmne on Friday January 05, 2018 @12:51AM (#16076834)
My point exactly!
Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by usrusr on Friday January 05, 2018 @05:15AM (#16077732)
I think it's pretty clear that "transpile" is a subset of "compile" and that there are both examples of "compile" that are indisputably not "transpile" (plain old source to architecture specific binary) and examples of "compile" that anybody who uses the term "transpile" would include in their personal variety of "transpile" (translation between source formats that are commonly used for human written code).

I don't see why the existence of a grey area should be enough to question the utility of the term.

If compile/decompile are used for a transformations along one axis, transpile is used for transformations that are predominantly orthogonal to that axis.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by gatmne on Friday January 05, 2018 @06:07AM (#16077900)
At the time of this reply, there are at least five competing definitions being argued for and against in this thread; some either requiring that the input and output be machine code or disallowing it, some necessitating that both input and output be at "the same level of abstraction" and others arguing that inputs and output can be at different levels of abstraction.

Given the large inconsistency and incompatibility between all these definitions and the existence of a well-accepted term that comprises all of these definitions, is it a mystery why people question the utility of the term? After all, what use is a nuanced term if it can't reliably convey that additional information.

Re:TeaVM – Ahead-of-time transpiler of Java bytecode to Java... by progman on Friday January 05, 2018 @09:13AM (#16078646)
>After all, what use is a nuanced term if it can't reliably convey that additional information.

I would recommend the general term "A/B compiler" where A and B are arbitrary regular languages. That way it would be pretty clear what a Pascal/C compiler is, or a JVM/Webasm compiler, for instance. Or a x86/C compiler which would also make the word "decompiler" obsolete.