Comment

Comment by shepmaster

> Rust provides the RefCell wrapper

There is also `Cell` (https://doc.rust-lang.org/std/cell/struct.Cell.html), which offers a different set of tradeoffs.

> which policy do you want to be the zero-overhead default

The one where:

- The compiler can make more optimizations

- I'm less likely to shoot myself in the foot my conflicting mutations

is a good default for me, so I'm in favor of Rust.

> a hypothetical future scenario where it is demonstrated that the optimizers are good enough

This sounds like the sufficiently smart compiler (http://wiki.c2.com/?SufficientlySmartCompiler) argument. While I'd love to live in this world, we aren't there yet.

Even in such a world, there would still be reasons to choose Rust over C, such as standardized dependency management or a rich type system.

parent shepmaster 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton