Ask HN: Why is everyone on HN obsessed with Rust?
6 points
1 hour ago
| 7 comments
| HN
markjgx
1 hour ago
[-]
If I had to guess why HN is so attracted to Rust, there's a few things that compound on each other.

Rust occupies a point in the design space that no other language does. Statically verified memory safety, strong concurrency guarantees, a world class toolchain, and it compiles to native machine code. Before Rust you always had to sacrifice one of these. Go gives you safety and ergonomics but you're garbage collected and limited in expressiveness. C++ gives you performance but safety is entirely your problem. Rust is the first mainstream language to credibly offer all of it.

The toolchain is the part people underestimate. As someone from C++, I cannot overstate how much this matters. Our toolchain is literally cobbled together ancient runes. Package management is strange and archaic. You can't just add a package to your project. There are stacks of contrived and obscure rules that must be followed. The language itself is a hodgepodge of inconsistencies layered on each other over decades. Some codebases are hundreds of macro incantations deep. Some prefer overload maxxing, default constructor shenanigans, uninitialized memory. Macros aren't even part of the language, it's a file preprocessor glued on from the side. Headers and implementations are stitched together. System dependency management is hell on earth. Build systems are fragmented: CMake vs Meson vs Bazel vs Make vs Ninja, pick your poison. I could keep going.

Meanwhile Rust just works. You add a package in a few seconds. Compile to seven different platforms out of the box, including the web. Type references just work, nothing to forward declare. Cargo is your build system, package manager, test runner, doc generator, and publisher in one coherent thing. That entire category of bikeshedding that has plagued C++ for decades just doesn't exist. It's heaven on earth.

reply
thesuperbigfrog
1 hour ago
[-]
After working with C and C++ for many years and handling the problems associated with such software, Rust solves many of the difficult problems and makes nearly impossible problems manageable.

Rust is not perfect. It has flaws, moves quickly, and is harder to learn than other programming languages, but it is a large improvement and is advancing the state of the art.

reply
rl3
33 minutes ago
[-]
Because it's the foremost headache-reducing language in existence.

Complaints about its complexity no longer hold much water these days what with AI as competent as it is.

reply
whobre
39 minutes ago
[-]
Not everyone or even most. Just a very loud minority…
reply
jjgreen
1 hour ago
[-]
Vitamin C deficiency.
reply
minimaxir
1 hour ago
[-]
Because it's a) fast b) good and c) modern agents are surprisingly effective at extracting the stated attributes out of it despite the relatively scarce amount of training data. There isn't a conspiracy.
reply
CamperBob2
16 minutes ago
[-]
A cyclical fad. A few years ago, it was golang. No one around here seems to care much about golang now, but back in the day, God help anyone who said anything negative about Go on HN.

It's too late for anything to replace C/C++ now. Programming is a robot's job, and the robot DGAF. One Turing-complete language is as good as another, all the better if there are a few trillion tokens' worth of it in-distribution.

reply