Hydra for interop with Delphi app


(Sandeep Chandra) #1

Is it possible to use .NET code written in F# with Delphi app using Hydra?

(antonk) #3


Yes, it is possible. Hydra can load any .NET assembly regardless of its original language (after all everything is compiled into IL) as long as this assembly exposes its API in a way expected by Hydra.

Hydra doesn’t call .NET code directly. Instead it communicates with it via plugins. Consider it as a communication surface of an assembly - Hydra doesn’t call assembly internals, instead it communicates via a set of defined API interfaces.

F.e. an assembly can expose this interface:

public interface IVisualizerControl : IHYCrossPlatformInterface

    bool BarsVisible { get; set; }
    void Randomize();
    void Sinus(Double range);

So Delphi app will be able to call method Randomize or set property BarsVisible regardless which exactly language was used to implement this interface (ie was it C#, F#, Oxygene or even Nemerle)


(Sandeep Chandra) #4

Is Hydra using COM to talk to .NET assemblies?

(antonk) #5

Yes, however it doesn’t require plugins to be explicitly registered in the system as COM servers

(Sandeep Chandra) #6

What about the assemblies created using Hydra? Do they need to be registered as COM servers?

(marc hoffman) #7

No. It’s all handled internally by Hydra. They don’t need to be registered system wide in the registry.

(antonk) #8

There is no need to register plugin or host parts of a Hydra-based application. This means that one can just copy the host and plugin app files to a completely clean host and runt them there w/o any additional actions

(Sandeep Chandra) #9

Thanks guys.

Just one more question, can I consume dotnet core libraries in Delphi using Hydra?

(antonk) #10

You can consume .NET Standard libraries (most of libs used in .NET Core are distributed as NuGet packages containing .NET Standard versions too).