One Tool, Many Languages: Language-Parametric Transformation with Incremental Parametric Syntax
James Koppel, Varot Premtoon, Armando Solar-Lezama

TL;DR
This paper introduces incremental parametric syntax, enabling source-to-source transformations across multiple programming languages with minimal reconfiguration, demonstrated through a multi-language refactoring tool and smaller transformations.
Contribution
It presents a novel approach called incremental parametric syntax for building multi-language source transformations, implemented in Haskell's Cubix system.
Findings
Transformations require little effort to adapt to new languages
Generated code remains readable and preserves original structure
Transformations effectively handle language corner-cases
Abstract
We present a new approach for building source-to-source transformations that can run on multiple programming languages, based on a new way of representing programs called incremental parametric syntax. We implement this approach in Haskell in our Cubix system, and construct incremental parametric syntaxes for C, Java, JavaScript, Lua, and Python. We demonstrate a whole-program refactoring tool that runs on all of them, along with three smaller transformations that each run on several. Our evaluation shows that (1) once a transformation is written, little work is required to configure it for a new language (2) transformations built this way output readable code which preserve the structure of the original, according to participants in our human study, and (3) our transformations can still handle language corner-cases, as validated on compiler test suites.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsData Analysis with R · Natural Language Processing Techniques · Mathematics, Computing, and Information Processing
