Hacker News new | ask | show | jobs
by eden_h 2389 days ago
I've heard this suggestion fairly frequently - that people use Rust as a wrapper over C++ bindings to add in safety to the C++ underneath.

Mostly regarding using BLAS etc in Rust rather than C++. It seems a little pointless as the unsafe nature is within the underlying code, so it only santises input/output.

2 comments

For that use case it is more productive to actually use static analysis tooling for C++.
"people use Rust as a wrapper over C++ bindings to add in safety to the C++ underneath."

Adding a thin wrapper over an insecure library won't magically make it secure. That's why pure Rust or pure Swift versions of various algorithms and functionalities are worth so much - guaranteed memory-usage correctness.