Rust (lang)
beautiful code isn’t enough, it has to be safe, beautiful, maintainable, productive, understandable, and resource efficient…
Rust hits more of these but it’s ugly. Uglier than Python and approaches C++-level eyebleed. Rust generics aren’t as flexible as they could be because type constraints don’t have union and specialization is painful. Tag structs are laborious. Go hits more of these except it’s not as flexible and not quite as safe as Rust. Rust makes enormous binaries and compiles slow and the cargo index download is glacial, I’m surprised they don’t have an “sccache” for it. Go is easy to learn but then the capability of it plateaus. Go compiles and tests insanely fast. - HN
- The Rust Programming Language - book
About safety
- Eliminating Memory Safety Vulnerabilities at the Source - the benefits of re-writing the world are limited in terms of security.
Rust vs C/C++
- Rust inadequate for text compression codecs? / HN - rust protections static vs dynamics
- Codecs have next to no business logic moving parts. Most of it is the low-level nitty-gritty, which Rust is not particularly good at.
- Bounds checks are rarely performed in the compiletime and we have to pay their price at the runtime. This is a significant performance hit for codecs.
- The ownership model is not particularly useful to codecs. It is usually painfully clear who owns what (it’s usually the “god structure” of the codec owning everything else) and for how long (between calls to bz3_new and bz3_free).
- Rust is much more ergonomic for the typical workload than C or C++, but a fundamentally unobtrusive language is more conducive to implementing low-level performance-sensitive code.
- Why I rewrote the mesh generator of Dust3D from Rust to C++ - When you implement an algorithm using C++, you can write it down without one second of pause, but you can’t do that in Rust.
- The issue is that code that the borrow checker flags is not code that is unsafe, but code that the borrow checker cannot prove safe. There is a difference. Until, you natively start thinking and writing code with idioms that the borrow checker is tuned for, there will be friction.
see also
-
Leaving Rust gamedev after 3 years / HN - The problem you’re having is only a problem because you haven’t tried hard enough.
- Was Rust Worth It? - mixed feelling
- Rust: A Scala Engineer’s Perspective
- A practical comparison of build and test speed between C++ and Rust
- Why I think C++ is still a desirable coding platform compared to Rust / review from a rust fan / HN