In this article, we will reflect on how to choose the target for a migration from RPG. RPG is a programming language that has been successfully used for decades to create a lot of software. Nowadays there are a large number of very large and valuable applications written in RPG, and their owners are wondering: should we move to another language?
There are several good reasons to consider this: in particular the lack of RPG developers and the interest in moving to the cloud. Yet, this is not an easy choice to make, so in this article, we’ll study the problem from different perspectives and share our findings. Hopefully, this will give concrete arguments and guidance to the many considering how to keep their software valuable for the coming decades.
Why migrate from RPG to another programming language?
We have already listed in the introduction the two more common reasons for considering migrating from RPG to another language: the lack of RPG developers and the interest in moving to the cloud. Let’s look at these two reasons individually.
RPG does not run on the cloud. If we look at AWS, Azure, and Google Cloud, none of them supports natively RPG applications. This means that RPG code, as-is, cannot be easily run on the cloud. In other words, by sticking to RPG one has to own, operate and maintain their own hardware. Scalability is more difficult as it requires buying individual IBM i series machines. The problem is when you would need one machine and a half, or when you would need a few more machines but just for a short period of time. Without the cloud, you do not have access to that flexibility.
There are additional reasons for wanting to migrate from RPG, like the uncertainty about the future of the IBM i Platform, but we think it makes sense to focus on these two.
How to migrate your codebase? Manual vs Automatic Migration
Most companies think that migrating from RPG can be done only by rewriting the code into another language, line by line. For large applications, this is simply unsustainable, and therefore many companies do not even look into migrating to another language.
We think more companies should be aware of the fact that it is instead possible to perform automatic or semi-automatic migrations to translate the business logic expressed in RPG into another language. This removes the possibility of human errors and greatly reduces the effort needed, bringing down the time necessary for the migration and the costs.
Automatic migrations can be performed by using a transpiler. We know about this topic as we have written several transpilers, including transpilers from RPG to other programming languages. If you want to learn more about how we design transpilers you can find more in this article: How to write a transpiler.
What is written in RPG?
RPG has been used to write mostly ERP or enterprise software. According to our study, two-thirds of the applications written in RPG belong to this category.
This is something to take into account when considering the language to migrate to: it should be a language well suited for writing ERP software.
RPG is also commonly used to write financial software, with roughly 30% of RPG applications falling in this category.
What characteristics should a candidate programming language have?
When picking a good candidate language for migrating away from RPG we should, first of all, consider a language that allows us to solve the two main challenges we have with RPG: lack of developers and lack of support for deployment in the cloud.
Let’s see which languages we can consider based on these two factors.
If the reason for migrating from RPG is the lack of developers, we should consider only languages that have at least 10 times the number of RPG developers and languages which are ideally gaining popularity, so that the trend indicates that we will be able to find developers familiar with that language in the midterm.
To find popular programming languages we proceeded in this way:
- We first of all compiled a list of candidates. To do this we looked at several resources, including the TIOBE index.
- We then excluded the languages which were clearly not suited for the task as they were not general-purpose languages (for example, we excluded SQL, HTML, CSS).
- Finally we estimated how many developers were familiar with that language. To do that we used various sources: from LinkedIn to surveys and articles. Assessing the number of developers who are familiar with a certain programming language is very difficult, but for our needs, it is sufficient to get the right order of magnitude, and that is much easier.
The result of this process is the following table:
|Millions of developers||At least 10 times more developers than RPG?|
|RPG||0.06 – 0.08||No :D|
Ability to run on the cloud
The second aspect to consider is which languages can “run in the cloud”. To do this we looked into which languages are supported by the three main cloud providers: AWS, Azure, and Google Cloud. We then picked the languages which are supported by at least two cloud providers, as this gives us some reassurance that at least one major provider may offer support in the mid-term period. I.e., even if one provider removed support, we will still be left with at least another provider.
This is the result we got:
|AWS||Azure||Google Cloud||Supported by at least 2 cloud providers|
Which candidates are worth considering as a replacement for RPG?
Based on what we have seen, let’s see which languages are both popular and have sustainable support for the major cloud providers.
Here there are our results:
|Popular||Cloud support||Worth considering?|
So these are the languages that we believe it makes sense to consider when migrating away from RPG:
In the next section we will discuss each of these languages individually.
How to pick the right target language?
We have seen that there are 5 general-purpose programming languages that are used by millions of developers and supported by cloud services providers. This however does not tell us anything about them being a good fit for replacing specifically RPG. This is what we are going to dive into in this section.
The Python language has a vibrant community, and, despite being over 30 years old, it is growing in popularity.
What are some of its strong points?
First of all, it is reasonably easy to learn. We think this in particular a good factor for it to be used as a replacement for RPG. The reason is that many RPG developers can be considered good analysts who also double as developers. This is to say that their domain knowledge, that is, their ability to understand requirements and provide business solutions, is often more important than their knowledge of the latest programming paradigm. For this kind of user, Python would be a great fit. We expect people who are today defining business logic for their ERP written in RPG to prefer Python with respect to the alternatives in this list.
A second advantage of Python is the rapid development and good productivity that comes from it. This is particularly useful when working in close contact with clients and having the need to prototype solutions quickly to quickly obtain feedback from the clients. Again, a great fit for developers writing business logic inside ERP systems.
As a testament to the good fit of Python for writing ERP software, we can point to existing ERP platforms being written in Python, notably Odoo.
A weakness of Python is instead absolute performance. In general, programs written in Python are not as efficient as programs written in Java or C#. That said, this problem can be circumvented through the adoption of appropriate C extensions, and in this way, libraries like Numpy allow us to obtain good performance also in Python.
Java is a very stable language, created in 1995, and used by millions of developers. It has a very large ecosystem: there are many different great IDEs for Java, and an incredible amount of open-source libraries and frameworks. All of these characteristics make Java a very solid and reliable choice.
Java has arguably been the primary language for writing enterprise applications in the last decades. It is a language that helps prevent errors and offers good performance. Late innovation, like GraalVM and Quarkus, permits to make Java even faster.
In general, we would suggest moving from RPG to Java if you are writing applications in the finance domain, where catching errors and having good performance can be particularly important. In that field the need for rapid prototyping can not be as important, so the fact that Java requires more “ceremony” for writing applications compared to Python would not be a hurdle.
C# is not a language on the rise, but at this stage, there are definitely many young developers learning it.
Compared to other languages C# has traditionally been connected to one particular operative system: Windows. This has changed in the last few years.
A platform that demonstrates the ERP solutions which can be written with C# is Microsoft Dynamics 365 Business Central (formerly Microsoft Dynamics NAV).
Despite its advantages, probably in many circumstances, Java would be a better choice than C#, unless your organization is specifically oriented to the Windows OS, or other Microsoft solutions, or if you have already a large number of C# developers in-house. If that is your situation, you can move from RPG to C# confidently.
- The instability of the ecosystem: new building tools and frameworks emerge and are abandoned, and the best practices vary quickly. This is not an ideal environment for companies looking for stability. The companies that today are considering moving from RPG are typically favoring stability over being constantly on the edge of new innovations.
- The language is not designed with solidity in mind, but more for quick prototyping and for building applications where errors have limited consequences. In other words, if a button does not display in the right place it is not a big deal, while if an invoice cannot be generated that would be an issue.
Go is a language with growing popularity, and used by a large number of developers, especially in Asia.
Go is a system language, typically used to write efficient code with high parallelism. We did not find many examples of enterprise software being written using Go. Go is also a rather low-level programming language.
Go does not seem to have such a strong ecosystem as the other languages considered, and we cannot find a reason to recommend migrating from RPG to Go. We believe that, of the candidates we considered, Go would be the worst choice in most cases.
What to do next?
If you are considering migrating from RPG to another language, we hope that the information presented was useful to you. We would love to hear your feedback.
At this stage, you may be able to make a choice and decide to migrate from RPG to Python or to Java. In that case, great! You may be interested in learning how we typically plan for language migrations. If that is the case you may want to read this article: Audit & Analysis for Language Migration Project.
If you have restricted the choice to a few candidates and you would like to discuss the alternatives with us, feel free to reach us and we will help you reach a decision.