I'm currently playing around with the #Bevy engine, and I'm really impressed by their #RustLang generics black magic.

For example:
You need some additional component in your system? Just add it to the function signature, it magically works.

I haven't had this much fun working with a game engine in a very long time.

#gamedev

@soulsource yeah I tried to understand how this is actually implemented but by Rust skills are not good enough. I know doing the same in C++ would be VERY messy.
Introductions - Dependency Injection like Bevy Engine from Scratch

@alice_i_cecile @soulsource this is actually incredibly informative, thanks!
@alice_i_cecile @Blackthorn Thanks for the link! I'll have a look at it later.

@Blackthorn @soulsource
it's not far off c++ templates + concepts
.. but the type inference does work a bit better.

I'm a rust user - haven't used bevy but some actually say it's ECS actually masks some of the benefits you'd get writing in rust more generally... ECS is a kind of loose typing.

rusts secret weapon for gamedev is enum/match.. makes message passing & statemachines very slick

@walter4096 @Blackthorn Yeah, I agree on that. I was mainly curious how working with an ECS feels, but I'm not planning on doing anything serious with it, at least for the foreseeable future.

In my current spare time project I'm not using an engine, but rather just SDL, and I'm really trying to benefit from Algebraic Data Types as much as I can. I'm planning to go crazy with branching storylines, and hope that exhaustive matching can help me keep them under control. 😉