Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Transpiling is source language to source language, regardless of whether either of those languages is considered high livel. In this case, transpiler is the correct term.


It's not the correct choice. For one, transpiling is an unnecessary word, there is no information value in it and the domain experts don't use it and never have. For another, C isn't the target, C is an intermediary language used to produce the binaries. The C produced by these compilers is highly unidiomatic and not meant for human consumption.


> the domain experts don't use it and never have

Not true! You see it used in the academic literature I think as far back as the 1960s.

I also use it myself (PhD in languages and practising professionally ever since - take that as being an expert or not up to you) and I think most of my peers would use it and understand it as well.

To me transpiling implies translation from one source language that a human would normally expect to use directly to another. That's extra information over 'compiler'.


A source language does not mean a representation meant for human consumption but a language that is intended to be translated.

You say that transpiling does not carry any additional information, but that is only supported by your implicit assumption that transpiling only produces idiomatic code that humans will edit.

You say that domain experts do not use the word transpiling. From this one infers that you believe you are a domain expert and others are not. In the best light, you are taking your personal experience and applying it globally. You present that as an argumentum ad baculum, which is a fallacy in its own right, but it is really the conjunction of an availability bias couched in a hasty generalization. Plus, your statement is false - domain experts do use the word transpiling, just maybe not people in your circle.


> For one, transpiling is an unnecessary word,

No, not really. Transpiring is an entirely different problem, and one which is not limited to programming languages. Transpiring involves parsing a high-level language down to an intermediate language, and afterwards encode it back to a high-level language. Therefore problems involving semantics enter into play, instead of just transforming high-level constructs down to primitives.


That's not how Wikipedia defines it. From https://en.wikipedia.org/wiki/Source-to-source_compiler

> A source-to-source translator converts 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.

Like I said, translating a high-level language like Python to a low-level one like C wouldn't be considered transpilation. It would be compilation. Just as translating C code to Asm is considered compilation.


Then gcc is a transpiler, too. It translates C/C++ to assembly language.


The part of gcc that translates one source representation to another transpiles, yes. That is not mean that the word compilation shouldn't be used.

It's similar to saying that all children are people, but not all people are children.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: