Godot-proposals: Add .NET Core support

Created on 3 May 2020  路  10Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
Support .NET core and also Mono for different types of games

Describe the problem or limitation you are having in your project:
In issues 2 years old you said that .NET core is too young, but now after to years you should implement it, because of better performance and platform independent.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Microsoft is now saying that .NET core is the main implementation of C# so it should be great to implement it. It is also easier for users because Visual Studio now comes with .NET core.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
User will choose type of project and there will be .NET core that will support its compilers and libraries and also writing code in Visual Studio.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, I am sure many users will be very happy if you implement it so it will be used very much and sadly for you this implementation of .NET core will not be few lines of code for you.

Is there a reason why this should be core and not an add-on in the asset library?:
I thing t would be impossible to implement this in assets library because of it鈥檚 size.

Thanks,
Martonec

mono

Most helpful comment

Correcting some misunderstandings of .NET Implementations:

  1. The obsolescence of .NET Framework happens right after the GA release of .NET Core 3.0, not .NET 5. This is because the last release of .NET Framework (4.8) shares the same api level (.NET Standard 2.0) with .NET Core 2.x, and will never support .NET Standard 2.1 that later .NET Core and Mono supports.
  2. .NET Framework is obsoleted, not unified to .NET 5. And .NET 5 is a later rebranded version of .NET Core 3.1 and irrelative to .NET Framework 4.8 in fact. What .NET 5 directly "inherits" from .NET Framework is nothing but the version number.
  3. Mono is a part of .NET 5 for its AOT compiler, which is widely used in iOS projects (Xamarin and Unity), and its CLR, which runs slower but has less file size than .NET Core, but it will not have extra API collection or TFM. It will be only the alternative runtimes to Core CLR.

Conclusion:

  1. The API support of .NET Framework is an obsoleted solution, even for now, months before .NET 5's GA release.
  2. It have to support .NET Standard 2.1 (and .NET 5 in the future), regardless of what runtime is used.

All 10 comments

See also #339.

See also #339.

Thanks but that issue is for NetStandart that is also in mono version. I want to add Net core because of better performance, more libraries and that it comes with visual studio

.net Core is supposedly being unified with the mainline framework when it reaches version 5. I think we should wait until this happens to support Core, since by that time all new projects will likely be targeting it. ETA for version 5 is the end of the year.

Mono will support .NET 5 (the re-branded .NET Core), so we should be able to migrate to that at some point. Whether it will be possible to do that for Godot 4.0 or not I cannot say yet.
We're not going to switch to CoreCLR though. We will keep using the Mono runtime.

Last time I checked, .NET Core doesn't run on Android.

On the Microsoft / .NET 5 side of thing, the idea is that .NET 5 will basically unify .NET Framework 4.8, Mono 5.0, and .NET Core 3.0.

Mono has been bringing code over from .NET Core for a while and both sides are kinda completing that work with .NET 5, bringing the two compiler technologies together. The AOT compiler from Mono / Xamarin will be added and enabling the mobile technologies to run on top of the JIT is coming with .NET 5.

The Common Language Runtime implementation will be unified across Mono and .NET Core and the library system on top will be honed to different scenarios. There will be a set of libraries for mobile, a set of libraries for microservices, a set of libraries for desktop development and so on.

They don't see Mono going away though, as there's still big applications that depend on Mono and may never port to use .NET 5.0.

As for the mono side of things, I have a hard time finding anything on what's coming and what the plans are for the future.

Correcting some misunderstandings of .NET Implementations:

  1. The obsolescence of .NET Framework happens right after the GA release of .NET Core 3.0, not .NET 5. This is because the last release of .NET Framework (4.8) shares the same api level (.NET Standard 2.0) with .NET Core 2.x, and will never support .NET Standard 2.1 that later .NET Core and Mono supports.
  2. .NET Framework is obsoleted, not unified to .NET 5. And .NET 5 is a later rebranded version of .NET Core 3.1 and irrelative to .NET Framework 4.8 in fact. What .NET 5 directly "inherits" from .NET Framework is nothing but the version number.
  3. Mono is a part of .NET 5 for its AOT compiler, which is widely used in iOS projects (Xamarin and Unity), and its CLR, which runs slower but has less file size than .NET Core, but it will not have extra API collection or TFM. It will be only the alternative runtimes to Core CLR.

Conclusion:

  1. The API support of .NET Framework is an obsoleted solution, even for now, months before .NET 5's GA release.
  2. It have to support .NET Standard 2.1 (and .NET 5 in the future), regardless of what runtime is used.

I completely agree!

(Disregard the accidental close/reopen above.)

@hebedombiu Please don't bump issues without contributing significant new information. Use the :+1: reaction button on the first post instead.

It would be cool to be able to use CoreCLR with Godot as it seems RyuJit is always faster then Mono
https://github.com/nxrighthere/BurstBenchmarks

As far as AOT with CoreCLR https://github.com/dotnet/runtimelab/tree/feature/NativeAOT is making progress although its still experimental.

With .Net 5 and Godot 4 release, maybe it will be possible to allow users to choose whether they want to use CoreCLR or Mono. At least for desktop platforms CoreCLR seems to be a better way to go.

.Net 5 also makes improvements to native interop
https://devblogs.microsoft.com/dotnet/improvements-in-native-code-interop-in-net-5-0/

Was this page helpful?
0 / 5 - 0 ratings