12

My company has a major problem. We developed an application consisting of more than 1.000.000 lines of code in Delphi.NET. Because of this we are stuck with Delphi 2007 and .NET 2.0.

As technology and usecases are moving on we need to migrate to another development platform. So far we tried several tools which promised to convert Delphi.NET to C# code - each of this tools had several problems like wrong indexing of strings (Delphi 1 C# 0) or when types were used to declare array boundaries.

After that approach we tried to decompile the Delphi.NET assembly - the code that comes back from that is hardly readable and has hundreds of helper functions which call into Borland specific assemblies. I already looked at the possibility to write a transpiler myself, but the ambiguous syntax of Delphi is too hard to implement in a straight forward grammar.

So now the great question, is there any possibilty left that does not include translating all of the code by hand? Or maybe a migration path which allows to migrate partially and stepwise?

6
  • a migration path which allows to migrate partially and stepwise? To me this sounds inviting; but of course I know absolutely nothing about your system except the line count. Is it modular, how is it partitioned etc..? Commented Jun 23, 2014 at 19:32
  • The application is splitted in about 200 units and serves old style WCF webservices on an IIS. The problem i see here is that although .NET allows language interop like combining VB and C# sourcefiles in one project - i don't know how this kind of interop could work for C# and Delphi.NET Commented Jun 23, 2014 at 19:39
  • Building the UI and calling all your Delphi DLLS via Interop can be a start. Then, start replacing each DLL function call with a proper method. Your result can be better loosely coupled system. Commented Jun 23, 2014 at 19:40
  • 1
    I think you'll need to re-write the application if you want a good job done. Commented Jun 26, 2014 at 11:26
  • 1
    Recommended read: Working Effectively with Legacy Code (Robert C. Martin) Commented Jun 26, 2014 at 13:28

1 Answer 1

4

Check out tools like: http://www.9rays.net/TourStep.aspx?TourStepID=21

While it may not be as simple as running your entire Delphi app through it and getting C# source in return, these kind of IL translators / decompilers are pretty accurate. My advice would be to run a few assemblies through and regression test to spot check accuracy. Chances are very high that you'll have to do some remediation in the generated code, but it's better than rewriting the entire application.

Also: check out http://blogs.msdn.com/b/danielfe/archive/2004/06/15/156087.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.