{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreielz67am6h3up7y4w225p7zn725hh2yxmx75noe5y2rcet2tcb2yi",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkvfijmwi5d2"
  },
  "path": "/t/is-interning-as-a-general-primitive-something-that-should-be-in-the-standard-library/24215#post_2",
  "publishedAt": "2026-05-02T15:10:32.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "internment"
  ],
  "textContent": "I’m going to assume your intentions are good, but I fear AI has substantially misled you. For one, `Vec` is not in `core`, and what you’re describing could at best be in `alloc`. Second, people can easily implement interning in library crates; for instance, `rustc` itself implements and uses interning. I also found this crate from a quick search: internment\n\nRust is _extremely likely not_ going to add this to `alloc` or `std` when structures that implement interning:\n\n  * are not widespread “vocabulary types”,\n  * do not need special language support (they can be implemented in libraries),\n  * libraries for the structure don’t have hundreds of millions of downloads and pressure from users to add the types to `std`, as with past cases where stuff was added to `std`.\n\n\n\nPersonally, I have never felt a gap from lack of interning in `std`.\n\nAndyou007:\n\n> **`List<T>`** — fixed-width unit store, addressed by `usize` identity **`VariableList<T>`** — variable-width unit store, same identity model, with interning support\n>\n> Both are small enough to copy into a project without installing a crate.\n\nMaybe this is a gap in expectations, but it’s _extremely normal_ for Rust crates to pull in a lot of other crates as dependencies.",
  "title": "Is interning as a general primitive something that should be in the standard library?"
}