Interoperability with .NET

Note: Repost to give greater detail

Here is my library on Julia & .NET Interoperability: GitHub - HyperSphereStudio/JULIAdotNET

It uses the C-Interface of both languages to translate between the languages very quickly compared to normal server/client based systems.

 Julia.Init();
  JLFun fun = Julia.Eval("t(x) = sqrt(x)");
  double result = (double) fun.Invoke(2);
  object dotNetObject = fun.Invoke(3).Value;
  Julia.Exit(0);  

It is very new but it has support for various built in Julia features such as a JLArray to allow manipulating jl_arrays neatly.

You can also work with .NET from Julia (Experimental at the moment). It utilizes .NET reflection

In C#:

public class TestClass{
    public long g;
    public TestClass(long g) => this.g = g;
}

Working from Julia:

sharpType = SharpType("TestClass")  #Retrieve Type
sharpCon = SharpConstructor(sharpType, 0)  #Get Constructor at Index 0
o = sharpCon(6) #Create Instance
sharpField = SharpField(sharpType, "g") #Get Field
println(sharpField(o)) #Get Field Value
9 Likes