Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Use "Go" for programming Unity scripts?

Discussion in 'General Discussion' started by SaturnsVoid, Sep 23, 2014.

  1. SaturnsVoid

    SaturnsVoid

    Joined:
    Dec 1, 2012
    Posts:
    22
    I know you can use C# but is there anyway to make it so i can code using Go?
     
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    There's a GCC port of the backend, but it's shifted towards their own implementation of the compiler. It would be a massive undertaking to make it available, I bet. An implementation that creates compatible bytecode is theoretically possible if you have a team of developers at hand to work on it for the next year ;)

    I'm happy using Go for server-side stuff personally.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,071
    Or you could write a translator that converts Go to C# prior to compiling.
     
  4. Dechichi01

    Dechichi01

    Joined:
    Jun 5, 2016
    Posts:
    39
    Then it looses the point. The only sensible reason to use Go instead of C# (besides language preference, which is not worth the trouble) is avoiding memory leaks and have better GC, beside other advantages, which one would not have by translating Go back to C# prior to compiling.
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,071
    For advantages involving bypassing the .NET/Mono framework, you would need a source license to implement it.
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    A bunch of the .NET/Mono issues are language independent. For instance, changing the language on top of .NET/Mono wouldn't fundamentally improve the GC. If it's going to run in .NET then it's going to end up as .NET bytecode and follow all of the rules that come along with that.
     
    wccrawford, Kiwasi and Ryiah like this.
  7. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,739
    the GC issues with C# are part of the .net mono implementation used in unity not the langauge or compiler its self. So go on the .net run time would suffer the same issues
     
  8. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,066
    Or you could use C#.


    :)