Starting New Project - Much Delphi Code, Few Delphi Programmers

Hi All,

We are potentially starting a new project that will be using a lot of our existing code base but also will require a lot of new development.

I have access to just a few Delphi programmers and many C# programmers.

I recently trialled training up an experienced C# programmer in Delphi to work on our stuff. The new language and working with modelling 3D electronics assemblies was too much at one time for a successful outcome.

We are now considering using a combination of Delphi and c#. so that we can use the pool of c# programmers available to us.

The question is do we create a C# project using new code and calling Delphi .dll’s or com servers, or do we have a Delphi project calling new C# code and using our existing codebase?

I welcome any advice or accounts of experiences in this area.



One thing to perhaps consider is a rest server although that may not be practical if it’s a desktop application. A lot of my Delphi projects have been webified in recent years (mainly using nodejs as a server app) but I had a situation on one project where I needed to use a Delphi library I was using previously. I ended up writing a rest server app in Delphi and exposing those library functions through rest calls. To make it a bit tidier, I then converted the Delphi rest server exe to a Windows service (using nssm).

I’m a bit late sorry Brian but you might want to investigate RemObjects Hydra. I haven’t used it myself but it’s been around for many years and is an application framework that allows mixing of Delphi and .NET code in the one application.

We host the .net framework runtime ourselves. There are a few little tricks (like ensuring OnIdle gets called if you are doing UI stuff, reverting the CPU Math co-processor flags to windows defaults before starting the hosted environment).

The other way to tackle it is to use registration-less COM - this works for .Net Core and is simpler than hosting .net yourself. We have not done UI stuff with this mechanism as yet but so far is working seemlessly.

We do the same, and have done for many years, FinalBuilder hosts the CLR so that we can write actions in any .net language.

Unfortunately .net core removed the hosting api that exists in .net framework, and replaced it with one that is pretty useless… we’re still trying to work out what we will do about this. We will probably need to write a lot of c# code ourselves to manage instances between delphi and .net core - stuff that com interop and reference counting just took care of before.

The .net framework is pretty much at a dead end (security updates only), and many library authors/vendors are already dropping support for it and focusing on .net core - so it’s something we will be focusing on in the new year.