Search Feedback


F# support




F# is rapidly gaining popularity in the .NET community. There are several game developers who are using it outside Unity, and even Xamarin products now support it.

It would be nice to be able to use F# for scripting in Unity.

Comments (31)

  1. 69737b148d81ff4555ebedde85679bd8?d=mm


    Dec 08, 2015 06:35

    Unity seems to be missing System.Tuple, this is available in the dotnet framework since 4.0.
    Tuple is a core data type in FSharp, used for processing parameter lists. Code compiles ok, but I get a run time error on these 2 statements:
    let remaining = str.[1..]
    sprintf "values: %f, %f" x y

    TypeLoadException: Could not load type 'System.Tuple`2' from assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

  2. 7a7dd7c474060c07e09b9f5e856c3f9d?d=mm


    Oct 04, 2015 20:23

    Hey guys, I really like F#, and I think Unity should consider adding it as a officially supported script language (as a MonoScript), with auto compilation and stuff

    Thinking about it, I forked eriksvedang's repo, and added 2 EditorWindows for "click here to compile your F#s" functionality. It does call a System.Diagnostics.Process to compile the source files "Assets/Scripts/*.fs" and create the respective "Assets/Frameworks/*.dll", only recompiling if .fs is newer than it's dll

    The repo is , please check it out, fork it, send bug reports/feedback ^^

  3. 1f97dd72799b57b7bfe12003666df859?d=mm


    Mar 08, 2015 06:43

    F# is a very cool language, casting a wide net with paradigms, sprinkling on some syntactic sugar, and being far less verbose than C# in general, while maintaining readability. And for large projects like games, its functional-first attitude allows more much more effective multithreading and code safety.

    I am all for this. F# seems like a worthy successor to C#, which has run its course and done an excellent job doing so.

  4. 4a4fe07aa2bc6360a2a25ebf7bfb48ad?d=mm


    Jan 18, 2015 08:20

    F# compiles just to IL-dlls, so there shouldn't be problem using it.
    Here is instructions (for Mac Mono):
    And I tested, the same worked with Windows and Visual Studio.

    But there is no F#-integration in the Unity IDE: dropdown-menu could have f-sharp as one language, and the scripts could be auto-compiled.

  5. 80ed2f9e2351fb0020b404068c796dfe?d=mm


    Dec 26, 2014 01:05

    I Love the F# language and having it in unity would be a dream.

  6. F59b4b8fb96df7f5f721e715d43175da?d=mm


    Dec 10, 2014 17:07

    I'm also curious what IL2CPP will do to third party language support like F#.

  7. F59b4b8fb96df7f5f721e715d43175da?d=mm


    Dec 10, 2014 16:56

    It would be nice to see support for any .net language without having to import a dll. Maybe with some sort of editor plugin. Personally I'd like to see some sort of partnership with RemObjects to bring Silver (Apple Swift for .net) as a native supported language. Since I use Swift for my day job, it would be nice to also use it for Unity. There are a lot of Unity developers coming from the Mac platform. I think it would be cool to see both C# and Silver as primary languages. F# would be cool as an official language too. Functional languages are well suited for game design.

  8. A266827481c20c039c073fb93cea715e?d=mm


    Aug 27, 2014 05:46

    I wish I could vote down on this one. We already have 3 languages, all of which need work in terms of how well they play together, and how well mono deals with them. Once they are all 100% cross functional and bug free then yeah...

  9. 7e2b8bf3ae78a88c2ccd49805df19ac4?d=mm


    Jun 03, 2014 23:42

    F# works, though not perfectly; for example, I built a project using F# in which Seq.sort ran fine on Android, but it crashed under iOS. Wound up having to code a work-around in C# for iOS devices.

    Also, it would be great to have debugging capability for F# code. Building a DLL works fine, but you can't pause execution in code, that way.

    F# is the future, as far as I'm concerned. If you look at Swift (Apple's new programming language, meant as the successor to Objective-C), it looks and functions a lot like F#, even more than it does C#. Critical mass toward F# is building up and up; it's a very efficient, powerful, clean, and FUN way to code, and as good as C# is (great language), once you try F# for a short while, you can't go back.

    Here's hoping for full support for F# in Unity!

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea








AI & Navigation






Asset Store






Cloud Build




Docs & Tutorials






Game Performance Reporting


















Profiling & Optimization