This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+2 votes

I have been trying to get some simple F# code to run but didn't succeed in reasonable time, so I have some questions about how the C# support is implemented:

Where is the byte code located that is run? I was expecting that a dll would be created that could be replaced with any other .NET-dll (which is the case in Unity for example), but while Godot does build a dll it doesn't seem to be used by the runtime. At least I could replace and remove all copies of that dll and it neither affected the game nor did Windows complain that the file was in use.

Is it possible to use .NET-dlls as NativeScript sources? I wouldn't expect it to be since afaik they aren't C-ABI compatible, but it has been said that the C#-support was built ontop of GDnative.

And last but not least, is there any technical reason why this is implemented as C#-support rather than .NET- / Mono-support? Yes, I know that C# is by far the most popular .NET-language, but it wouldn't be very helpful to lock out the other .NET-languages unless there is a reason to do so.

in Engine by (1,124 points)

1 Answer

+2 votes

Godot uses Mono to implement C# (Mono 5.2 or higher is required to build the editor with Mono support). The Mono support is implemented as a C++ module, which is not built by default (as it requires Mono to be installed on the system, since the Godot Git repository doesn't contain the Mono source code as it's too large).

C# support doesn't make use of GDNative, which only works with "native" libraries that can be compiled using e.g. C or C++.

To my knowledge, F# was never really tested, and is unlikely to ever be officially supported (even though it may work in the future).

More information about C# support in Godot can be found in this article. You can also take a look at this GitHub issue.

by (12,908 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.