Authors: Ruishi Li*, Bo Wang*, Tianyu Li, Prateek Saxena, Ashish Kundu
Abstract: Rust aims to offer full memory safety for programs, unlike C. We study how humans translate C to Rust, comparing their approach to automatic tools. Users produce safer Rust code with diverse strategies, often using zero-cost abstractions for temporal safety. The insights can guide future automations for C-to-Rust conversion.
Authors: Bo Wang, Ruishi Li, Mingkai Li, Prateek Saxena
Abstract: LLMs help translate code but often introduce semantic errors, which are hard to fix due to their black-box nature. We propose TransMap, the first tool to pinpoint these semantic mistakes in LLM-based code translations. TransMap translates Python to JavaScript and can pinpoint translation errors in programs, including Python libraries up to 1K lines. A preliminary user study suggests it can reduce debugging time by 70%, speeding up the process of LLM-based code migration.
Authors: Bo Wang, Aashish Kolluri, Teodora Baluta, Ivica Nikolić, Prateek Saxena
Abstract: Transpilers convert code between languages but often lack user customizability. Conventional transpilers are rigid, while neural ones allow some control but remain unpredictable. Both struggle with the "last mile" problem, failing on some code parts. We propose DuoGlot, a transpiler that incrementally refines translations based on user guidance while reusing existing rules. DuoGlot translates Python to JavaScript, achieving 90% accuracy on GeeksForGeeks benchmarks and outperforming existing tools.
Authors: Bo Wang, Teodora Baluta, Aashish Kolluri, Prateek Saxena
Abstract: Programming by Example (PBE) aims to synthesize programs from examples, but ensuring they generalize well is challenging. We propose SynGuar, a PAC-style framework for PBE, providing theoretical guarantees on generalization error. SynGuar determines the needed sample size, often just a few hundred examples for less than 5% error with 98% confidence. We instantiated the idea for PROSE and STUN-based synthesis by implementing program space counting for sample size computation.
Research supported by Crystal Center and Cisco Research