r/delphi • u/Delphi2C • 7d ago
Project Delphi to C#/C++ migration: Are traditional code converters still useful in the age of AI?
I have been developing rule-based Delphi source code converters for many years, including Delphi2Cpp and Delphi2C#.
Recently, I published a free Delphi-to-C# converter, D2CSharp, together with a Delphi-compatible C# runtime library on GitHub:
https://github.com/dm-e/D2CSharp
I have just released a substantial update with improvements to the converter, additional RTL functionality, and more tests.
D2CSharp can be used free of charge to translate your own Delphi code. The runtime library is open source, and contributions are very welcome. The converter itself is distributed as a free executable, but its source code is not included.
However, I would also like to start a broader discussion.
Does it still make sense to develop traditional source code converters now that AI can translate code?
I am not interested in reopening the general debate about whether migrating away from Delphi is a good idea. That has been discussed many times.
Instead, I am interested in the practical question: Once a developer has decided to migrate an existing Delphi application to C# or C++, what is the best approach?
Traditional rule-based converters aim to produce consistent and reproducible translations. AI offers different possibilities, particularly when restructuring code or replacing Delphi-specific constructs with native features of the target language.
But how do these approaches compare when converting larger projects with many interconnected units, complex types, pointers, and dependencies on the Delphi RTL?
Can AI alone handle such migrations reliably, or is there still a useful role for dedicated converters, possibly combined with AI-assisted refactoring?
I would be particularly interested in hearing from developers who have actually attempted such migrations.
What worked, what caused problems, and which approach would you choose today?
And if you are interested in experimenting with D2CSharp or contributing to its free runtime library, you are very welcome to join the project.
1
u/rmagnuson 6d ago
If you're doing a 1:1 conversion, presumably because they're both OO languages, do you still get the same efficiency in the target language? I would imagine that AI has the ability to extrapolate from the code that is fed to it and come up with a refractor that takes into account any little tricks that a Delphi Dev might use to get better performance and translate those to the target language. Just a thought.