4 ms·
zero-overhead abstraction is also C++'s primary goal. In what way it's mixed bag that is not the same in rust? Rust is basically C++ with lifetimes and a cleane
by xfer 9y ago
zero-overhead abstraction is also C++'s primary goal. In what way it's mixed bag that is not the same in rust? Rust is basically C++ with lifetimes and a cleaner type-system.
- MaxBarraclough 9y ago> zero-overhead abstraction is also C++'s primary goal But it's not completely 'pure' on that front. LLVM's coding standards prohibit RTTI and exceptions precisely because they aren't zero-overhead. https://llvm.org/docs/CodingStandards.html#do-not-use-rtti-or-exceptions https://llvm.org/docs/CodingStandards.html#do-not-use-rtti-o...
- arghwhat 9y agoThose features are much worse than not just zero-overhead. Not only do they have a very clear overhead, the overhead applies to all code by default. You have to explicitly disable those features at compile-time to avoid the bloat.
- MaxBarraclough 9y agoTough to work without exceptions in particular, as the C++ standard library uses them.
- zlynx 9y agoBecause Rust knows about lifetimes and C++ doesn't. What C++ needs is a way to specialize types so that they automatically know if they need heap or stack storage without the programmer having to be explicit.