5 ms·
> Remember that great feature of Rust being memory safe? It comes at the cost of not being able to easily “inject” something that implements a trait. This is n
by niederman 2y ago
> Remember that great feature of Rust being memory safe? It comes at the cost of not being able to easily “inject” something that implements a trait.
This is not at all the reason. The real reason is that Rust chooses to make the runtime overhead required for dynamic typing and heap allocation explicit, not anything to do with memory safety.
- kaba0 2y agoWell, java won’t have any overhead in many cases (e.g. only single implementation), as the JIT compiler will do its job.