2 ms·
I do try to apply that downward pressure, but maybe not as much as I should. Point taken.
by burntsushi 4y ago
I do try to apply that downward pressure, but maybe not as much as I should. Point taken.
- benreesman 4y agoAt the risk of beating a dead horse, I want to make a few suggestions in what I hope is a spirit of constructive feedback. I think that the Rust community has a tendency to highlight the wrong selling points. Great selling points of Rust right off the top of my head: * True innovation in memory management, others have done credible experiments with linear and/or affine typing, but Rust has made it work, at scale and in production, this is the first time anyone ever has, and it affords a very compelling compromise between more manual approaches and less performant approaches. * "Just Works" package management and build: Cargo and the package ecosystem work by default, instead of "work via incredible effort" like C++ or (nowadays) Python. Rust insulates you from stupid platform idiosyncrasies in a way that seriously help you get shit done. There is a tradeoff here, you build a lot of stuff and so the advantage over C++ build times isn't what it could be, but it's basically impossible to overstate how much the rubber meets the road here on both getting started and shipping industrial strength stuff. It's massive. * A vastly superior type system vs. C++ in basically all the hot paths. Rust has sensible, ergonomic, and pragmatic ways to express parameterized types, to pattern match on them rather than some 1970s `switch`-statement bullshit, to detect more unsafe casts, and to save you from quandaries (return value or out reference? ahh wtf do i do?) that some modern languages cough continue to punt on to the developer to this day. Interface vs. implementation sits in a very sweet spot between all the various directions that question gets tugged in. Bottom line: it's harder to write logic bugs in Rust. You can do it, but Rust helps you here a lot. * Bundled static analyzer: yes, you can get much if not most of the static analysis that `rustc` gives you by cranking `clang-tidy` up all the way: but first you have to install it, and maintain that installation, and argue with your colleagues about which checks should be on, and, and, and. Rust mandates a sane, curated list of good static checks that come for free and by default. This is also hard to overstate in terms of the practical defect count in many shops. A few bad selling points of Rust right off the top of my head: * Memory Safety: Rust does in fact nudge you away from some memory safety issues and reduce the tooling effort involved in `clang-tidy` and `ASAN` effort to get memory safe programs, but it's just not that big of a deal outside of security critical stuff. C++ evolved a good story here while Rust was busy chest-thumping about memory safety, while malicious actors simultaneously evolved their techniques far past buffer overrun. Seriously, mention memory safety in passing or not at all: people like me want to throw something when they hear some JS -> Rust emigree mouth off about it. * The "Right" Type System: People who know and care about exploiting types well (and understand they are going to pay in runtime performance) are now arguing about Haskell vs. Idris vs. PureScript -> WASM. Rust has a competent and pragmatic type system, but it's Haskell-lite at best in this regard. Compare Rust to C++ on typing, not serious math stuff. Developer Efficiency in All Cases: Rust has serious developer velocity advantages over it's competitors, i.e. C++, not against all other languages. If you want something working ASAP, Python is better, if you are willing to pay runtime cost and learn shit to go faster over time, Haskell is better. Rust sits in an awesome sweet-spot of fast execution, way above average developer velocity, and quite good tooling. It's not faster than Python for "who cares" and it's not faster than Haskell for raw power. Being the best tradeoff in many cases is plenty, claiming to be the "best" full stop is ridiculous. Rust's selling points are extremely compelling, and it has a very clean shot at being the "new C". This is plenty, don't overreach. It's a good thing that Rust will never be as expressive as Haskell, as good for numerics as Julia, as good for quick and dirty as Python, or as good for world-wide interop as C: being any of those things would make it worse at what it is!