Search Unity

Resolved Unity engine in C#

Discussion in 'Scripting Dev Blitz Day 2023 - Q&A' started by tvardero, Feb 23, 2023.

  1. tvardero

    tvardero

    Joined:
    Apr 2, 2022
    Posts:
    5
    This is might be just a dream the unreachable, but still I'm curious to ask.

    C# has some features (unsafe, fixed, nuint type, etc) to work low-level.
    Could be considered to rewrite Unity part-by-part in C#?

    I'm talking about long-long term, like 5-10 yrs.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Yes, that is kind of happening now. At least, most new features are written in C# by default, with C++ where necessary.

    I don't expect the entire engine to ever be re-written, as the cost for that would be very high, but more and more of it is in C# now.
     
    Thaina, Nad_B, SolarianZ and 3 others like this.
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    For this I would like to feedback that official should try to make the feature as full C# as possible since there's burst to get maximum performance and in future we have CoreCLR that make it almost no reason to still write code at C++ land. I think should only write very thin C++ layer code at editor engine when it's not possible to make it full C# due to no C# low level api to integrate. One of the really important area official needs to solve is SRP for graphics rendering. Although SRP already open up a lot of graphics feature to C# but there are still have a couple of crucial features still lock at C++ land. I would like official continue to move more and more C++ land graphics code to C# SRP package and eventually become just very thin C++ layer code to just interact with low level graphics API.
     
    NotaNaN and JesOb like this.
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    I can't speak for graphics specifically, but there is general movement across many parts on Unity in this direction.
     
    optimise likes this.