kadena-io/pact

Some small Pact feature suggestions

jwiegley opened this issue · 0 comments

This list is from nuwu on Discord (https://discord.com/channels/502858632178958377/524762252734365696/1072905294604161056):

  • Governance delegate: (module app G (defcap G () true)) (module awa app (defun f (x) x)). Doesn't inline, latter module always adopts the governance of former
  • Keysets could be scoped by the (namespace) declaration, in order to allow flexible test codes
  • Nested object merge: (+ { 'a: { 'b: 2 } } { 'a: { 'c: 3 } }) = { 'a: { 'b: 2, 'c: 3 } }
  • Nested binds / deconstruct: (bind ob { 'a := { 'b := b } } ...)
  • Unclear how to manage database keys on tree data structure. Should node reference parents (space) or implement a string split function deriving parent from current node key (time)? Seems most implementations store redundant self-referential keys in tables, but it seems wasteful.
  • Typed numeric: x:number{token-bun}, which may carry models, precision, allowed values, etc, potentially enforced in the definition of their constructor
  • "Subset of" interface: (interface a (defun f:decimal ()) (defun g:decimal ())) (interface b (infer a [ f ])). a "implies" b.
  • For some reason, (let ((_:object{schema} o)) 0) behaves oddly
  • (pure) function: unlike (try) propagate errors but prohibits database writes. i.e. (pure (modref::fn x))
  • Unclear why, but the final default branch of (cond) doesn't allow s-expression, sometimes
  • Flexible inference: fix empty lists randomly resulting in type errors