3 ms·
Why does it have so many dependencies?
by meindnoch 4y ago
Why does it have so many dependencies?
- KirillPanov 4y ago... and how many of those use `unsafe { }`?
- logicprog 4y agoThis betrays a fundamental misunderstanding of how Rust and unsafe work. You sometimes need to use unsafe Rust for low level work or C/C++ FFI; that doesn't make the rest of your code unsafe as long as you A) use it only when necessary and B) ensure that the basic invariants are maintained and the basic contract between safe and unsafe code is upheld. This whole "well it uses unsafe in parts so its suddenly all unsafe and we might as well use C" thing is a bit silly.
- logicprog 4y agoPeople unfamiliar with Rust constantly ask this question and the answer is always the same: because they're not reinventing the wheel and rolling their own cryptography, hash functions, etc. The more you do that, instead of using battle-tested existing libraries with plenty of maintainers, the more likely it is that you'll introduce a security vulnerability. Plus it duplicates effort unnecessarily, when it would be better to pool it. For context, if anyone's curious, here's the dependency list: clap = "4.0.32" libc = "0.2.139" thiserror = "1.0.38" glob = "0.3.1" sha2 = "0.10.6" digest = "0.10.6" signal-hook = "0.3.15" log = "0.4.17" syslog = "6.0.1" env_logger = "0.9.3"