# Packages as namespaces

**URL:** <https://internals.rust-lang.org/t/packages-as-namespaces/18384>\
**Category:** language design\
**Created:** [February 20, 2023, 8:35pm UTC](https://internals.rust-lang.org/t/packages-as-namespaces/18384 "2023-02-20T20:35:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hydroper1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hydroper1/32/12099_2.png) [@hydroper1](https://internals.rust-lang.org/u/hydroper1)\
**Post date:** [February 20, 2023, 8:35pm UTC](https://internals.rust-lang.org/t/packages-as-namespaces/18384/1 "2023-02-20T20:35:13Z")

</div>

Namespaced-crates are more solely for clarity as they give an idea of what owns a crate, but still interesting. So reviving this proposal:

> [@Pre-RFC: Packages as Optional Namespaces](https://internals.rust-lang.org/t/pre-rfc-packages-as-optional-namespaces/13059/91):
>
> Posted at [RFC: Packages as (optional) namespaces by Manishearth · Pull Request #3243 · rust-lang/rfcs · GitHub](https://github.com/rust-lang/rfcs/pull/3243)

I think it fits well because core-crates like `amethyst` contain re-exports of things like `amethyst/ui` (accessed as `amethyst::ui` or `amethyst_ui`). Also it tries to not break compatibility (it says slashes are ambiguous to feature specifiers, but I never played too much with features in Cargo yet) and doesn't use different entities as namespaces (like user or organization).

The RFC also mentions possible adoption of `@`. But to me it'd be confusing since the proposal differs from NPM packages where namespaces are users or organizations.

---

<div class="post-metadata">

**Author:** ![jhpratt](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jhpratt/32/11640_2.png) [@jhpratt](https://internals.rust-lang.org/u/jhpratt)\
**Post date:** [February 20, 2023, 11:16pm UTC](https://internals.rust-lang.org/t/packages-as-namespaces/18384/2 "2023-02-20T23:16:44Z")

</div>

What exactly are you "reviving"? The RFC is already posted and is still open.

---

<div class="post-metadata">

**Author:** ![hydroper1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hydroper1/32/12099_2.png) [@hydroper1](https://internals.rust-lang.org/u/hydroper1)\
**Post date:** [February 21, 2023, 10:20am UTC](https://internals.rust-lang.org/t/packages-as-namespaces/18384/3 "2023-02-21T10:20:44Z")

</div>

It's open at GitHub, but closed here due to inactivity.

People seem to do this often, so I thought it'd be no problem?

---

<div class="post-metadata">

**Author:** ![jhpratt](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jhpratt/32/11640_2.png) [@jhpratt](https://internals.rust-lang.org/u/jhpratt)\
**Post date:** [February 21, 2023, 11:20am UTC](https://internals.rust-lang.org/t/packages-as-namespaces/18384/4 "2023-02-21T11:20:59Z")

</div>

Then why not discuss it on GitHub? That's where it's active.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [May 22, 2023, 11:21am UTC](https://internals.rust-lang.org/t/packages-as-namespaces/18384/5 "2023-05-22T11:21:44Z")

</div>

Closed on May 22, 2023, 11:21am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
