top | item 43581703

(no title)

porkbrain | 11 months ago

1. Have a global append-only function key-value store.

2. A key of a function is something like `keccak256(function's signature + docstring)`

3. A value is a list of the function's implementation (index being the implementation's version) and some other useful metadata such as the contributor's signature and preferred function name. (Compiler emits a warning that needs to be explicitly silenced if preferred name is not used.)

4. IDE hints and the developer confirms to auto import the function from the global KV store.

5. Import hash can be prepended with a signers name that's defined in some config file. This makes it obvious in git diffs if a function changes its author. Additionally, the compiler only accepts a short hash in import statements if used with a signer.

package.toml

  [signers]
  mojmir = "mojmir's pubkey"
  radislava = "radislava's pubkey"

source.file

  // use publisher and short hash
  import "mojmir@51973ec9d4c1929b@1" as log_v1;
  // or full hash
  import "51973ec9d4c1929bdd5b149c064d46aee47e92a7e2bb5f7a20c7b9cfb0d13b39" as log_latest;
  import "radislava@c81915ad12f36c33" as ln;

  log_v1("Hello");
  log_latest(ln(0));

discuss

order

Philpax|11 months ago

You've just invented Unison :)