Search Feedback

2514
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 (25)

  1. 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.

  2. 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!

  3. 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!

  4. 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

  5. 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'.

  6. 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 ^^

  7. 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.

  8. 4a4fe07aa2bc6360a2a25ebf7bfb48ad?d=mm

    Thorium

    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): https://github.com/eriksvedang/FSharp-Unity
    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.

  9. 80ed2f9e2351fb0020b404068c796dfe?d=mm

    Dodgetgo

    Dec 26, 2014 01:05

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

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

(8572)

2D

(207)

Ads

(30)

AI & Navigation

(51)

Analytics

(82)

Animation

(284)

Asset Store

(199)

Assets

(479)

Audio

(147)

Cloud Build

(91)

Collaborate

(27)

Docs & Tutorials

(181)

Editor

(1984)

Everyplay

(13)

Game Performance Reporting

(10)

General

(775)

Graphics

(721)

GUI

(341)

Input

(139)

Licensing

(70)

Networking

(150)

Physics

(317)

Platforms

(394)

Profiling & Optimization

(65)

Runtime

(148)

Scripting

(964)

Terrain

(146)

WebGL

(128)