Const Trait Counterexamples

14 points by beef


rpjohnst

proposal 5: academic zealotry

This section really rubs me the wrong way. For example…

If we wanted to unify them to make our version of effects closer to formal modeling, we must do so for everything that we currently have, not just const traits.

…this is already a big project goal! People are working on formal models for references, for the borrow checker, for the trait system as a whole, for everything!

Perhaps this is just a difference in how we’re using terminology, but if we wind up with a design for const traits that can’t be modeled formally, or would be extremely onerous to model formally, something has gone very, very wrong.

This is not to say it should match any particular existing formalism exactly or even closely, but I also don’t think that’s really the idea you should take away when people bring up those formalisms. Rather, the idea is that these formalisms have already done a lot of the work of mapping out weird corner cases and interactions that can arise, depending on the set of features they start with. Often the most useful outcome here is that we learn about a new choice that can be made, which otherwise we would blunder into with our eyes closed. It would be a waste to ignore all of that prior art just because Rust can’t pull one off the shelf and deploy it unmodified.

Designing a language with your head down and without regard for the larger problem space is how you wind up with an incoherent mess that doesn’t learn from others’ mistakes.