Various fixes and improvements.

This commit is contained in:
C. Guy Yarvin 2016-08-24 22:05:26 -07:00
parent db68a77424
commit 31ed10d5c4
4 changed files with 117 additions and 403 deletions

View File

@ -29,12 +29,23 @@
por/(map hand fist) :: forward index
:: :: priority queue?
== ::
++ jael-role :: token
$% %e
++ jael-public (map ship gyft) :: public keys
++ jael-embassy (map term jael-partner) ::
++ jael-embassy (map term jael-partner) ::
++ jael-partner :: api apps
$: api/(map term hand) :: apps by name
tok/(map @t (map term hand)) :: shortlived tokens
== ::
++ jael-task :: secret operation
$: {$auth p/(unit @dr) q/ship r/@uvI} :: save capability
{$link p/
{$meet p/gree} :: adopt will
{$nigh p/ship q/life} :: track neighbor
{$ring p/life q/ring} :: save private key
{$wait p/path} :: wait on desk/spur
{$west p/sack q/path r/@ud s/*} :: remote request
== ::
++ jael-secret :: secret by hash
$: key/code :: secret itself
exp/(unit @da) :: expiration date

View File

@ -1,289 +0,0 @@
|% ::
-- ::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: :::::: volume 2, Hoon libraries and compiler ::::::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
~% %hoon
+
==
%al al
%ap ap
%ut ut
%mute mute
%show show
==
|%
::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 2a, basic unsigned math ::::
:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 2b, basic containers ::::
:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Section 2bA, units ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2cE, phonetic base ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2cF, signed and modular ints ::
::
::
++ stat :: positive counter
|* a/$-(* *)
|= (trel ? a (map a @ud))
^+ r
=+ (~(get by r) q)
?: p
(~(put by r) q ?~(- 1 +(u.-)))
?> ?=(^ -)
?:(=(0 u.-) (~(del by r) q) (~(put by r) q (dec u.-)))
:::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 2d, containers ::::
:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2dA, sets ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2dB, maps ::
::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2dC, queues ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2dD, casual containers ::
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 2e, miscellaneous libs ::::
:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eA, packing ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eB, parsing (tracing) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eC, parsing (custom rules) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eD, parsing (combinators) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eE, parsing (composers) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eF, parsing (ascii) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eG, parsing (whitespace) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eH, parsing (idioms) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eI, parsing (external) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eJ, formatting (basic text) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eK, formatting (layout) ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eL, formatting (path) ::
::
::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eY, SHA-256 (move me) ::
::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eZ, OLD rendering (kill me) ::
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 2f, Hoon proper ::::
:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2fA, miscellaneous funs ::
:: ::
::
::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2fB, macro expansion ::
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2fC, prettyprinting ::
::
--
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2fE, grammar ::
::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: :::::: profiling support; move me ::::::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: :::::: volume 3, Arvo models and skeleton ::::::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
~% %arvo + ~
|%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 3bE, Arvo core ::
::
--
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: :::::: Postface ::::::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
=+ pit=`vase`!>(.) ::
!:
=+ bud=pit :: becomes tang
=+ vil=(viol p.bud) :: cached reflexives
=| $: lac/? :: laconic bit
eny/@ :: entropy
niz/(pair worm (list {p/@tas q/vase})) :: modules
== ::
=< |%
++ come |= {@ (list ovum) pone} :: 11
^- {(list ovum) _+>}
~& %hoon-come
=^ rey +>+ (^come +<)
[rey +>.$]
++ keep |=(* (^keep ((hard {@da path}) +<))) :: 4
++ load |= {@ (list ovum) pane} :: 86
^- {(list ovum) _+>}
~& %hoon-load
=^ rey +>+ (^load +<)
[rey +>.$]
++ peek |=(* (^peek ((hard {@da path}) +<))) :: 87
++ poke |= * :: 42
^- {(list ovum) *}
=> .(+< ((hard {now/@da ovo/ovum}) +<))
?: =(%verb -.q.ovo)
[~ +>.$(lac !lac)]
?: ?=($veer -.q.ovo)
[~ +>.$(+ (veer now q.ovo))]
=^ ova +>+ (^poke now ovo)
|- ^- {(list ovum) *}
?~ ova
[~ +>.^$]
?: ?=($verb -.q.i.ova)
$(ova t.ova, lac !lac)
?: ?=($veer -.q.i.ova)
$(ova t.ova, +>+.^$ (veer now q.i.ova))
?: ?=($vega -.q.i.ova)
(fall (vega now t.ova (path +.q.i.ova)) [~ +>.^$])
?: ?=($mass -.q.i.ova)
=+ avo=$(ova t.ova)
:_ +.avo
:_ -.avo
%= i.ova
q.q
:- %userspace
:- %|
:~ hoon+`pit
zuse+`bud
hoon-cache+`p.niz
q.q.i.ova
dot+`.
==
==
=+(avo=$(ova t.ova) [[i.ova -.avo] +.avo])
++ wish |=(* (^wish ((hard @ta) +<))) :: 20
--
|%
++ come :: load incompatible
|= {yen/@ ova/(list ovum) nyf/pone}
^+ [ova +>]
(load yen ova (turn nyf |=({a/@tas b/vise} [a (slim b)])))
::
++ keep :: wakeup delay
|= {now/@da hap/path}
=> .(+< ((hard {now/@da hap/path}) +<))
(~(doos (is vil eny bud niz) now) hap)
::
++ load :: load compatible
|= {yen/@ ova/(list ovum) nyf/pane}
^+ [ova +>]
=: eny yen
q.niz nyf
==
|- ^+ [ova +>.^$]
?~ ova
[~ +>.^$]
?: ?=($verb -.q.i.ova)
$(ova t.ova, lac !lac)
?: ?=($veer -.q.i.ova)
$(ova t.ova, +>.^$ (veer *@da q.i.ova))
=+(avo=$(ova t.ova) [[i.ova -.avo] +.avo])
::
++ peek :: external inspect
|= {now/@da hap/path}
^- (unit)
?~ hap [~ hoon]
=+ rob=((sloy ~(beck (is vil eny bud niz) now)) [151 %noun] hap)
?~ rob ~
?~ u.rob ~
[~ u.u.rob]
::
++ poke :: external apply
|= {now/@da ovo/ovum}
=. eny (mix eny (shax now))
:: ~& [%poke -.q.ovo]
^- {(list ovum) _+>}
=^ zef niz
(~(hurl (is vil eny bud niz) now) lac ovo)
[zef +>.$]
::
++ vega :: reboot kernel
|= {now/@da ova/(list ovum) hap/path}
^- (unit {p/(list ovum) q/*})
=- ?:(?=($| -.res) ((slog p.res) ~) `p.res)
^= res %- mule |.
=+ pax=(weld hap `path`[%hoon ~])
~& [%vega-start hap]
=+ src=((hard @t) (need (peek now cx+pax)))
=+ saz=(shax src)
=+ gen=(rain hap src)
~& %vega-parsed
=+ ken=.*(0 q:(~(mint ut %noun) %noun gen))
=+ ^= nex
=+ gat=.*(ken .*(ken [0 87]))
(need ((hard (unit @)) .*([-.gat [[now ~] +>.gat]] -.gat)))
~& [%vega-compiled hoon nex]
?> (lte nex hoon)
=+ gat=.*(ken .*(ken [0 ?:(=(nex hoon) 86 11)]))
=+ sam=[eny ova q.niz]
=+ raw=.*([-.gat [sam +>.gat]] -.gat)
[[[~ %vega hap] ((list ovum) -.raw)] +.raw]
::
++ veer :: install vane/tang
|= {now/@da fav/curd}
=> .(fav ((hard {$veer lal/@ta pax/path txt/@t}) fav))
=- ?:(?=($| -.res) ((slog p.res) +>.$) p.res)
^= res %- mule |.
?: =(%$ lal.fav)
~& [%tang pax.fav `@p`(mug txt.fav)]
=+ gen=(rain pax.fav txt.fav)
=+ vax=(slap pit gen)
+>.^$(bud vax)
%_ +>.^$
q.niz
|- ^+ q.niz
?~ q.niz
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
=+ vin=(vint lal.fav vil bud pax.fav txt.fav)
?~ vin
q.niz
[[lal.fav q.sew:u.vin] q.niz]
?. =(lal.fav p.i.q.niz)
[i.q.niz $(q.niz t.q.niz)]
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
:_ t.q.niz
:- p.i.q.niz
q.sew:(ruck:(vent lal.fav vil bud [p.niz q.i.q.niz]) pax.fav txt.fav)
==
::
++ wish :: external compute
|= txt/@
q:(slap bud (ream txt))
--
. ==

View File

@ -101,14 +101,14 @@
++ gift :: output
$% {$east p/duct q/ship r/chan s/*} :: network response
{$home p/lane q/@} :: resend to self
{$know p/ship} :: cache channel
{$mine p/ship} :: cache channel
{$link p/ship q/code} :: add symmetric key
{$meet p/gyft} :: add public key(s)
{$rest p/duct q/coop} :: message result
{$send p/lane q/@} :: transmit packet
{$west p/ship q/bole r/chan s/*} :: outbound message
== ::
++ kiss :: input
++ task :: input
$% {$clue p/ship q/pipe} :: update channel
{$done p/ship q/bole r/coop} :: completion
{$hear p/lane q/@} :: incoming packet
@ -128,7 +128,7 @@
|% ::
++ abet [(flop fex) syl] :: resolve
++ apex :: compute
|= job/kiss
|= job/task
^+ +>
?- -.job
$clue abet:(clue:(etre p.job) q.job)
@ -201,7 +201,7 @@
++ done
|= {kos/bole cop/coop}
^+ +>
(in-kiss %done +<)
(in-task %done +<)
:: ::
++ have :: receive message
|= {kos/bole cha/chan val/*}
@ -212,7 +212,7 @@
:: if the bole is even, this is a backward flow,
:: like a subscription update; ack automatically.
::
(acme:(in-kiss %done kos ~) %east hen who cha val)
(acme:(in-task %done kos ~) %east hen who cha val)
::
:: if the bole is odd, it's a forward flow. we
:: need to wait for the target to actively ack it.
@ -222,12 +222,12 @@
++ hear ::
|= {lyn/lane dam/flap syn/skin msg/@} :: hear packet
^+ +>
(in-kiss %hear +<)
(in-task %hear +<)
:: ::
++ mess :: send message
|= {kos/bole cha/chan val/*}
^+ +>
(to-kiss kos %mess cha val)
(to-task kos %mess cha val)
:: ::
++ sack :: send acknowledgment
|= {kos/bole dam/flap cop/coop}
@ -285,7 +285,7 @@
$have (have +.hox)
$link (acme %link who key.hox)
$meet (acme hox)
$rack (to-kiss kos.hox %back dam.hox cop.hox ~s0)
$rack (to-task kos.hox %back dam.hox cop.hox ~s0)
$rout +>(lun.bah `lyn.hox)
$sack (sack +.hox)
==
@ -308,14 +308,14 @@
?~ raz +>
$(raz t.raz, +> (to-gift i.raz))
::
++ in-kiss
|= kyz/kiss:hose
++ in-task
|= kyz/task:hose
^+ +>
=^ hoz fon.bah abet:(~(apex hose [who det.bah] ~ fon.bah) kyz)
(in-gifs hoz)
::
++ to-kiss
|= {kos/bole kyz/kiss:rail}
++ to-task
|= {kos/bole kyz/task:rail}
^+ +>
=+ cot=((bond |.(zeal:rail)) (~(get by sal.bah) kos))
=^ raz cot abet:(work:(to-rail kos cot) kyz)
@ -472,7 +472,7 @@
{$rout lyn/lane} :: learn route
{$sack kos/bole dam/flap cop/coop} :: send ack
== ::
++ kiss :: event
++ task :: event
$% {$done kos/bole cop/coop} :: commit message
{$hear lyn/lane dam/flap syn/skin msg/@} :: raw packet
== ::
@ -490,7 +490,7 @@
|=(fix/(list gift) +>(fex (weld (flop fix) fex))) ::
:: ::
++ apex :: input
|= job/kiss
|= job/task
^+ +>
?- -.job
$done
@ -655,7 +655,7 @@
$% {$good p/flap q/part r/@dr s/coop} :: logical ack
{$send p/flap q/part r/rock} :: release packet
== ::
++ kiss :: event
++ task :: event
$% {$back p/flap q/coop r/@dr} :: raw ack
{$cull p/tick} :: cancel message
{$pack p/(list clue)} :: submit packets
@ -865,7 +865,7 @@
(sub gap rey.saw)
::
++ work ::
|= {now/@da job/kiss} :: perform
|= {now/@da job/task} :: perform
^+ +>
?- -.job
$back (back now [p q r]:job)
@ -951,7 +951,7 @@
{$mack p/bole q/coop} :: message ack
{$send p/flap q/rock} :: release packet
== ::
++ kiss ::
++ task ::
$% {$back p/flap q/coop r/@dr} :: raw ack
{$mess p/chan q/*} :: send message
{$wake $~} :: random wakeup
@ -984,7 +984,7 @@
--
::
++ work ::
|= job/kiss :: compute
|= job/task :: compute
^+ +>
=< +>:wy-abet:wy-work
|% ::
@ -1134,89 +1134,89 @@
--
--
. ==
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 4aH, protocol vane ::
::
=| $: syl/silo :: kernel state
== ::
|= {now/@da eny/@ ski/sley} :: current invocation
=> |%
++ look :: get secure channel
|= who/ship
^- pipe
!!
::
++ love ~(. loft [now eny look] syl ~) :: create loft
++ lung :: gift to move
|= gax/gift:loft
^- move
?- -.gax
$east [p.gax %give [%east s.gax]]
$home [~ %give gax]
$know [~ %pass /sec %j gax]
$link [~ %pass /sec %j gax]
$meet [~ %pass /sec %j gax]
$rest [p.gax %give %rest q.gax]
$send [~ %give gax]
$west
=+ pax=/msg/(scot %p p.gax)/(scot %ud q.gax)
=+ cad=[%west p.gax +.r.gax s.gax]
=+ dat=?+(-.r.gax !! $c [%c cad], $e [%e cad], $g [%g cad])
[~ %pass pax dat]
==
::
++ work
|= job/kiss:loft
^- {(list move) q/_..^$}
=^ fex syl abet:(apex:love job)
[(turn fex lung) ..^$]
--
|% :: vane interface
++ call :: handle request
|= $: hen/duct
hic/(hypo kiss-xmas)
==
^- {p/(list move) q/_..^$}
%- work
^- kiss:loft
?- -.q.hic
$hear q.hic
$mess [%mess p.q.hic hen q.q.hic r.q.hic]
$wake q.hic
==
::
++ doze
|= {now/@da hen/duct}
^- (unit @da)
!!
::
++ load
|= old/silo
^+ ..^$
..^$(syl old)
::
++ scry
|= {fur/(unit (set monk)) ren/@tas who/ship syd/desk lot/coin tyl/path}
^- (unit (unit cage))
~
::
++ stay syl
++ take :: accept response
|= {tea/wire hen/duct hin/(hypo sign-arvo)}
^- {p/(list move) q/_..^$}
%- work
?+ -.tea !!
$msg
?> ?=({@ @ $~} +.tea)
=+ [who kos]=[(slav %p i.t.tea) (slav %ud i.t.t.tea)]
?> ?=(?($rend $mack) +<.q.hin)
?- +<.q.hin
$rend [%rend who kos p.+.q.hin q.+.q.hin]
$mack [%done who kos ?~(p.+.q.hin ~ `coop`[~ `[%fail u.p.+.q.hin]])]
:: ::
:::: :::: kernel interface
:: ::
=| $: syl/silo :: kernel state
== ::
|= {now/@da eny/@ ski/sley} :: current invocation
=> |%
++ look :: get secure channel
|= who/ship
^- pipe
!!
::
++ love ~(. loft [now eny look] syl ~) :: create loft
++ lung :: gift to move
|= gax/gift:loft
^- move
?- -.gax
$east [p.gax %give [%east s.gax]]
$home [~ %give gax]
$link [~ %pass /sec %j gax]
$meet [~ %pass /sec %j gax]
$mine [~ %pass /sec %j gax]
$rest [p.gax %give %rest q.gax]
$send [~ %give gax]
$west
=+ pax=/msg/(scot %p p.gax)/(scot %ud q.gax)
=+ cad=[%west p.gax +.r.gax s.gax]
=+ dat=?+(-.r.gax !! $c [%c cad], $e [%e cad], $g [%g cad])
[~ %pass pax dat]
==
::
$sec
?> ?=($clue +<.q.hin)
+.q.hin
++ work
|= job/task:loft
^- {(list move) q/_..^$}
=^ fex syl abet:(apex:love job)
[(turn fex lung) ..^$]
--
|% :: vane interface
++ call :: handle request
|= $: hen/duct
hic/(hypo kiss-xmas)
==
^- {p/(list move) q/_..^$}
%- work
^- task:loft
?- -.q.hic
$hear q.hic
$mess [%mess p.q.hic hen q.q.hic r.q.hic]
$wake q.hic
==
::
++ doze
|= {now/@da hen/duct}
^- (unit @da)
doze:love
::
++ load
|= old/silo
^+ ..^$
..^$(syl old)
::
++ scry
|= {fur/(unit (set monk)) ren/@tas who/ship syd/desk lot/coin tyl/path}
^- (unit (unit cage))
~
::
++ stay syl
++ take :: accept response
|= {tea/wire hen/duct hin/(hypo sign-arvo)}
^- {p/(list move) q/_..^$}
%- work
?+ -.tea !!
$msg
?> ?=({@ @ $~} +.tea)
=+ [who kos]=[(slav %p i.t.tea) (slav %ud i.t.t.tea)]
?> ?=(?($rend $mack) +<.q.hin)
?- +<.q.hin
$rend [%rend who kos p.+.q.hin q.+.q.hin]
$mack [%done who kos ?~(p.+.q.hin ~ `coop`[~ `[%fail u.p.+.q.hin]])]
==
--
::
$sec
?> ?=($clue +<.q.hin)
+.q.hin
==
--

View File

@ -3366,7 +3366,7 @@
$: out/(unit (pair hand code)) :: outbound key
inn/(map hand code) :: inbound keys
cur/(pair life (unit life)) :: versions: our their
gyt/gyft :: our unshared cert
gyt/gree :: our unshared cert
pub/(map life pass) :: their public keys
war/(map life ring) :: our private keys
== ::
@ -3576,7 +3576,7 @@
$: $j :: to %jael
$% {$know p/ship} ::
{$link p/ship q/code} ::
{$meet p/gyft} ::
{$meet p/gree} ::
== == == ::
::
:::: %behn
@ -3630,7 +3630,7 @@
::
++ deod {myn/mind syg/@uw} :: signature
++ lama ::
$: dob/? :: & clean, | rough
$: dob/? :: & clean, | dirty
exp/@da :: expiration date
pub/pass :: public key
== ::
@ -3638,7 +3638,7 @@
$: who/@p :: identity
exp/(unit @da) :: expiration date
== ::
++ gyft (map ship (map life (tale lama))) :: pki dump set
++ gree (map ship (map life (tale lama))) :: pki dump set
++ mind {lyf/@ud who/@p} :: key identifier
++ tale :: urbit-signed atom
|* typ/mold ::
@ -3650,14 +3650,6 @@
$: len/@ud ::
log/(list (tale lama)) ::
== ::
++ kiss-jael :: secret operation
$: {$auth p/(unit @dr) q/ship r/@uvI} :: save capability
{$meet p/gyft} :: adopt will
{$nigh p/ship q/life} :: track neighbor
{$ring p/life q/ring} :: save private key
{$wait p/path} :: wait on desk/spur
{$west p/sack q/path r/@ud s/*} :: remote request
== ::
::
::::
::