No F# for Unity / HoloLens

296 views
Skip to first unread message

Paul Blair

unread,
Apr 9, 2017, 4:26:07 PM4/9/17
to fsharp-o...@googlegroups.com
After starting on a Conway 3D Game of Life for HoloLens in F#, and experiencing a crash, I filed a bug with Unity. I got bad news from them:

"The error occurs because IL2CPP limits the recursion depth of generics to seven levels currently. Unfortunately, this is is not an error which is reported well the version of Unity you are using. The most recent Unity patch releases handle this error case better by throwing a managed exception.

"However, that does not correct the root issue. Often with F# code we see deeply nested generic type and method hierarchies which hit this limit. Can you use a different library, not written in F#? Since F# is not a supported scripting language in Unity, we don't plan to actually correct this bug."

This effectively means F# is out for writing HoloLens apps, or even Unity apps at all, since Unity plans to move its scripting back-ends to IL2CPP entirely in the near future.

If you think it's worth trying to get Unity to change their mind, you can upvote the bug here <https://issuetracker.unity3d.com/issues/il2cpp-windows-store-build-results-in-access-violation-crash-const-methodinfo-resolves-to-null>.

Paul Blair

unread,
Apr 9, 2017, 4:48:18 PM4/9/17
to fsharp-o...@googlegroups.com
I was wrong; they've marked the bug resolved so you can't upvote it, but you can vote for F# support in Unity here: <https://feedback.unity3d.com/suggestions/f-support >.

Eugen Hotwagner

unread,
Apr 10, 2017, 4:55:21 AM4/10/17
to fsharp-o...@googlegroups.com
Are you sure that they want to go solely with IL2CPP in the future?

AFAIK they are bringing the Mono part up to current .net https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-and-some-players-on-5-6-0b5.454387/ and the rest is IL2CPP. 

--
--
To post, send email to fsharp-opensource@googlegroups.com
To unsubscribe, send email to
fsharp-opensource+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fsharp-opensource
---
You received this message because you are subscribed to the Google Groups "F# Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fsharp-opensource+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Blair

unread,
Apr 10, 2017, 11:31:16 PM4/10/17
to F# Discussions
This thread from last December indicates that they're still intending to drop the .NET scripting back-end, though not "in 5.6, 5.7 or even 5.8" <https://forum.unity3d.com/threads/official-poll-whats-preventing-you-from-switching-to-il2cpp-scripting-backend-on-windows-store.446219/>. The original "future of scripting in Unity" blog post also suggested that this was the strategy.

I've had issues trying to compile a simple F# project for the Windows Store using the .NET back-end as well. Even though I can run in the Unity editor, when weaving the FSharp.Core.dll assembly the Unity build fails with a failure to resolve System.Net.WebClient Exception while processing  Microsoft.FSharp.Control.WebExtensions/downloadAsync. I'm not sure quite what to do about this; if I can remove that blocker maybe it's possible to move forward with the .NET scripting backend for now -- though there I can't say I understand how the F# IL ultimately gets translated into something that would get compiled down to a Unity UWP application for the Windows Store.


On Monday, April 10, 2017 at 4:55:21 AM UTC-4, Eugen Hotwagner wrote:
Are you sure that they want to go solely with IL2CPP in the future?

AFAIK they are bringing the Mono part up to current .net https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-and-some-players-on-5-6-0b5.454387/ and the rest is IL2CPP. 
On Sun, Apr 9, 2017 at 10:48 PM, Paul Blair <cir...@phobot.net> wrote:
I was wrong; they've marked the bug resolved so you can't upvote it, but you can vote for F# support in Unity here: <https://feedback.unity3d.com/suggestions/f-support >.

On Sun, Apr 9, 2017 at 4:26 PM, Paul Blair <cir...@phobot.net> wrote:
After starting on a Conway 3D Game of Life for HoloLens in F#, and experiencing a crash, I filed a bug with Unity. I got bad news from them:

"The error occurs because IL2CPP limits the recursion depth of generics to seven levels currently. Unfortunately, this is is not an error which is reported well the version of Unity you are using. The most recent Unity patch releases handle this error case better by throwing a managed exception.

"However, that does not correct the root issue. Often with F# code we see deeply nested generic type and method hierarchies which hit this limit. Can you use a different library, not written in F#? Since F# is not a supported scripting language in Unity, we don't plan to actually correct this bug."

This effectively means F# is out for writing HoloLens apps, or even Unity apps at all, since Unity plans to move its scripting back-ends to IL2CPP entirely in the near future.

If you think it's worth trying to get Unity to change their mind, you can upvote the bug here <https://issuetracker.unity3d.com/issues/il2cpp-windows-store-build-results-in-access-violation-crash-const-methodinfo-resolves-to-null>.

--
--
To post, send email to fsharp-o...@googlegroups.com

To unsubscribe, send email to

For more options, visit this group at
http://groups.google.com/group/fsharp-opensource
---
You received this message because you are subscribed to the Google Groups "F# Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fsharp-opensou...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages