Can MSIL be converted to Native code?

Asked

Viewed 56 times

2

I can convert a . NET Framework generated from a C# executable to a code Native code?

If yes, from this Native code, I can transcode to other languages like C++?

If not, there is a lower level of CIL so you can compile the same Assembly for other platforms?

1 answer

2


.NET Framework is one of the implementations of CLR, of CLI that in fact, even by virtue of specification generates a CIL as the question denotes.

The question ends up being, even involuntarily, tricky. It is possible, however, in general, it makes no sense to take a generated CIL to run with the . NET Framework in native code. Not that it does not give, but to give a useful result would give a monumental work and still have to be in specific parts.

But it is possible to have a CIL converted to native code.

First let’s make it clear that CIL does not run, it is converted to native code before running. But I understand that’s not what you’re talking about. I think you want to generate an executable with native code.

It is possible yes with .NET Native. The Mono already did that, and the Xamarin does where it needs to. These are other similar implementations, but not identical to . NET Framework.

With the .NET Core gets closer because it has fewer dependencies, but is still not quite the native. so much so that there is the CLR "ancient", the of Core and the native.

It doesn’t make much sense to take a native code and try to generate C++ code in it. But it is possible generate C++ code directly from CIL.

Now it only makes sense to use . NET 5 (Core).

Useful information:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.