logoalt Hacker News

kstrauserlast Saturday at 4:06 AM1 replyview on HN

That’s right. And forget about the existing rustc compiler implement. If you have something in Rust like

  let a: HashMap = immutable_map.iter().map(…);
then you can infer from the semantics that the ordering doesn’t matter and whether it can be parallelized. C doesn’t have the ability to express what you want to happen, just how to do it. That gives Rust far more opportunity for optimization than C possibly can have.

Replies

seertaaklast Sunday at 10:53 AM

C != C-derived languages

In C++ this was possible already in C++03.

OTOH, it wasn't until recently that you were able to write something like `std::array<T, N>` in rust. Even now, there are restrictions on the kinds of expressions that N can be.

Just pointing out that this cuts both ways.