Forget safety. Using enums in Rust is sheer delight. The fact they can even contain associated data is the really powerful. That alone makes me love the language. Especially with bitfields.
It cannot be matched in in C, even with a lot of macro magic. Plus, C is way too lax with type strictness and enums.
That’s right. And forget about the existing rustc compiler implement. If you have something in Rust like
then you can infer from the semantics that the ordering doesn’t matter and whether it can be parallelized. C doesn’t have the ability to express what you want to happen, just how to do it. That gives Rust far more opportunity for optimization than C possibly can have.