Search Feedback

2752
votes

F# support

Scripting

-

-

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 (28)

  1. 53061fe272cfc9e5539c5dabd1cf9e14?d=mm

    Toni_zgz

    Feb 19, 2017 18:14

    It would be fantastic if we could program Unity script in F#. It's an awesome programming language and this would be an excellent feature that Unity could have.

  2. 49dad8e206f1e08bc9c83ecb5a8e9811?d=mm

    SouldomainTM

    Feb 05, 2017 02:58

    I'm already using F# with Unity. I never thought that there could be a much better language than C#. F# is now a must in my dev life.

    Here are some reasons to use F#: http://fsharpforfunandprofit.com/why-use-fsharp/

    So far, I didn't seem to have ran into problems using F# with Unity over the managed code API. However, if Unity officially supported F#. I could rest assure that what ever changed Unity may experience, they won't break F# code.

  3. D47349e912ad70125aabf86be0e1bbbc?d=mm

    arlevi09

    Oct 06, 2016 17:17

    Can we please get some sort of official statement on the possibility of F# first class support? With the improved .net 4.6 support in the 5.5 beta, I'm wondering if something like future F# support is on the radar. Would be complete amazing :). Thanks!

  4. 046a5387458421997498b83017d642ea?d=mm

    pblairmac

    Jun 23, 2016 02:41

    I've actually used F# to create a Unity game; it's not hard to do. You can see sample code here: https://github.com/psfblair/ConwayLife3D . However, having F# as a first-class language in Unity would be terrific.

  5. 7e2b8bf3ae78a88c2ccd49805df19ac4?d=mm

    MiloDCooper

    Jun 21, 2016 17:31

    This is a no-brainer, folks. F# is a phenomenal language -- this is coming from a great lover of C#, and a frequent coder of C++ libraries.

    I've been professionally programming Unity prototypes, graphics tools and low-level real-time graphics renderers for games, and full-scale web applications (e.g. SOAP services and REST APIs) for over ten years. I use F# for my Unity work regularly; it works beautifully under Mono, although I'd love to have F# 4.0 support for improved concurrency, which is one of many areas where F# really shines.

    Count me in for full support for F# in Unity!

  6. C93784afe6596724e65d8472c4684588?d=mm

    vis2k

    Jun 16, 2016 09:37

    F# kit is now on the Asset Store: https://www.assetstore.unity3d.com/en/#!/content/63652
    It automatically compiles your F# scripts in Unity, and tries to get as close to native support as possible. If you can't wait, then try it!

  7. 69737b148d81ff4555ebedde85679bd8?d=mm

    darkoverlordofdata

    Dec 08, 2015 20:54

    I was able to get these instructions to work: http://jacksondunstan.com/articles/3229

    In addition to Tuples, all language features in the MonoDevelop F# Tutorial project worked with the exception of the ParallelArrayProgramming module.

    Minor differences in environment:
    I'm running Linux Mint 17, Unity 5.2.2f1
    Instead of Xamarin, I use the standalone version of MonoDevelop from the Software Manager

  8. 69737b148d81ff4555ebedde85679bd8?d=mm

    darkoverlordofdata

    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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

  9. 7a7dd7c474060c07e09b9f5e856c3f9d?d=mm

    gilzoide

    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 https://github.com/eriksvedang/FSharp-Unity 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 https://github.com/gilzoide/FSharp-Unity , please check it out, fork it, send bug reports/feedback ^^

  10. 1f97dd72799b57b7bfe12003666df859?d=mm

    Nerve

    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.

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

Categories

All

(8816)

2D

(213)

Ads

(40)

AI & Navigation

(59)

Analytics

(88)

Animation

(292)

Asset Store

(212)

Assets

(485)

Audio

(152)

Cloud Build

(93)

Collaborate

(28)

Docs & Tutorials

(190)

Editor

(2034)

Everyplay

(13)

Game Performance Reporting

(11)

General

(796)

Graphics

(743)

GUI

(353)

Input

(143)

Licensing

(73)

Networking

(153)

Physics

(330)

Platforms

(399)

Profiling & Optimization

(66)

Runtime

(153)

Scripting

(990)

Terrain

(149)

WebGL

(130)