ROTOR: A Tool for Renaming Values in OCaml's Module System

R. Rowe, Hugo Férée, S. Thompson, Scott Owens
{"title":"ROTOR: A Tool for Renaming Values in OCaml's Module System","authors":"R. Rowe, Hugo Férée, S. Thompson, Scott Owens","doi":"10.1109/IWoR.2019.00013","DOIUrl":null,"url":null,"abstract":"The functional programming paradigm presents its own unique challenges to refactoring. For the OCaml language in particular, the expressiveness of its module system makes this a highly non-trivial task and there is currently no automated support for large-scale refactoring in the OCaml language. We present ROTOR, a tool for automatically renaming top-level value definitions in OCaml's module system. To compute the effect of renaming, ROTOR relies on a novel concept which we call a value extension. This is a collection of related declarations in a program that must all be renamed at once. In practice, this leads to a notion of dependency: renaming a function 'foo' in module A (mutually) depends on renaming function 'foo' in module B etc. We describe important aspects of ROTOR's design, implementation, and evaluation on two large codebases: Jane Street's core library and its dependencies, and the OCaml compiler itself. In these real-world settings we find that some cases involve a surprisingly complex network of dependencies, and that the use of the PPX preprocessor system presents significant challenges.","PeriodicalId":393051,"journal":{"name":"2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR)","volume":"32 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/IWoR.2019.00013","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

The functional programming paradigm presents its own unique challenges to refactoring. For the OCaml language in particular, the expressiveness of its module system makes this a highly non-trivial task and there is currently no automated support for large-scale refactoring in the OCaml language. We present ROTOR, a tool for automatically renaming top-level value definitions in OCaml's module system. To compute the effect of renaming, ROTOR relies on a novel concept which we call a value extension. This is a collection of related declarations in a program that must all be renamed at once. In practice, this leads to a notion of dependency: renaming a function 'foo' in module A (mutually) depends on renaming function 'foo' in module B etc. We describe important aspects of ROTOR's design, implementation, and evaluation on two large codebases: Jane Street's core library and its dependencies, and the OCaml compiler itself. In these real-world settings we find that some cases involve a surprisingly complex network of dependencies, and that the use of the PPX preprocessor system presents significant challenges.
一个在OCaml的模块系统中重命名值的工具
函数式编程范式对重构提出了自己独特的挑战。特别是对于OCaml语言,其模块系统的表达性使得这成为一项非常重要的任务,并且目前OCaml语言中没有对大规模重构的自动化支持。我们提出了一个在OCaml模块系统中自动重命名顶层值定义的工具——ROTOR。为了计算重命名的效果,ROTOR依赖于一个我们称之为值扩展的新概念。这是程序中必须一次全部重命名的相关声明的集合。在实践中,这导致了依赖的概念:在模块a中重命名函数'foo'(相互)依赖于在模块B中重命名函数'foo'等。我们在两个大型代码库上描述了ROTOR的设计、实现和评估的重要方面:Jane Street的核心库及其依赖项,以及OCaml编译器本身。在这些现实世界的设置中,我们发现有些情况涉及到令人惊讶的复杂依赖网络,并且PPX预处理器系统的使用提出了重大挑战。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信