{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreig4own4z6xpa7b2l2fgplvax5fm6drm6rkgxe55av4fnbhumv5dzy",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkvfhe65lvx2"
  },
  "path": "/t/is-interning-as-a-general-primitive-something-that-should-be-in-the-standard-library/24215#post_9",
  "publishedAt": "2026-05-02T18:50:48.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "Andyou007:\n\n> Every system that accepts input from humans operates on two concepts that are currently absent from `core`:\n>\n>   1. A way to store and retrieve values by a stable integer identity (1-based ordinal, where 0 is the null sentinel — the only meaningful null for a computer)\n>   2. A way to recognize that two inputs are the same value — interning\n>\n\n\nApart from everything else, this is a strong claim, requiring equally strong evidence, which you haven't provided at all.\n\nI would personally argue that interning (and, more generally, memoization) are only _sometimes_ useful. They can't be used, for instance, when you need to process an unbounded stream of data using a _constant_ amount of space, which is the most common case in my experience for data crunching tasks (and yes, that data stream might be coming from a human).\n\nIt's also very easy to build an interner on top of things that the standard library already gives you, e.g. `HashMap<String, u32>`, which means the benefit of adding an \"official\" interner to the standard library would be quite limited.",
  "title": "Is interning as a general primitive something that should be in the standard library?"
}