{"title":"一个在OCaml的模块系统中重命名值的工具","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":"{\"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}","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}
ROTOR: A Tool for Renaming Values in OCaml's Module System
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.