Rust will try to relax the orphan rule (= Julia's type piracy)

Rust has set a goal for this year to experiment with ways to relax the orphan rule.

I wonder if Julia could learn something from Rust’s experiment in relaxing the orphan rule.

3 Likes

The overall orphan rule does vaguely sound like preventing type piracy, but is this particular relaxation for integrating 2 libraries really analogous to type piracy? While it’s more ideal to update one of the packages, I don’t immediately see dispatch issues with taking a type from package A and implementing a method from package B for it, unless one of those packages or its extension already imports the other. The concept of extensions itself suggests to me that arbitrarily mixing otherwise unrelated packages in a 3rd module is safe, though a 4th can easily interfere with the 3rd.

As I understand it, Rust will throw an error if you try to implement an orphan like this. That makes it a significantly different sort of thing.