multiformats / multicodec

Compact self-describing codecs. Save space by using predefined multicodec tables.
MIT License
341 stars 205 forks source link

feat: Add silverpine #274

Closed Jorropo closed 2 years ago

Jorropo commented 2 years ago

See https://github.com/Jorropo/go-silverpine

Right now there is no parameters to the silverpine component (all it need is an Ed25519 public key which it gets from a p2p component later).

Jorropo commented 2 years ago

Btw it seems we don't allow è in names. Is that really a thing people care about ? (if yes I'll just rename it to silverpine which is the english translation of it)

rvagg commented 2 years ago

the name restriction:

Codec names should be easily convertible to constants in common programming languages using basic transformation rules (e.g. upper-case, conversion of - to , etc.). Therefore they should contain alphanumeric characters, with the first character being alphabetic. The primary delimiter for multi-part names should be -, with reserved for cases where a secondary delimiter is required. For example: bls12_381-g1-pub contains 3 parts: bls_381, g1 and pub, where bls_381 is "BLS 381" which is not commonly written as "BLS381" and therefore requires a secondary separator.

I'm not aware of a programming language (that's not ancient) that would have a problem with è, but characters outside of [a-z0-9_-] do tend to increase the friction for english-as-first-language developers (like me) who aren't used to entering those characters with their standard keyboards (I have to copy and paste è to get it in here, I have no idea how to do this with my keyboard). IDEs tend to make dealing with strange variable names easier so it's probably not as big a deal as it might have been once.

:shrug: if you feel strong enough about this I guess we could litigate this rule, pull in some others, and see if we can change it. I don't feel super strongly about it although I think I'd prefer the first character be in the a-z range (if I still have to find a è to copy and paste to get my IDE to auto-complete then that's as annoying as not having an IDE to auto-complete).

vmx commented 2 years ago

Btw it seems we don't allow è in names. Is that really a thing people care about ?

In some programming languages the table is is used to auto-generate some code. It's just simpler to use a restricted set of characters. I'd keep it that way to keep scripts simple.

Jorropo commented 2 years ago

Renamed to silverpine.