One Tool, Many Languages: Language-Parametric Transformation with Incremental Parametric Syntax

James Koppel, Varot Premtoon, Armando Solar-Lezama
7/14/2017
18 citations
cs.PL

Official code: cubix-framework/cubix (115 stars, HTML, BSD-3-Clause, last commit 2026-05-22). 1 more implementation below.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
cubix-framework/cubixOfficial115HTMLBSD-3-Clause2026-05-22
cubix-framework/rwusOfficial9C–2020-08-05
BSD-3-Clause

The Cubix framework for multi-language transformation. Explained in the OOPSLA 2018 paper "One Tool, Many Languages: Language-Parametric Transformation with Incremental Parametric Syntax"

11511HTML, CSep 4, 20186 months agoBSD-3-Clause

The RWUS (Real World, Unchanged Semantics) benchmark suite for testing multi-language semantics-preserving source-to-source transformations

91C, JavaScriptSep 4, 20186 years ago

Similar Papers

Cite this paper

@article{koppel2017tool,
  title  = {One Tool, Many Languages: Language-Parametric Transformation with Incremental Parametric Syntax},
  author = {James Koppel and Varot Premtoon and Armando Solar-Lezama},
  year   = {2017},
  eprint = {1707.04600},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1707.04600}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1707.04600.svg)](https://codeofpaper.com/paper/1707.04600)

Discussion