I am looking for a better explanation (research level, papers) to answer:
Why translating a program from one high-level programming language directly into another is difficult?
Note: When I say difficult I don't mean "hard" - i.e. I am not taking about computational complexity here simply because I am unaware of such results, but you are very much welcome to correct my ignorance.
I understand that at the core of the argument can say something like one-to-one mapping for such translation simply does not exists.
In general, I am not comfortable with terminology used in my own question.
We know from text books: Low-level language - each command or object of the language has one-to-one mapping to CPU commands (e.g. Assembler). All other languages are High-level.
Is there a way to reformulate the question into FSA formalism like with regular languges, or some other formalism. But I don't think Church–Turing thesis can help here - it is not about computability or existence of a proof.
My motivation is very simple - I want to discuss/answer how difficult is such a problem for example in translating PHP to Java. Please note that direct translation is indeed a mapping of language commands or objects (e.g. HipHop does not qualify).
Probably any pragmatic solution would be indirect translation, i.e. in order to (partially) convert a program P written in high-level language A into a high-level language B:
- (complexity lowering) convert codebase of program P from A to low or inter-mediate level language C
- (shared codebase) resue parts of converted codebase of program P by calling commands in low or inter-mediate level language C from high level language B