Live data from Hacker News

Ask HN: What is the state of C++ vs. Rust?

news.ycombinator.com

141–150 of 156 posts

Re: Ask HN: What is the state of C++ vs. Rust?

#141

Earlier quoted context omitted.

> Alternatively I think Rust could compete heavily with Go since the whole microservices space is still sort of up for grabs (or atleast is so massive that there is plenty of pie to be had). I think you're wrong about this one. Go has a ton of HTTP libraries that make it dead simple to get a web service up and running with all the features you'd expect like pattern-matching URL routing, database backends, sessions, e…

I'm not a RUST chap, but came across this the other day: http://www.arewewebyet.org/ I've done most of my web service work in either Java or Go, but I'd like to give Rust a try for comparison at some point.

Rust people may have better insight into this, but it seems like that site is outdated and in need of an update.

Edit: I meant to say that I have heard from many of them that the content of that is outdated and in need of an update. There was talk of the community taking it over but I don't have the latest on that.

Re: Ask HN: What is the state of C++ vs. Rust?

#142
post #141

Earlier quoted context omitted.

I'm not a RUST chap, but came across this the other day: http://www.arewewebyet.org/ I've done most of my web service work in either Java or Go, but I'd like to give Rust a try for comparison at some point.

Rust people may have better insight into this, but it seems like that site is outdated and in need of an update. Edit: I meant to say that I have heard from many of them that the content of that is outdated and in need of an update. There was talk of the community taking it over but I don't have the latest on that.

Dot org is the takeover of the old dot com, which is what you were thinking of.

Re: Ask HN: What is the state of C++ vs. Rust?

#143

Earlier quoted context omitted.

Even modern C++ isn't memory safe. Most straightforward example is to move a uniq_ptr, which makes it a nullptr, ready to be dereferenced and cause UB.

How does it happen? Non-const unique_ptr& used as a function parameter?

http://www.steveklabnik.com/uniq_ptr_problem/

Re: Ask HN: What is the state of C++ vs. Rust?

#144
post #141

Earlier quoted context omitted.

Rust people may have better insight into this, but it seems like that site is outdated and in need of an update. Edit: I meant to say that I have heard from many of them that the content of that is outdated and in need of an update. There was talk of the community taking it over but I don't have the latest on that.

Dot org is the takeover of the old dot com, which is what you were thinking of.

Okay, there was an attempt made to get the .com redirected?

Re: Ask HN: What is the state of C++ vs. Rust?

#147
post #74
post #60

Earlier quoted context omitted.

Yes most, but not all.

Out of curiosity, have you hit examples in which the runtime cost of Rust's safety was problematic – and couldn't be worked around without losing either safety or clarity?

The most obvious case is bound checking. If you have a code with direct array indexing you have to use unsafe code or loose a little bit of performance.

Re: Ask HN: What is the state of C++ vs. Rust?

#149

Earlier quoted context omitted.

How does it happen? Non-const unique_ptr& used as a function parameter?

http://www.steveklabnik.com/uniq_ptr_problem/

I can simplify your example:

  unique_ptr p;
  auto n = *p; // C++ kills!

Re: Ask HN: What is the state of C++ vs. Rust?

#150

Earlier quoted context omitted.

Yes, but you then also went on to say that no language will ever do it. Rust _has_ consistently beaten C on many of these benchmarks in the past, and continues to remain very close in the ones that it's not. I actually don't think microbenchmarks are a good way to think about performance anyway. There's two reasons: First, Rust's safety guarantees let you get away with more dangerous things. Consider scoped threads,…

No, I didn't say that no language will ever beat C. I can't predict the future. Rust has not beaten any highly optimized microbenchmarks that I know of. Like it beats C on the mandelbrot benchmark, but is then beaten by Swift, suggesting that the C implementation isn't very good ( http://benchmarksgame.alioth.debian.org/u64q/performance.php... ). The reason we have micro benchmarks is because it is so hard to reason…

(The C Mandelbrot program is considerably less extreme.)
Post reply on HN