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

**URL:** https://discourse.julialang.org/t/rust-will-try-to-relax-the-orphan-rule-julias-type-piracy/114265
**Category:** Offtopic
**Created:** [May 14, 2024, 6:13pm UTC](https://discourse.julialang.org/t/rust-will-try-to-relax-the-orphan-rule-julias-type-piracy/114265 "2024-05-14T18:13:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![xiaoxi](https://avatars.discourse-cdn.com/v4/letter/x/a9adbd/32.png) [@xiaoxi](https://discourse.julialang.org/u/xiaoxi)
#### Post date: [May 14, 2024, 6:13pm UTC](https://discourse.julialang.org/t/rust-will-try-to-relax-the-orphan-rule-julias-type-piracy/114265/1 "2024-05-14T18:13:04Z")

</div>

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

> <https://github.com/rust-lang/rust-project-goals/blob/main/src/2024h2/Relaxing-the-Orphan-Rule.md>

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

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [May 14, 2024, 7:29pm UTC](https://discourse.julialang.org/t/rust-will-try-to-relax-the-orphan-rule-julias-type-piracy/114265/2 "2024-05-14T19:29:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [May 14, 2024, 7:52pm UTC](https://discourse.julialang.org/t/rust-will-try-to-relax-the-orphan-rule-julias-type-piracy/114265/3 "2024-05-14T19:52:50Z")

</div>

As I understand it, Rust will throw an [error](https://doc.rust-lang.org/error_codes/E0210.html) if you try to implement an orphan like this. That makes it a significantly different sort of thing.
