Nim. Nim is puuuuurrrrfect for all of this stuff. Really. Every day I cry for 
joy after finding this language. It reduces so much noise and boilerplate for 
me.

I've already implemented my c# ecs in nim ( and it took way less work ) and my 
workflow looks like this:
    
    
    type ComponentHealth = object
      val: int
    type ComponentAI = object
    type ComponentBurning = object
    type ComponentAnimal = object
    type TagAlpaca = object
    
    ecs.add ComponentHealth
    ecs.add ComponentAI
    ecs.add ComponentBurning
    ecs.add ComponentAnimal
    
    proc newAnimal(): ent
      result = entity()
      result.add ComponentHealth
      result.add ComponentAI
      result.add ComponentBurning
      result.add ComponentAnimal
    
    var alpaca = newAnimal()
    alpaca.add TagAlpaca
    
    ecs.group burning_animals:
      comps: (ComponentHealth,ComponentAI,ComponentBurning,ComponentAnimal)
    
    app.start:
       echo "blazing"
    
    app.run:
      for entity in burning_animals:
        entity.chealth.val -= 10 * dt
      if input.down escape:
        app.quit()
    
    app.close:
      echo "alpaca"
    
    
    Run

Reply via email to