Conversation

Easy to say abstractly, but harder to specify exactly which features you would take out. Practical memory safety without GC requires quite a few moving parts.
Quote Tweet
it feels like there’s a smaller language hiding in Rust that’s half as powerful at the edges but 10-50x easier to read, write, and maintain
8
44
Replying to
This isn't a Rust subset, but if I were doing memory-safety for a compiled lang, I'd consider making mutability and ability to hold reference/pointer to objects mutually exclusive. Ref tracking then becomes easy without heavy runtime machinery.
3
Replying to and
Support for mutable references definitely makes it harder to design a safe language. However, Rust doesn't need any runtime machinery to support either mutable or immutable references. It deals with it by statically preventing the mutable references from overlapping with others.
1
There are clearly ways of doing it differently than Rust though. Many of those different approaches were considered as part of the design. There were a lot of experiments with different approaches and it ended up with the model it did largely due to practical research efforts.
1
For example, it could have had language support for the concept behind the Cell type in the standard library. It would be a lot more flexible as a language implementation rather than built as a crippled library type. I don't think it would be worth having another reference type.