{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiboiocubpprdm4yc3tmarc3m6akofubl6cthowb2hwbbeogqrkqzq",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mihyk3tymfe2"
},
"path": "/t/stable-type-identifiers-a-missing-piece-for-crabi-and-export/24093?page=2#post_26",
"publishedAt": "2026-04-01T16:25:58.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"it does talk about name mangling and type informations"
],
"textContent": "ParaDevOne:\n\n> In that case, nominal typing is safer; if you load a plugin that exports a type, you want to know exactly what that type is, not just any struct with the same fields. Semantic identity matters.\n>\n> With structural typing, you could load a structurally compatible but semantically incorrect type without detecting it until runtime.\n\nI don't follow the safety part. With plain nominal typing you could load a plugin that expects an older/newer and incompatible version of a type, then passing the wrong type would be instant UB.\n\nThere's also an argument to be made of which issue is more common. I find it hard to believe that you often have structurally equal types with different names and you confuse one with the other. It is however very common for types to change in non-backward/forward compatible ways, which then break when used with nominal typing.\n\nMoreover:\n\nParaDevOne:\n\n> **#3435 (export)** deals with how to export symbol information dynamically. It requires stable identifiers, but also does not define them.\n\nWhile it does not give an explicit definition of stable identifiers, it does talk about name mangling and type informations. The stated goal is to make it not-UB to call an exported function after changing a function signature (including any type mentioned in it). There are also some guidelines on what such a mangling scheme should take into account, and for types with public fields it is much more similar to a structural type system than a nominal one. Your proposal doesn't address any of these points, and instead goes against some of them.",
"title": "Stable type identifiers: a missing piece for crABI and export"
}