design icon indicating copy to clipboard operation
design copied to clipboard

Name spacing conventions for custom section names?

Open rossberg opened this issue 4 years ago • 2 comments

We have no conventions for naming proprietary custom sections. Without some discipline, there obviously is the risk of name clashes or prominent engines/tools clobbering some common names (somewhat related: WebAssembly/branch-hinting#7).

For Dfinity, we now want to introduce a couple of system-specific custom sections. We would like to avoid any conflict, so intend to prefix them with icp in some systematic way.

I suggest that Wasm should provide a general recommendation for (a) using such namespace prefixes for proprietary custom sections, and (b) suggest a concrete syntax for it.

My suggestion would be a prefix of the form namespace:, in the spirit of URI schemas, where namespace is the name of the tool, engine, or environment introducing it, e.g., v8, icp, rust etc. This name should obviously be chosen to be unique enough in itself that clashes are unlikely. I wouldn't go as far as an official registration, but maybe maintaining an informal list of known prefixes somewhere would also help.

Thoughts?

rossberg avatar Sep 29 '21 07:09 rossberg

If we are talking about proprietary extensions, then the most obvious naming convention is to include a complete domain in the name of the section: com.dfinity.foobar.somethingtodowithcrypto That way we can rely on ICANN to prevent name clashes.

fgmccabe avatar Sep 29 '21 16:09 fgmccabe

Hm, yes, but there isn't necessarily a domain associated with everything, at least not a canonical one, or the domain may change over time. It would also be rather verbose.

com.dfinity.foobar.somethingtodowithcrypto

Nothing at all to do with crypto, but with attaching interface descriptions and other app metadata. :)

rossberg avatar Sep 30 '21 08:09 rossberg