Skip to main content

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

Rowe, Reuben, Férée, Hugo, Thompson, Simon, Owens, Scott (2019) ROTOR : A Tool for Renaming Values in OCaml's Module System. In: 2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR). . pp. 27-30. IEEE Press ISBN 978-1-72812-271-7. E-ISBN 978-1-72812-270-0. (doi:10.1109/IWoR.2019.00013) (KAR id:80338)

PDF Author's Accepted Manuscript
Language: English
Download (254kB) Preview
[img]
Preview
Official URL
https://doi.org/10.1109/IWoR.2019.00013

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.

Item Type: Conference or workshop item (Paper)
DOI/Identification number: 10.1109/IWoR.2019.00013
Projects: [UNSPECIFIED] Trustworthy Refactoring
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Faculties > Sciences > School of Computing
Faculties > Sciences > School of Computing > Programming Languages and Systems Group
Depositing User: Simon Thompson
Date Deposited: 03 Mar 2020 10:31 UTC
Last Modified: 04 Mar 2020 12:25 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/80338 (The current URI for this page, for reference purposes)
Rowe, Reuben: https://orcid.org/0000-0002-4271-9078
Thompson, Simon: https://orcid.org/0000-0002-2350-301X
Owens, Scott: https://orcid.org/0000-0002-7437-4780
  • Depositors only (login required):

Downloads

Downloads per month over past year