xsharp.eu • .NET Native
Page 1 of 1

.NET Native

Posted: Wed Feb 03, 2021 6:19 pm
by Plummet
Hi Robert,
Does X# support .NET Native yet?
Thanks,
Don

.NET Native

Posted: Wed Feb 03, 2021 6:52 pm
by robert
Don,
.Net Native is not something the compiler does.
I know that Microsoft seems to suggest that the compiler does it, but it actually is an extra step that is running after the application is compiled. This is part of the "Publish" step inside MsBuild
This topic describes the process:
https://mattwarren.org/2018/06/07/CoreR ... e-for-AOT/
In the image you can see that the starting point for the .Net native compilation is the DLL with IL (Intermediate Language) produced by the C#, VB or F# compiler. You can add X# to this as well because our assemblies are virtually identical to C# since we are using the same underlying compiler technology.
The challenges here are:
- The Toolchain (msBuild support) to generate this. Once we have the MsBuild support for .Net core implemented, then you can do this too.
- Late bound code depends on reflection. That may be a problem with .Net native (see https://docs.microsoft.com/en-us/dotnet ... net-native)

I find this article very informative:
https://www.codeproject.com/Articles/52 ... -3-1-Proje

Robert

.NET Native

Posted: Thu Feb 04, 2021 5:10 pm
by Plummet
OK Robert, thanks for your prompt reply.

It was just that, having a preference for fully compiled object code, I was reading about native compiling of .NET code recently and had seen you mention it in this doc back in 2015
https://www.xsharp.eu/itm-help/why-xsharp

.Net Native support is planned as well.

Thanks for the links, I will have a look.
Keep up the good work -
Don