3 ms·
As far as I know, nobody managed to create a comprehensive intrusive data structure library that behaves as optimally as in C, due to the ownership semantic res
by Peaker 11y ago
As far as I know, nobody managed to create a comprehensive intrusive data structure library that behaves as optimally as in C, due to the ownership semantic restrictions.
- catnaroek 11y agoSo just bypass the ownership checks, with `unsafe`. It gives up on memory safety, but you still keep all the other benefits of a modern language: algebraic data types, pattern matching exhaustiveness checks, parametric polymorphism, etc. So, even when writing `unsafe` code, Rust is strictly superior to C and C++. Also, I would contend that, for the vast majority of programs, the benefits of a simple, hierarchical, statically enforceable resource management scheme like RAII outweigh the downsides. Programs that need more sophisticated approaches are a very small minority.