22

How can I say in english, that programming language can be compiled to other programming languages?

The example can be Haxe. On the website the language is decribed as "Multiplatform":

Multiplatform: Haxe can be compiled to all popular programming platforms with its fast compiler – JavaScript, Flash, NekoVM, PHP, C++, C# and Java (soon)

but multiplatform can be misunderstood as hardware or software platforms (win, mac, linux).

So what is the most suitable word describing this ability?

FrustratedWithFormsDesigner
46.3k7 gold badges130 silver badges176 bronze badges
asked Apr 16, 2013 at 12:50
9
  • 3
    I would remove "compiles" and simply say that this programming language can be transformed into another through use of some interpreter. Commented Apr 16, 2013 at 12:57
  • 6
    You could use the same word as you would for regular languages: translate, translator. It is clear, and I've heard the word being used in this sense. Commented Apr 16, 2013 at 12:59
  • 4
    @teresko How so? The only way I could see you argue that is you using an overly restrictive and useless definition of compilation (which restricts the output to machine code). Commented Apr 16, 2013 at 13:35
  • 18
    @Neil: transforming a program written in one language into another language is not interpretation. In fact, this is the definition of compilation. Commented Apr 16, 2013 at 13:49
  • 2
    @Neil, compilation, by definition, is a transformation from one language to another. And "transformation" sounds equally obscure and arcane as "compilation", as long as your reader is not well versed in term rewriting and such. So I would suggest using the word "targeting", e.g., "Haxe is targeting JavaScript, Flash, whatever, and such". Commented Apr 17, 2013 at 8:29

6 Answers 6

42

The usual term is "transcompilation" - not a common term, but the technically correct one. It's not just for trendy new scripting languages (CoffeeScript -> JavaScript) either; the first C++ compilers were in fact transcompilers to C.

answered Apr 16, 2013 at 13:01
5
  • 2
    Also "transpiles" as in "The transpiler transpiles CoffeeScript into Javascript" Commented Apr 17, 2013 at 1:12
  • 4
    I have never heard this term before, being in the field for decades. Mind pointing to its origins (a link to the first paper where it appeared would be the best)? Commented Apr 17, 2013 at 8:31
  • From Wikipedia: "A source-to-source compiler [aka. "transcompiler", "transpiler"] translates between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language." Commented Apr 17, 2013 at 8:55
  • 4
    @l0b0, wikipedia does not comment on the origins of the term, and it is definitely never supposed to be an original source. Commented Apr 17, 2013 at 9:04
  • 3
    ...searching "transcompilation" on google doesn't yield any related result... Commented Apr 17, 2013 at 10:03
27

Sorry gents, but the word for this is just "compiled". It means turning one type of code into another type of code. It makes no real difference if that code is English, C++, x86 machine code, ARM machine code, Java, bytecode, or back to English. We generally use it to mean the trip from programming language to machine code, but that's an aspect the word has gained over time. And hey, if enough people start using a word incorrectly, it DOES indeed gain that new meaning. But if you want a word for turning Haxe into C++, the word is "compiles".

Multiplatform: Haxe can be compiled into all popular programming languages with its fast compiler – JavaScript, Flash, NekoVM, PHP, C++, C# and Java (soon)

(Also, I'm ignoring Merriam-Webster, because they're stupid because they disagree with me... hmmmm)

answered Apr 16, 2013 at 13:51
10

Maybe this is a question for https://english.stackexchange.com/ yet I would say that the process of compiling includes compiling to another high level language and is not only limited to compilers that compile towards native machine code.

As a word "Compile" is not specific to computer compilers at all and is quite general. "Compiling a table" or "compiling a list of names" comes to my mind, therefore it is broad enough for a lot of purposes (text processors like Latex compile as well, etc.). To be more specific about the target of the compiliation I would use to-source-compiler

Now for the specific example, I think that platform is an appropriate word to use. Since human languages are inherently ambigeous you have to use redundancy (examples, paraphrasing with other words, explaining) to get the point across if in doubt.

I would also read the "Haxe" statement in a way that includes standard libraries and similar things. I.e. in that case plattform would be a superset of "language" and you could separate it from that by calling it "software development platform" etc.

answered Apr 16, 2013 at 12:59
1
  • 4
    I think you mean english.stackexchange.com? Commented Apr 16, 2013 at 17:16
3

You can say that a compiler has languages X, Y, and Z as translation targets, or design a language with those targets in mind.

answered Apr 17, 2013 at 0:10
2

I would say that compiler by definition translate into different programming language (at least this is definition I know - program that transforms one language into another). For example most C compilers produce assembly as output. Assembly compilers takes this output and transforms it into the binary code which is also a language (sure - probably no one writes writes in it during past 40 years or more but technically it is language) - which can be taken and recompiled to say micro-ops by processors (or there are certain operations done by linker on object files). Similarly the javap compiles into bytecode. Usually at the end of such chain there is interpreter which executes the final code (be it CPU, GPU or executed program). There is 'no such thing' as machine code as modern x86 recompiles the programs into internal operations (micro-ops) and I'm perfectly capable of treating ARM machine code as interpreted language on x86 or other way round (in some cases even recompile from one form to another).

Haxe is source-to-source compiler as it does not transforms the higher-level language into lower level one as the previous examples. It doesn't seem to address directly your problem of multi-platform ambiguity but unfortunately I don't think there is practical way of differentiation between those two things - the APIs are kind of languages which can be in general interpreted, recompiled etc.

answered Apr 16, 2013 at 23:04
1

First thing first: I don't know whether there is already a suitable word for this feature.

But maybe it could be called multilanguage? Or languageagnostic? Since it is more about the programming language, then the mention of 'language' in the name could make it more obvious than multiplatform.

Of course language is ambiguous as well, as it could be understood that the source code can be written in any real world language (for example because variables can be written in unicode).

On the other hand every seasoned programmer will probably recognize such a construct as different from localization or internationalization, so they might 'get' it more easily.

Just my 2 cents.

answered Apr 16, 2013 at 13:01
1
  • i do not think that is accurate; and if you see the fact the site likes only factually correct answers. but welcome to the community and hope you answer some more where you are sure about the answer :) Commented Apr 16, 2013 at 13:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.