Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Discussion New language specifically for ECS Systems

Discussion in 'Entity Component System' started by Spider-Kyleo, Apr 19, 2023.

  1. Spider-Kyleo

    Spider-Kyleo

    Joined:
    Mar 3, 2021
    Posts:
    3
    So I was basically working on a custom programming language in Rust. After some work, I decided to check out a project using ECS I made, and I felt like C# didn't fit the style, so I thought what would the unity community think about custom language for ECS?

    I am thinking something along the lines of
    1. Create a Component asset
    2. Add the needed data via something similar to how you add variables in Visual scripting
    3. Create a System asset
    4. Add the component types similar to how you add variables to the component asset, but make it able to add aspects and ReadOnly/ReadWrite containers
    5. Create the base script in a way like this (yes, its meant to be coded in a way similar to most modern languages)
      Code (CSharp):
      1.  
      2.      override void OnUpdate()
      3.      {
      4.            //Moves the player forward
      5.           player.position += 1;
      6.      }
      7.  
    6. Run the game, and you should be done
    Also, you should also be able to with this new language
    • Create aspects similar to how you create systems
    • Be able to Define any interfaces needed for ECS objects in a similar way to how you define variables for them
    • Get either a built-in editor for coding in this new language or have an addon for an external editor
    • Instantly have burst enabled for scripts that support them(although you could have the option to disable it)

    So what do y'all think?
     
  2. ezgif-1-15c5157144.gif
     
    OndrejP, Ryiah, Quit and 6 others like this.
  3. Quit

    Quit

    Joined:
    Mar 5, 2013
    Posts:
    63
  4. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    342
    Unless the language is very popular around the world or at least at my country, I would vote a "No" too. Not even Rust thrives here fyi.
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,725
    I'd have to see a complete example project as what you've described so far has very little value. A new language needs more than just a new style to it. It has to solve a problem that you can't already solve with the existing one.
     
    Last edited: Apr 21, 2023
  6. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    342
    On a side note, you might want to use Source Generator, Custom Editor, Asset Importer Pipline, etc. to automate things if you really think something is currently too manual for you.
     
    BackgroundMover likes this.
  7. Deleted User

    Deleted User

    Guest

    You don't need a new language to achieve all of the things you're proposing. The real question is "Is it more feasible to build a new language to achieve these benefits, or should we implement these features in C#?"

    Hint: as @Laicasaane suggests, all of the simplified APIs you can get in a new language can be gotten through Source Generators, which is what is already happening in ECS.
     
  8. Spider-Kyleo

    Spider-Kyleo

    Joined:
    Mar 3, 2021
    Posts:
    3
    it would be more of a quality of life(I think that's the correct word?) change, of course, it doesn't need to be implemented, but it would be a nice thing to have, also even if the language itself isn't required, the component assets can be used with the visual scripting ECS thing unity is planning to add(I haven't heard them say anything about cancelling it, but if they did, ignore what is after the bracket and tell me please) and it would be pointless to have to manually create a file in Visual studio or something similar since that breaks the whole point visual scripting(also should note that the visual scripting idea didn't come until I just thought about it now, but if you have a better suggestion, then tell me please!)
     
  9. Also, bringing up Rust... lol... just check what abomination they did end up with in place of the simple ?: operator. Nonsense. We don't need a new language, thanks, just more points of failure.
     
  10. vectorized-runner

    vectorized-runner

    Joined:
    Jan 22, 2018
    Posts:
    393
  11. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    210
    What are the current approaches to this? As in, some formalized schema