一种工具,多种语言:增量参数转换的参数转换
One Tool, Many Languages: Language-Parametric Transformation with Incremental Parametric Syntax
摘要:
我们提出了一种新的方法来构建源到源的转换,可以运行在多种程序设计语言,基于一种新的方式表示程序称为增量参数语法。我们在Cubix系统中的Haskell中实现了这种方法,并为C,Java,JavaScript,Lua和Python构建了增量参数语法。我们展示了一个运行在所有这些转换上的全程序重构工具,以及三个较小的转换,每个转换运行在几个转换上。我们的评估表明,(1)一旦编写了转换,几乎不需要为新语言配置它;(2)根据我们人类研究的参与者,以这种方式构建的转换输出可读代码,保留原始结构;(3)我们的转换仍然可以处理语言的角落情况,如编译器测试套件所验证的。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。