Friday, December 11, 2015

Nemerle or FSharp?

Both are comparable functional DotNet languages. I want to use one of them in Unity. So I worked through this tutorial -MAKING AN "ANGRY BIRDS" STYLE GAME - PART 1 with each language, plus C#. Here are my conclusions.

C#

  • Baseline. Everything works and can target android.

F#

  • I couldn't the get mouse to work correctly
  • It takes more boilerplate to interop with components (1)
  • I can't use latest binaries in Unity, due to Unity's funky 3.5ish framework level
  • But - code completion and compilation works in MonoDevelop 

Nemerle

  • Interop is transparent (2) and mouse works + touch works on android
  • The binaries are current - a new drop yesterday included the 3.5 framework
  • I can edit in Code and compile using Nant. No *.sln files to deal with.

I never finished the FSharp version, because I couldn't get past the mouse issue.
NOTE: This is fixed. See my next post
 If I were to use FSharp, it would be as a library that does not interface directly with Unity. I'd need a CSharp layer. Maybe if I actually wanted to use MonoDevelop. But I prefer Code, and debugging for Unity is working now.

I think I prefer Nemerle syntax, it doesn't seem as dense. I can even use white space with #pragma indent. But more importantly, Nemerle seems to work better with Unity, and I can use the latest binaries when targeting android.

It's a no brainer. For my purposes, Nemerle wins.


1 - Defining a Unity component property in F#

[<defaultvalue>][<serializefield>]
val mutable catapultLineBack:LineRenderer

2 - Defining a Unity component property in Nemerle

public mutable catapultLineBack: LineRenderer




No comments:

Post a Comment