Hacker News new | past | comments | ask | show | jobs | submit login

I think the rule of thumb should be that if you wouldn’t write aomething in C++, then you shouldn’t use Rust.





That's a horrible rule of thumb, because C++ adds a ton of complexity with little reward except for speed. Rust adds less complexity (still a lot ofc), but it also gives you awesome tooling and dependency management (much better than python for example), and and extemely powerful typesystem and functional programming features, that make writing correct code extremely easy.

Rust is a complex but overall good language for writing solid software, C++ is making a deal with the devil in exchange for speed.


If a garbage collected language can easily do the job, choose the garbage collected language. I like Rust, but it is NOT the fastest language to develop in.

Typescript, Python, Go, Swift, and even Bash depending on the situation are all quicker to code in than Rust.

If any of those languages are inadequate for the requirements whether they be memory-bound, CPU-bound, or sensitive to gc pauses, Rust is an excellent option that is far superior to C++ in 2024 and beyond.

The notion of "one true language" has always been and will always remain a fool's errand.


I write most of my stuff in a combination of Python, JS/TS and Rust these days with some form of Interop between them. I.e. mostly Python Marimo notebook with JS visualisations, and PyO3 Rust bindings.

Tbh I don't find myself to be "slow" in rust. Sure for quick exploratory stuff the notebook-environment and introspection capabilities of a dynamic language are definitely nice (e.g. when taking apart some unknown JSON data format), but especially when it comes to complex logic and refactorings Rusts type system is really making a big positive impact on productivity.

Sure TypeScripts type system is also powerful, but Rust is consistently better at infering types from closures and function calls, and the existing types and tooling story is miles ahead of TS. (and I've never encountered an easier to setup/use model checking language integration than Kani)

For one-offs where correctness doesn't matter, sure throw $SCRIPTING_LANG at it. But once you want correct software, I'd still choose Rust in a heartbeat.


You missed the point of the rule of thumb. Maybe rephrasing it as if 15 years ago you would have written it in C++ would help.

Nope. C++ has mostly downsides, Rust has significant upsides.

A good rule of thumb would be: is correctness and code confidence more important than learning curve and compile times? If so Rust, otherwise JS or Python (with possibly parts in Rust).


C++ is incredibly fast and still the language of choice for a lot if not most computing intensive tasks.

See my initial: > C++ is making a deal with the devil in exchange for speed.

That really doesn't matter when the price of the devil's deal is cheap.

ie: security is rarely a problem when selling software


Pretty much it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: