Arceus.jl — A Lightning-Fast Behavior Resolution System

Nice one! I think you’re nailing an all-around fast ECS infrastructure for Julia!

If you want to continue this line of work, I have additional challenges depending on how far you’re willing to go. There are those I failed to do. If you want to try, good luck.

  1. Add pext support. (Faster than magic lookup on some arch) See. Bit Manipulation Instruction Set - #5 by yuyichao
  2. You seem to be implementing a traditional ECS in addition to this one. One realization about archetypal ECS is that each combination of traits might get used many times in an update. For example, one might update entities on fire with -5 HP and poisoned entities with -5 HP. One should be able to merge them and use the LLVM compiler to efficiently update them both.
  3. If you’re up for more challenges, take a look at something like accelerated linear algebra, reactant, etc, to not only optimize scalar update, but also linear algebraic updates as well.
  4. Dynamically compiling for each archetype introduces a compiled Julia function. These functions currently stay in memory and do not get garbage-collected. This is a known issue. If you’re daring enough, you can fix it. (This problem is a really hard one; you need to fix Julia itself. Maybe keep this later.

See also FunctionWrappers.jl.

As to why you’d need both a bit-lookup-based ECS and an archetype-based ECS, it’s because bit-lookup is only fast with simple precomputed behaviors. If you need to look up a virtual function, it’s starting to get slow.

You do know that coding things in Julia is a challenge right? For example, take a look at this. Comparison tables for various Julia packages

Julia beats everyone else hands-down. If you’re up to the challenge, you’re competing with Unity, Flecs, Bevy, etc. You decide if you want to or not. Good luck.

I’m surprised by your capability. Good luck with whatever you want to do further.