Hacker News new | ask | show | jobs
by mathstuf 1371 days ago
> So, in C++ you as library writer are empowered to make the use of your library correct by construction: what compiles is safe and correct

Empowered? Sure. But it seems no one likes using that power for long stretches of time. Rust gives the same power and it gets used far more usefully IME.

> Almost every C++ feature is designed to enable delivering more powerful libraries, and they compound.

Well, we can take `std::variant`, `std::optional`, and `std::expected` out of that pool because the committee hamstrung them from their better alternatives that already existed in Boost for silly, misguided reasons.

> Rust makes the compiler responsible for memory safety, but offers much less to make using your library pleasant and foolproof.

C++ libraries have, historically IME, been far more likely to ask you to juggle live grenades while dancing in a minefield than Rust libraries and APIs have.