Program Skeletons for Automated Program Translation
Abstract
Translating software between programming languages is a challenging task, for which automated techniques have been elusive and hard to scale up to larger programs. A key difficulty in cross-language translation is that one has to re-express the intended behavior of the source program into idiomatic constructs of a different target language. This task needs abstracting away from the source language-specific details, while keeping the overall functionality the same. In this work, we propose a novel and systematic approach for making such translation amenable to automation based on a framework we call program skeletons. A program skeleton retains the high- level structure of the source program by abstracting away and effectively summarizing lower-level concrete code fragments, which can be mechanically translated to the target programming language. A skeleton, by design, permits many different ways of filling in the concrete implementation for fragments, which can work in conjunction with existing data-driven code synthesizers. Most importantly, skeletons can conceptually enable sound decomposition, i.e., if each individual fragment is correctly translated, taken together with the mechanically translated skeleton, the final translated program is deemed to be correct as a whole. We present a prototype system called Skel embodying the idea of skeleton-based translation from Python to JavaScript. Our results show promising scalability compared to prior works. For 9 real-world Python programs, some with more than about 1 k lines of code, 95% of their code fragments can be automatically translated, while about 5% require manual effort. All the final translations are correct with respect to whole-program test suites.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code cites Unsupervised Translation of Programming Languages
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code cites Leveraging Automated Unit Tests for Unsupervised Code Translation
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair cites Unsupervised Translation of Programming Languages
- Leveraging Automated Unit Tests for Unsupervised Code Translation cites Unsupervised Translation of Programming Languages
- QiMeng-LibBench: Benchmarking LLM Agents for Library-Scale Cross-Architecture Migration cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
Cited by top-tier papers4
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and RepairAli Reza Ibrahimzada, Brandon Paulsen, Reyhaneh Jabbarvand, Joey Dodds et al.ICML 2026 · 9 citations
- SysMoBench: Evaluating AI on Formally Specifying Complex Real-World SystemsQian Cheng, Ruize Tang, Emilie Ma, Finn Hackett et al.ICLR 2026 · 1 citation
- QiMeng-LibBench: Benchmarking LLM Agents for Library-Scale Cross-Architecture MigrationWeijia Li, KE GAO, Jiajie Li, Han Sun et al.ICML 2026
- Spatial and Temporal Decomposition for Faster Translation ValidationBenjamin Mikek, Chathur Bommineni, Qirun Zhang, Thomas RepsOOPSLA 2026
Builds on13
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
- Leveraging Automated Unit Tests for Unsupervised Code TranslationBaptiste Rozière, Jie Zhang, François Charton, Mark Harman et al.ICLR 2022 · 161 citations
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating CodeRangeet Pan, Ali Reza Ibrahimzada, Rahul Krishna, Divya Sankar et al.ICSE 2024 · 96 citations
- C2S: translating natural language comments to formal program specificationsJuan Zhai, Yu Shi, Minxue Pan, Guian Zhou et al.FSE 2020 · 44 citations
Related papers
- Syntax and Domain Aware Model for Unsupervised Program TranslationFang Liu, Jia Li, Li ZhangICSE 2023 · 25 citations
- TransMap: Pinpointing Mistakes in Neural Code TranslationBo Wang, Ruishi Li, Mingkai Li, Prateek SaxenaFSE 2023 · 4 citations
- User-Customizable Transpilation of Scripting LanguagesBo Wang, Aashish Kolluri, Ivica Nikolic, Teodora Baluta et al.OOPSLA 2023 · 13 citations
- Skeleton-Guided-Translation: A Benchmarking Framework for Code Repository Translation with Fine-Grained Quality EvaluationXing Zhang, Jiaheng Wen, Fangkai Yang, Yu Kang et al.EMNLP Findings 2025 · 2 citations
- AVATAR: A Parallel Corpus for Java-Python Program TranslationWasi Uddin Ahmad, Md Golam Rahman Tushar, Saikat Chakraborty, Kai-Wei ChangACL Findings 2023 · 46 citations
