13 ms·
> then Rust wins easily because the type system gives you all the information you need straight in front of you The trait system can actually make following ex
by rkangel 8y ago
> then Rust wins easily because the type system gives you all the information you need straight in front of you
The trait system can actually make following execution a bit harder (just like runtime polymorphism in C++), because you have to find the allocation to know the concrete type of what you're looking at. C is much clearer from this point of view (but more limited for the same reasons).
- littlestymaar 8y agoCough!, void pointer, cough! Traits are used to express generality, when you need it. If you don't need to be generic over your input, you don't need traits. And when you need it, Rust makes it more explicit than C (and also more performant because it's statically dispatched by default).