Lune

OOPSLA2023顶会

User-Customizable Transpilation of Scripting Languages

Bo Wang, Aashish Kolluri, Ivica Nikolic, Teodora Baluta, Prateek Saxena

摘要

A transpiler converts code from one programming language to another. Many practical uses of transpilers require the user to be able to guide or customize the program produced from a given input program. This customizability is important for satisfying many application-specific goals for the produced code such as ensuring performance, readability, ease of exposition or maintainability, compatibility with external environment or analysis tools, and so on. Conventional transpilers are deterministic rule-driven systems often written without offering customizability per user and per program. Recent advances in transpilers based on neural networks offer some customizability to users, e.g. through interactive prompts, but they are still difficult to precisely control the production of a desired output. Both conventional and neural transpilation also suffer from the "last mile" problem: they produce correct code on average, i.e., on most parts of a given program, but not necessarily for all parts of it. We propose a new transpilation approach that offers fine-grained customizability and reusability of transpilation rules created by others, without burdening the user to understand the global semantics of the given source program. Our approach is mostly automatic and incremental, i.e., constructs translation rules needed to transpile the given program as per the user's guidance piece-by-piece. Users can rely on existing transpilation rules to translate most of the program correctly while focusing their effort locally, only on parts that are incorrect or need customization. This improves the correctness of the end result. We implement the transpiler as a tool called DuoGlot, which translates Python to Javascript programs, and evaluate it on the popular GeeksForGeeks benchmarks. DuoGlot achieves 90% translation accuracy and so it outperforms all existing translators (both handcrafted and neural-based), while it produces readable code. We evaluate DuoGlot on two additional benchmarks, containing more challenging and longer programs, and similarly observe improved accuracy compared to the other transpilers.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Program Skeletons for Automated Program Translation 引用了 TransMap: Pinpointing Mistakes in Neural Code Translation
  • Program Skeletons for Automated Program Translation 引用了 Unsupervised Translation of Programming Languages
  • Program Skeletons for Automated Program Translation 引用了 Leveraging Automated Unit Tests for Unsupervised Code Translation
  • TransMap: Pinpointing Mistakes in Neural Code Translation 引用了 Unsupervised Translation of Programming Languages
  • TransMap: Pinpointing Mistakes in Neural Code Translation 引用了 Language Models are Few-Shot Learners
  • Leveraging Automated Unit Tests for Unsupervised Code Translation 引用了 Unsupervised Translation of Programming Languages
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper3

  1. TransMap: Pinpointing Mistakes in Neural Code TranslationBo Wang, Ruishi Li, Mingkai Li, Prateek SaxenaFSE 2023 · 4 次引用
  2. Program Skeletons for Automated Program TranslationBo Wang, Tianyu Li, Ruishi Li, Umang Mathur 等PLDI 2025 · 3 次引用
  3. A Sound Static Analysis Approach to I/O API MigrationShangyu Li, Zhaoyang Zhang, Sizhe Zhong, Diyu Zhou 等OOPSLA 2025

它引用的 Paper3

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 次引用
  3. Leveraging Automated Unit Tests for Unsupervised Code TranslationBaptiste Rozière, Jie Zhang, François Charton, Mark Harman 等ICLR 2022 · 161 次引用

相关 Paper

  1. AVATAR: A Parallel Corpus for Java-Python Program TranslationWasi Uddin Ahmad, Md Golam Rahman Tushar, Saikat Chakraborty, Kai-Wei ChangACL Findings 2023 · 46 次引用
  2. Polyglot: An Extensible Framework to Benchmark Code Translation with LLMsMarco Vieira, Priyam Ashish Shah, Bhavain Shah, Rrezarta KrasniqiASE 2025
  3. PROGnosticator: Testing Source-to-Source Code Translators via Construct-Oriented FuzzingYeaseen Arafat, Stefan NagyFSE 2026
  4. Exploring and Unleashing the Power of Large Language Models in Automated Code TranslationZhen Yang, Fang Liu, Zhongxing Yu, Jacky Wai Keung 等FSE 2024 · 72 次引用
  5. Syntax and Domain Aware Model for Unsupervised Program TranslationFang Liu, Jia Li, Li ZhangICSE 2023 · 25 次引用
黄昏的海面,两侧是细线勾勒的悬崖