{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreifjkmf7rh33phiodlpme6gt2qzeceepongjlqp2aksln3zqlugtaa",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkvfhwddehi2"
},
"path": "/t/is-interning-as-a-general-primitive-something-that-should-be-in-the-standard-library/24215#post_8",
"publishedAt": "2026-05-02T18:06:59.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"VariableList",
"List",
"@robofinch",
"this blog post",
"users.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>\n> `slice` and `Vec` are memory representations. They have no notion of identity or equality across contexts. You cannot intern a `Vec`. This is a gap, not a stylistic choice.\n\nIt’s a fairly bold claim that something is absent from (the standard library) that seems _so hard_ (at least to me) to even understand what exactly you're talking about.\n\nOr maybe there's indeed a language barrier.\n\nAnyway, staring at the definition for `List` and `VariableList` you've linked for just a few minutes, I'm having a hard time figuring out what exactly it's used for. Though maybe I could figure it out eventually looking at the example(s) in your documentation for even longer [relevant links for anyone else, since it's more approachable than the raw source code on GitHub: VariableList, List]\n\n* * *\n\nYou reference interning, though that term would generally more correspond to concepts like the ones implemented by the crate @robofinch linked above, and I'm not completely whether or not the concept you're suggesting is missing is even too strongly related to that.\n\n* * *\n\nAndyou007:\n\n> Every system that serves human intent must identify \"which one\" and recognize \"the same one.\" That is not a library concern. It belongs in `core`.\n\nAs @robofinch already mentioned, the standard library (including `core`, `alloc` and `std`) deliberately doesn't contain a lot of things; for more context on that philosphy, feel free to look into previous discussions or write-ups, e.g. this blog post.\n\nIf you want to discuss or present the ideas of your crate to others, maybe you could do that first before combining it with the suggestion that it must be included in the standard library. Then the users forum, over on `users.rust-lang.org`, can be a better place for that kind of discussion.",
"title": "Is interning as a general primitive something that should be in the standard library?"
}