mirror of
https://github.com/urbit/shrub.git
synced 2025-01-07 13:37:36 +03:00
Everything but ++py and ++veal:form compiles.
This commit is contained in:
parent
6eadee42b5
commit
965cd4ac50
235
arvo/jael.hoon
235
arvo/jael.hoon
@ -1,5 +1,5 @@
|
|||||||
!: :: /van/jael
|
!: :: /van/jael
|
||||||
:: :: %reference
|
:: :: %reference/0
|
||||||
!? 150
|
!? 150
|
||||||
:: ::::
|
:: ::::
|
||||||
:::: # 0 :: public structures
|
:::: # 0 :: public structures
|
||||||
@ -187,57 +187,6 @@
|
|||||||
:: language compromises: the type system can't enforce
|
:: language compromises: the type system can't enforce
|
||||||
:: that lef and ryt match, hence the asserts.
|
:: that lef and ryt match, hence the asserts.
|
||||||
::
|
::
|
||||||
:: :: ++add:ry
|
|
||||||
++ uni :: lef new, ryt old
|
|
||||||
^- jael-right
|
|
||||||
|^ ?- -.lef
|
|
||||||
$apple ?>(?=($apple -.ryt) [%apple (table p.lef p.ryt)])
|
|
||||||
$block ?>(?=($block -.ryt) [%block ~])
|
|
||||||
$email ?>(?=($email -.ryt) [%email (sable p.lef p.ryt)])
|
|
||||||
$final ?>(?=($final -.ryt) [%final (table p.lef p.ryt)])
|
|
||||||
$fungi ?>(?=($fungi -.ryt) [%fungi (noble p.lef p.ryt)])
|
|
||||||
$guest ?>(?=($guest -.ryt) [%guest ~])
|
|
||||||
$hotel ?>(?=($hotel -.ryt) [%hotel (bible p.lef p.ryt)])
|
|
||||||
$jewel ?>(?=($jewel -.ryt) [%jewel (table p.lef p.ryt)])
|
|
||||||
$login ?>(?=($login -.ryt) [%login (sable p.lef p.ryt)])
|
|
||||||
$pword ?>(?=($pword -.ryt) [%pword (ruble p.lef p.ryt)])
|
|
||||||
$token ?>(?=($token -.ryt) [%token (ruble p.lef p.ryt)])
|
|
||||||
$urban ?>(?=($urban -.ryt) [%urban (table p.lef p.ryt)])
|
|
||||||
==
|
|
||||||
:: :: ++bible:uni:ry
|
|
||||||
++ bible :: union pile
|
|
||||||
|= {new/pile old/pile}
|
|
||||||
^+ new
|
|
||||||
(~(uni py old) new)
|
|
||||||
:: :: ++noble:uni:ry
|
|
||||||
++ noble :: union map of @ud
|
|
||||||
|= {new/(map term @ud) old/(map term @ud)}
|
|
||||||
^+ new
|
|
||||||
%- (~(uno by old) new)
|
|
||||||
|= (trel term @ud @ud)
|
|
||||||
(add q r)
|
|
||||||
:: :: ++ruble:uni:ry
|
|
||||||
++ ruble :: union map of maps
|
|
||||||
|= {new/(map site (map @t @t)) old/(map site (map @t @t))}
|
|
||||||
^+ new
|
|
||||||
%- (~(uno by old) new)
|
|
||||||
|= (trel site (map @t @t) (map @t @t))
|
|
||||||
%- (~(uno by q) r)
|
|
||||||
|= (trel @t @t @t)
|
|
||||||
?>(=(q r) r)
|
|
||||||
:: :: ++sable:uni:ry
|
|
||||||
++ sable :: union set
|
|
||||||
|* {new/(set) old/(set)}
|
|
||||||
^+ new
|
|
||||||
(~(uni in old) new)
|
|
||||||
:: :: ++table:uni:ry
|
|
||||||
++ table :: union map
|
|
||||||
|* {new/(map) old/(map)}
|
|
||||||
^+ new
|
|
||||||
%- (~(uno by old) new)
|
|
||||||
|= (trel _p.-<.new _q.->.new _q.->.new)
|
|
||||||
?>(=(q r) r)
|
|
||||||
--
|
|
||||||
:: :: ++dif:ry
|
:: :: ++dif:ry
|
||||||
++ dif :: r->l: {add remove}
|
++ dif :: r->l: {add remove}
|
||||||
^- (pair (unit jael-right) (unit jael-right))
|
^- (pair (unit jael-right) (unit jael-right))
|
||||||
@ -348,36 +297,114 @@
|
|||||||
^- (unit jael-right)
|
^- (unit jael-right)
|
||||||
=/ vid dif
|
=/ vid dif
|
||||||
?>(?=($~ q.vid) p.vid)
|
?>(?=($~ q.vid) p.vid)
|
||||||
|
:: :: ++add:ry
|
||||||
|
++ uni :: lef new, ryt old
|
||||||
|
^- jael-right
|
||||||
|
|^ ?- -.lef
|
||||||
|
$apple ?>(?=($apple -.ryt) [%apple (table p.lef p.ryt)])
|
||||||
|
$block ?>(?=($block -.ryt) [%block ~])
|
||||||
|
$email ?>(?=($email -.ryt) [%email (sable p.lef p.ryt)])
|
||||||
|
$final ?>(?=($final -.ryt) [%final (table p.lef p.ryt)])
|
||||||
|
$fungi ?>(?=($fungi -.ryt) [%fungi (noble p.lef p.ryt)])
|
||||||
|
$guest ?>(?=($guest -.ryt) [%guest ~])
|
||||||
|
$hotel ?>(?=($hotel -.ryt) [%hotel (bible p.lef p.ryt)])
|
||||||
|
$jewel ?>(?=($jewel -.ryt) [%jewel (table p.lef p.ryt)])
|
||||||
|
$login ?>(?=($login -.ryt) [%login (sable p.lef p.ryt)])
|
||||||
|
$pword ?>(?=($pword -.ryt) [%pword (ruble p.lef p.ryt)])
|
||||||
|
$token ?>(?=($token -.ryt) [%token (ruble p.lef p.ryt)])
|
||||||
|
$urban ?>(?=($urban -.ryt) [%urban (table p.lef p.ryt)])
|
||||||
|
==
|
||||||
|
:: :: ++bible:uni:ry
|
||||||
|
++ bible :: union pile
|
||||||
|
|= {new/pile old/pile}
|
||||||
|
^+ new
|
||||||
|
(~(uni py old) new)
|
||||||
|
:: :: ++noble:uni:ry
|
||||||
|
++ noble :: union map of @ud
|
||||||
|
|= {new/(map term @ud) old/(map term @ud)}
|
||||||
|
^+ new
|
||||||
|
%- (~(uno by old) new)
|
||||||
|
|= (trel term @ud @ud)
|
||||||
|
(add q r)
|
||||||
|
:: :: ++ruble:uni:ry
|
||||||
|
++ ruble :: union map of maps
|
||||||
|
|= {new/(map site (map @t @t)) old/(map site (map @t @t))}
|
||||||
|
^+ new
|
||||||
|
%- (~(uno by old) new)
|
||||||
|
|= (trel site (map @t @t) (map @t @t))
|
||||||
|
%- (~(uno by q) r)
|
||||||
|
|= (trel @t @t @t)
|
||||||
|
?>(=(q r) r)
|
||||||
|
:: :: ++sable:uni:ry
|
||||||
|
++ sable :: union set
|
||||||
|
|* {new/(set) old/(set)}
|
||||||
|
^+ new
|
||||||
|
(~(uni in old) new)
|
||||||
|
:: :: ++table:uni:ry
|
||||||
|
++ table :: union map
|
||||||
|
|* {new/(map) old/(map)}
|
||||||
|
^+ new
|
||||||
|
%- (~(uno by old) new)
|
||||||
|
|= (trel _p.-<.new _q.->.new _q.->.new)
|
||||||
|
?>(=(q r) r)
|
||||||
--
|
--
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: ++up: wallet algebra
|
||||||
|
::
|
||||||
|
:: we store the various kinds of ++jael-right in
|
||||||
|
:: a binary tree, sorted by ++gor on the tag,
|
||||||
|
:: balanced by ++vor on the tag. this tree, a
|
||||||
|
:: ++jael-purse, is also a valid ++map. but
|
||||||
|
:: unlike a ++map, it has heterogeneous type.
|
||||||
|
::
|
||||||
|
:: this design is pretty generalized and should
|
||||||
|
:: probably be promoted deeper in the stack. its
|
||||||
|
:: goal is to make it super easy to add new
|
||||||
|
:: forms of ++jael-right, without invalidating
|
||||||
|
:: existing purse nouns.
|
||||||
|
::
|
||||||
|
:: rights operations always crash if impossible;
|
||||||
|
:: the algebra has no concept of negative rights.
|
||||||
|
::
|
||||||
|
:: performance issues: ++differ and ++splice, naive.
|
||||||
|
::
|
||||||
|
:: external issues: much copy and paste from ++by.
|
||||||
|
::
|
||||||
|
:: language issues: if hoon had an equality test
|
||||||
|
:: that informed inference, ++expose could be
|
||||||
|
:: properly inferred, eliminating the ?>.
|
||||||
:: :: ++up
|
:: :: ++up
|
||||||
++ up :: rights wallet
|
++ up :: rights wallet
|
||||||
|_ pig/jael-purse
|
|_ pig/jael-purse
|
||||||
::
|
:: :: ++delete:up
|
||||||
:: ++up: wallet algebra
|
++ delete :: delete right
|
||||||
::
|
|= ryt/jael-right
|
||||||
:: we store the various kinds of ++jael-right in
|
^- jael-purse
|
||||||
:: a binary tree, sorted by ++gor on the tag,
|
?~ pig
|
||||||
:: balanced by ++vor on the tag. this tree, a
|
~
|
||||||
:: ++jael-purse, is also a valid ++map. but
|
?. =(-.ryt -.n.pig)
|
||||||
:: unlike a ++map, it has heterogeneous type.
|
?: (gor -.ryt -.n.pig)
|
||||||
::
|
[n.pig $(pig l.pig) r.pig]
|
||||||
:: this design is pretty generalized and should
|
[n.pig l.pig $(pig r.pig)]
|
||||||
:: probably be promoted deeper in the stack. its
|
=/ dub ~(sub ry n.pig ryt)
|
||||||
:: goal is to make it super easy to add new
|
?^ dub [u.dub l.pig r.pig]
|
||||||
:: forms of ++jael-right, without invalidating
|
|- ^- jael-purse
|
||||||
:: existing purse nouns.
|
?~ l.pig r.pig
|
||||||
::
|
?~ r.pig l.pig
|
||||||
:: rights operations always crash if impossible;
|
?: (vor -.n.l.pig -.n.r.pig)
|
||||||
:: the algebra has no concept of negative rights.
|
[n.l.pig l.l.pig $(l.pig r.l.pig)]
|
||||||
::
|
[n.r.pig $(r.pig l.r.pig) r.r.pig]
|
||||||
:: external issues: our map difference and union
|
|
||||||
:: operators need some work.
|
|
||||||
::
|
|
||||||
:: :: ++differ:up
|
:: :: ++differ:up
|
||||||
++ differ :: delta pig->gob
|
++ differ :: delta pig->gob
|
||||||
|= gob/jael-purse
|
|= gob/jael-purse
|
||||||
^- jael-delta
|
^- jael-delta
|
||||||
!!
|
|^ [way way(pig gob, gob pig)]
|
||||||
|
++ way
|
||||||
|
%- intern(pig ~)
|
||||||
|
%+ skip linear(pig gob)
|
||||||
|
|=(jael-right (~(has in pig) +<))
|
||||||
|
--
|
||||||
:: :: ++exists:up
|
:: :: ++exists:up
|
||||||
++ exists :: test presence
|
++ exists :: test presence
|
||||||
|= tag/@tas
|
|= tag/@tas
|
||||||
@ -385,11 +412,6 @@
|
|||||||
:: :: ++expose:up
|
:: :: ++expose:up
|
||||||
++ expose :: typed extract
|
++ expose :: typed extract
|
||||||
|= tag/@tas
|
|= tag/@tas
|
||||||
::
|
|
||||||
:: if hoon had an equality test that informed
|
|
||||||
:: inference, this could be a |*, and its
|
|
||||||
:: product would be properly inferred.
|
|
||||||
::
|
|
||||||
^- (unit jael-right)
|
^- (unit jael-right)
|
||||||
?~ pig ~
|
?~ pig ~
|
||||||
?: =(tag -.n.pig)
|
?: =(tag -.n.pig)
|
||||||
@ -399,7 +421,23 @@
|
|||||||
++ insert :: insert item
|
++ insert :: insert item
|
||||||
|= ryt/jael-right
|
|= ryt/jael-right
|
||||||
^- jael-purse
|
^- jael-purse
|
||||||
!!
|
?~ pig
|
||||||
|
[ryt ~ ~]
|
||||||
|
?: =(-.ryt -.n.pig)
|
||||||
|
?: =(+.ryt +.n.pig)
|
||||||
|
pig
|
||||||
|
[~(uni ry ryt n.pig) l.pig r.pig]
|
||||||
|
?: (gor -.ryt -.n.pig)
|
||||||
|
=+ nex=$(pig l.pig)
|
||||||
|
?> ?=(^ nex)
|
||||||
|
?: (vor -.n.pig -.n.nex)
|
||||||
|
[n.pig nex r.pig]
|
||||||
|
[n.nex l.nex [n.pig r.nex r.pig]]
|
||||||
|
=+ nex=$(pig r.pig)
|
||||||
|
?> ?=(^ nex)
|
||||||
|
?: (vor -.n.pig -.n.nex)
|
||||||
|
[n.pig l.pig nex]
|
||||||
|
[n.nex [n.pig l.pig l.nex] r.nex]
|
||||||
:: :: ++intern:up
|
:: :: ++intern:up
|
||||||
++ intern :: insert list
|
++ intern :: insert list
|
||||||
|= lin/(list jael-right)
|
|= lin/(list jael-right)
|
||||||
@ -451,17 +489,21 @@
|
|||||||
++ remove :: pig minus gob
|
++ remove :: pig minus gob
|
||||||
|= gob/jael-purse
|
|= gob/jael-purse
|
||||||
^- jael-purse
|
^- jael-purse
|
||||||
!!
|
=/ buv (~(tap by gob))
|
||||||
|
|- ?~ buv pig
|
||||||
|
$(buv t.buv, pig (delete i.buv))
|
||||||
:: :: ++splice:up
|
:: :: ++splice:up
|
||||||
++ splice :: pig plus gob
|
++ splice :: pig plus gob
|
||||||
|= gob/jael-purse
|
|= gob/jael-purse
|
||||||
^- jael-purse
|
^- jael-purse
|
||||||
!!
|
=/ buv (~(tap by gob))
|
||||||
|
|- ?~ buv pig
|
||||||
|
$(buv t.buv, pig (insert i.buv))
|
||||||
:: :: ++update:up
|
:: :: ++update:up
|
||||||
++ update :: arbitrary change
|
++ update :: arbitrary change
|
||||||
|= del/jael-delta
|
|= del/jael-delta
|
||||||
^- jael-purse
|
^- jael-purse
|
||||||
(remove(pig (splice mor.del)) les.del)
|
(splice(pig (remove les.del)) mor.del)
|
||||||
--
|
--
|
||||||
:: :: ++we
|
:: :: ++we
|
||||||
++ we :: wyll tool
|
++ we :: wyll tool
|
||||||
@ -1091,9 +1133,34 @@
|
|||||||
::
|
::
|
||||||
=. +>.$ abet:(deal:~(able ex our) our [[[%login [gen ~ ~]] ~ ~] ~])
|
=. +>.$ abet:(deal:~(able ex our) our [[[%login [gen ~ ~]] ~ ~] ~])
|
||||||
::
|
::
|
||||||
:: create galaxy with generator as seed
|
:: initialize hierarchical property
|
||||||
|
::
|
||||||
|
=. +>.$
|
||||||
|
=- abet:(deal:~(able ex our) our - ~)
|
||||||
|
^- jael-purse
|
||||||
|
%- intern:up
|
||||||
|
^- (list jael-right)
|
||||||
|
=/ mir (clan our)
|
||||||
|
?+ mir ~
|
||||||
|
$czar
|
||||||
|
:~ [%fungi [%usr 255] ~ ~]
|
||||||
|
[%hotel [1 255] ~ ~]
|
||||||
|
==
|
||||||
|
$king
|
||||||
|
:~ [%fungi [%upl 65.535] ~ ~]
|
||||||
|
[%hotel [1 65.535] ~ ~]
|
||||||
|
==
|
||||||
|
$duke
|
||||||
|
:~ [%hotel [1 0xffff.ffff] ~ ~]
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: create initial communication secrets
|
||||||
::
|
::
|
||||||
?: (lth our 256)
|
?: (lth our 256)
|
||||||
|
::
|
||||||
|
:: create galaxy with generator as seed
|
||||||
|
::
|
||||||
abet:(next:~(able ex our) key doc)
|
abet:(next:~(able ex our) key doc)
|
||||||
::
|
::
|
||||||
:: had: key handle
|
:: had: key handle
|
||||||
|
@ -3362,7 +3362,7 @@
|
|||||||
++ oryx @t :: CSRF secret
|
++ oryx @t :: CSRF secret
|
||||||
++ page (cask *) :: untyped cage
|
++ page (cask *) :: untyped cage
|
||||||
++ pail ?($none $warm $cold) :: connection status
|
++ pail ?($none $warm $cold) :: connection status
|
||||||
++ pile (tree (pair ship ship)) :: efficient ship set
|
++ pile (tree (pair @ @)) :: efficient ship set
|
||||||
++ pipe :: secure channel
|
++ pipe :: secure channel
|
||||||
$: out/(unit (pair hand bill)) :: outbound key
|
$: out/(unit (pair hand bill)) :: outbound key
|
||||||
inn/(map hand bill) :: inbound keys
|
inn/(map hand bill) :: inbound keys
|
||||||
|
Loading…
Reference in New Issue
Block a user