Code translation is a specialized form of program synthesis where the input specification is an existing program in a source language and the output is a semantically equivalent program in a target language. Unlike traditional compilation to machine code, it operates at the source code level, enabling migration between language versions (e.g., Python 2 to 3) or ecosystems (e.g., JavaScript to TypeScript). The core challenge is preserving functional correctness and algorithmic intent across different syntaxes, libraries, and programming paradigms.
