https://doi.org/10.71352/ac.57.245
Refactoring concurrent Erlang applications for distribution
Abstract.
Applications require more and more resources. Distributed software can take advantage of today’s easily accessible hardware
and allow for easy scaling. Software development might reach the point where originally concurrently written portions of code
should be transformed to work in a distributed manner. This process is tedious and error-prone when done manually.
Erlang is a functional programming language built for concurrent and distributed programming. In Erlang’s actor model of concurrency,
independent processes running on nodes communicate using message passing.
In our paper, we describe ways to transform concurrently written Erlang code to introduce distributed functionality,
while preserving the overall semantics of the program. We define refactorings to transfer a selected process to another node,
along with its registration if the process was registered. Using static analysis, we can discover and transform the parts of the
code that refer to the moved process. This way, we can modify the send expressions, so that the communication between the
processes can remain intact.
We define transformation schemes along with their preconditions and necessary compensations. We have implemented the basic cases
of the transformations using the open-source RefactorErl static analyser and refactoring tool and used it for the validation of the schemes.
