News for hackers. Stuff that matters.
Re:Porting the Go compiler from C to Go by jerf on Friday April 25, 2014 @01:10PM (#7647729)
It is unclear how one would compile arbitrary C code into useful Go. The stereotyped conventions of well-written compiler code allows for a more idiomatic translation than a general translator could ever aspire to.

C++ to Rust would be even crazier.

(Transpile is a silly word. It's "compile". Compiling already trans-es.)

Re:Porting the Go compiler from C to Go by Shamanmuni on Friday April 25, 2014 @01:47PM (#7647966)
I know it's crazy difficult to do it, that's why I was talking about dreams.

But maybe a set of guidelines about translatable C code plus a translator which is good enough for a variety of cases would make refactoring the resulting code such a manageable task that many projects could consider switching to Go directly.

You are technically correct in that compile already implicates a translation, but we usually use that term refering to a translation into a lower level language and not another language at the same level. You can say transpiler or source-to-source compiler for those cases and I think it's clearer and more accurate for the reader.

Re:Porting the Go compiler from C to Go by yohanatan on Friday April 25, 2014 @02:43PM (#7648333)
> ... but we usually use that term refering to a translation into a lower level language and not another language at the same level.

Rust is not lower-level than C++ and neither is Go lower-level than C.

Re:Porting the Go compiler from C to Go by mseepgood on Friday April 25, 2014 @02:59PM (#7648416)
Exactly. Hence "transpiler".
Re:Porting the Go compiler from C to Go by yohanatan on Saturday April 26, 2014 @02:55AM (#7650661)
What part of his definition didn't you understand? He said a transpiler trasnlates from a higher-level language to a lower-level language. We are talking about translating from C -> Go and C++ -> Rust both of which are in the opposite direction (i.e., low -> high).
Re:Porting the Go compiler from C to Go by mseepgood on Saturday April 26, 2014 @05:01AM (#7650812)
> He said a transpiler trasnlates from a higher-level language to a lower-level language

No, he said a compiler translates from a higher-level language to a lower-level language:

"You are technically correct in that compile already implicates a translation, but we usually use that term [= compile] refering to a translation into a lower level language"

Re:Porting the Go compiler from C to Go by yohanatan on Sunday April 27, 2014 @11:47PM (#7658136)
Ahh, my bad.
Re:Porting the Go compiler from C to Go by yohanatan on Saturday April 26, 2014 @02:57AM (#7650663)
This should not have been down-voted. We are talking about translation from C -> Go and C++ -> Rust (which are both in the opposite direction of the definition given for 'transpiling').
Re:Porting the Go compiler from C to Go by vanderZwan on Saturday April 26, 2014 @03:28AM (#7650702)
I agree that your comment added value to the discussion, and gave a counter-vote.

However, arguably the term could make more sense there, if we ignore the earlier definition and instead assume "trans" is short for "transcendent", as in "climbing to a higher level".

If we then simplify that to "compile from one language to another of roughly equal or higher level", it becomes a useful word to indicate a specific subset of ways one can do compilation.

Of course, I'm completely pulling this out of my ass and I might piss off actual CompSci people who use very specific and strict definitions in their papers (kind of like how some get annoyed with the procedure/function mixup), so take this with a grain of salt.

Re:Porting the Go compiler from C to Go by ldrndll on Saturday April 26, 2014 @03:12AM (#7650679)
> You are technically correct in that compile already implicates a translation, but we usually use that term [ie compile] refering to a translation into a lower level language and not another language at the same level.

The way I understood what he wrote, he was making the same point as you. Presumably the people downvoting you had a similar interpretation of what he wrote.

Re:Porting the Go compiler from C to Go by stcredzero on Friday April 25, 2014 @01:32PM (#7647873)
Good automated translations involve matching and translating the project idioms. This results in code that fits the target language's language-idioms. Automated translation only at the level of language constructs results in odd looking generated code.