Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity3D Sripting - .NET Core 1.2 replacement of Mono

Discussion in 'Scripting' started by IvanFarkas, Nov 6, 2016.

  1. IvanFarkas

    IvanFarkas

    Joined:
    Nov 6, 2016
    Posts:
    1
    Is it safe to assume that .NET Core 1.2 will replace Mono for Unity3D scripting in Spring 2017, due to it's .NET Standard 2.0 support?
     
    roger-wang likes this.
  2. scionwest

    scionwest

    Joined:
    Dec 19, 2009
    Posts:
    26
    I doubt that's a safe assumption to make. There is a significant amount of engineering involved by the Unity team to handle that - I wouldn't ever assume a product will replace it's core tech unless they tell you so.
     
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    No.

    Its not safe to assume Unity will ever update Mono. On the road map the .NET profile upgrade is listed as research. Which means they haven't actually figured out how to do it yet. I believe its tied in deeply with getting IL2CPP rolled out across all platforms. So we won't see any changes until at least that point.

    This. Unity uses a heavily modified version of Mono to make it run on every single platform that Unity is on. So its not just a case of replacing a couple of libraries. A straight up replacement may actually make things worse.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Well...about that....

    --Eric
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Colour me impressed. It appears much closer then I thought. I will have to give it a try.
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,921
    We will not be using .NET Core to replace Mono. The open-source runtime is not ported to enough platforms for Unity, and it doesn't have the embedding hooks that we need (Mono fulfills both of those requirements). Also, the class library profile in .NET Core doesn't have a number of things that we support currently, and others it moves around, effectively breaking all previous Unity projects - so using it is not feasible.

    We will likely support the .NET Standard though. Plans are still up in the air as we work through the technical issues. Please watch that experimental scripting previews forum for more details. We will continue to post there when we have new builds to drop with added functionality.
     
    Thaina and Kiwasi like this.
  7. scionwest

    scionwest

    Joined:
    Dec 19, 2009
    Posts:
    26
    Does the editor running in 4.6 mean that we'll get Roslyn support? I'm seeing some significant performance differences from what I'm used to in Roslyn based apps, event those running .net 2.0, vs what I'm getting in the runtime provided by Unity3d. In some places, the runtime in Unity3d is 5-10x slower.
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,921
    @scionwest

    The latest experimental preview builds we have shipped do not use Roslyn. Xamarin has just merged Roslyn support into their master branch of Mono, so using it in the future with Unity is a possibility. We're not sure yet whether or not the first release of the upgraded .NET runtime will ship with Roslyn or not. We're currently evaluating that possibility.

    We do plan to use Roslyn at some point, it is just a question of when.
     
  9. scionwest

    scionwest

    Joined:
    Dec 19, 2009
    Posts:
    26
    Good to know!
     
  10. mossyblog

    mossyblog

    Joined:
    Jun 29, 2013
    Posts:
    24
    Meh, I'm keen to see more vNext .NET support... .....but...... I'm also self-aware (being former .NET product manager) historically following Microsoft's "adventures" in .NET reform typically can be messy during the early stage(s)... I like how the Unity3D team just carves out their own space in the .NET/C# ecosystem and is happy to incrementally focus on the good of Unity3D, not the other distraction(s).

    So take your time ;) imho ( as we used to say "its not a sprint, its a marathon")
     
  11. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    I was in the microsoft's camp, but the only nice thing about Microsoft .NET is the .net native, but it's UWP and Store only... so: ouch (i think it's possible to do stuff with it, I can't tell for sure). Both have SIMD, but mono has SIMD since 2010, so I could live with that and the c++ aot compiler (il2cpp).
     
    Last edited: Jan 3, 2017
  12. Timelog

    Timelog

    Joined:
    Nov 22, 2014
    Posts:
    528
    native .NET is not UWP or store only..... UWP is just one of the many option you have with the .NET framework. It also still supports Windows Forms apps, Console applications, Web applications (including Webforms, MVC, etc.), WPF and more and there is no one forcing you to use the Windows Appstore for any of them.
     
  13. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    Are you sure? I've only seen it in UWP compilations.
    Like in this video I made:


    I was about to check again the console applications, but VS (much that I like it) just broke again.
     
  14. Timelog

    Timelog

    Joined:
    Nov 22, 2014
    Posts:
    528
    I thought you literary meant native .NET, didn't event know .NET Native existed :eek: Well, learned something today :D
     
  15. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    Though you almost got me, I would even a conceive it even as windows only product (but W10 is being pushed). I think they will expands the OSs repertory (but there are no signs about it). If I were wrong, then I can't just be wrong, it's all aligned.

    I dropped the SIMD library in the Unity's "4.6 NET" test version and it works! It chews like crazy through byte values. (I like more the System.Numerics but the most crucial part is there).
     
    Last edited: Jan 3, 2017