Hacker News new | ask | show | jobs
by spacechild1 594 days ago
Rust is essentially a C++ replacement. If you can afford a garbage collector, there's no need to use Rust or C++ and worry about memory management. Some people are promoting Rust as a general purpose programming language - which it is in theory - but so did people with C++ in the 90s.

> sparing few allocations

Minimizing memory allocations is typically what you want when you reach for Rust or C++.

1 comments

Sparing few allocations at the risk of making the language inconsistent is an extremely bad way of building a programming language. If you write async code, rules are not the same than non async code. I am using rust for 4 years, I think I have a good enough level with it and thank God I kept my objectivity. Btw this is at the first page of the rust website, not "c++ replacement" : A language empowering everyone to build reliable and efficient software.
> Btw this is at the first page of the rust website, not "c++ replacement"

They wish :) Why should anyone - apart from aesthetic preferences - fight the borrow checker and deal with long compile times when they can just use a language with GC? It just doesn't make sense to me from a technical standpoint. You reach for Rust or C++ when you can't use C#, Go or Java.

> If you write async code, rules are not the same than non async code.

The thing is: Rust is (also) catering to people who want to write async code on embedded devices.