From 3d1b20cfdde052ea569fd259c7fcd99c1e2b26c7 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 6 Jun 2014 18:03:36 -0700 Subject: [PATCH 1/4] Apply actual type checks in arvo core. --- arvo/hoon.hoon | 58 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 1d9199e0b..d34250c43 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -9173,6 +9173,8 @@ ++ slut $+(* (unit (unit))) :: old namespace ++ vile :: reflexive constants $: typ=type :: -:!>(*type) + duc=type :: -:!>(*duct) + pah=type :: -:!>(*path) mev=type :: -:!>([%meta *vase]) moh=type :: -:!>(*(list mosh)) == :: @@ -9222,7 +9224,7 @@ :: section 3bE, Arvo core :: :: ++ vent :: vane core - |= [vil=vile bud=vase ves=vase] + |= [lal=@tas vil=vile bud=vase ves=vase] |% ++ ruck :: update vase |= [pax=path txt=@ta] @@ -9256,6 +9258,14 @@ [%& (slop p.hed p.tal)] [%| [%cell p.p.hed p.p.tal] [q.p.hed q.p.tal]] :: + ++ slix + |= hil=mill + ^- mill + ?- -.hil + & [%& (slop [typ.vil p.p.hil] p.hil)] + | [%| [%cell typ.vil p.p.hil] p.hil] + == + :: ++ slur |= [gat=vase hil=mill] ^- (unit vase) @@ -9263,8 +9273,8 @@ ?. ?- -.hil & (souk p.sam p.p.hil) | (sike p.sam p.p.hil) - == ~ - `(slym gat sam) + == ~ + `(slym gat +>.hil) :: ++ souk :: check type |= [sub=type ref=type] @@ -9354,7 +9364,7 @@ :* fur ren p.bed - q.bed + q.bed `coin`[%$ r.bed] (flop s.bed) == @@ -9378,27 +9388,32 @@ hil=mill == ^- [p=(list move) q=vase] - =+ ^= pro - :: %- need + =+ ^= pru ?~ pux - (slym (slap rig [%cnzy %call]) [hen +.hil]) - (slym (slap rig [%cnzy %take]) [u.pux hen +.hil]) - :: (slur (slap rig [%cnzy %call]) (slid [%& !>(hen)] hil)) - :: (slur (slap rig [%cnzy %take]) (slid [%& !>([u.pux hen])] hil)) + %+ slur (slap rig [%cnzy %call]) + (slid [%& duc.vil hen] (slix hil)) + %+ slur (slap rig [%cnzy %take]) + :(slid [%& pah.vil u.pux] [%& duc.vil hen] (slix hil)) + ?~ pru + ~& [%swim-lost lal (,@tas +>-.hil)] + [~ ves] + =+ pro=(need pru) :- (said (slap pro [%cnzy %p])) (soar (slap pro [%cnzy %q])) -- -- :: ++ vint :: create vane - |= [vil=vile bud=vase pax=path txt=@ta] :: - (vent vil bud (slym (slap bud (rain pax txt)) bud)) + |= [lal=@tas vil=vile bud=vase pax=path txt=@ta] :: + (vent lal vil bud (slym (slap bud (rain pax txt)) bud)) :: ++ viol :: vane tools |= but=type ^- vile =+ pal=|=(a=@t ^-(type (~(play ut but) (vice a)))) :* typ=(pal '_type') + duc=(pal '_duct') + pah=(pal '_path') mev=(pal '_[%meta vase]') moh=(pal '_(list mosh)') == @@ -9411,12 +9426,12 @@ |= [fur=(unit (set monk)) ron=term bed=bead] ^- (unit (unit cage)) => .(fur ?^(fur fur `[[%& p.bed] ~ ~])) :: XX heinous - =+ dis=(end 3 1 ron) + =+ lal=(end 3 1 ron) =+ ren=(care (rsh 3 1 ron)) |- ^- (unit (unit cage)) ?~ fan ~ - ?. =(dis p.i.fan) $(fan t.fan) - %- scry:(wink:(vent vil bud q.i.fan) now (shax now) ..^$) + ?. =(lal p.i.fan) $(fan t.fan) + %- scry:(wink:(vent lal vil bud q.i.fan) now (shax now) ..^$) [fur ren bed] :: ++ dink :: vase by char @@ -9436,7 +9451,8 @@ :: ++ doos :: sleep until |= hap=path ^- (unit ,@da) - (doze:(wink:(vent vil bud (dink (dint hap))) now 0 beck) now [hap ~]) + =+ lal=(dint hap) + (doze:(wink:(vent lal vil bud (dink lal)) now 0 beck) now [hap ~]) :: ++ hurl :: start loop |= [lac=? ovo=ovum] @@ -9455,9 +9471,9 @@ == :: ++ race :: take - |= [pux=(unit wire) hen=duct hil=mill ves=vase] + |= [lal=@tas pux=(unit wire) hen=duct hil=mill ves=vase] ^- [p=(list move) q=vase] - =+ ven=(vent vil bud ves) + =+ ven=(vent lal vil bud ves) =+ win=(wink:ven now (shax now) beck) (swim:win pux hen hil) :: @@ -9471,7 +9487,7 @@ ?. =(lal p.i.naf) =+ tuh=$(naf t.naf) [-.tuh [i.naf +.tuh]] - =+ fiq=(race pux hen hil q.i.naf) + =+ fiq=(race lal pux hen hil q.i.naf) [[~ (turn p.fiq |=(a=move [lal a]))] [[p.i.naf q.fiq] t.naf]] :: ++ jack :: dispatch card @@ -9631,11 +9647,11 @@ |- ^+ fan ?~ fan ~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)] - [[lal.fav ves:(vint vil bud pax.fav txt.fav)] fan] + [[lal.fav ves:(vint lal.fav vil bud pax.fav txt.fav)] fan] ?. =(lal.fav p.i.fan) [i.fan $(fan t.fan)] ~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)] - [[p.i.fan ves:(ruck:(vent vil bud q.i.fan) pax.fav txt.fav)] t.fan] + [[p.i.fan ves:(ruck:(vent lal.fav vil bud q.i.fan) pax.fav txt.fav)] t.fan] == :: ++ wish :: external compute From ba59c5bffc831d5bf4fcb4c7f19b9cb1b104a8c2 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 7 Jun 2014 11:36:31 -0700 Subject: [PATCH 2/4] Various fixes and improvements. --- arvo/eyre.hoon | 37 +++++++++++++++++++++++++-------- arvo/ford.hoon | 40 ++++++++++++++++++------------------ arvo/gall.hoon | 55 ++++++++++++++++++++++---------------------------- arvo/hoon.hoon | 13 ++++++------ arvo/zuse.hoon | 37 +++++++++------------------------ 5 files changed, 90 insertions(+), 92 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 10b34943a..5be74d8ee 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -3,11 +3,12 @@ :::: |= pit=vase => =~ -|% :: metastructures +|% :: interfaces ++ gift :: out result <-$ $% [%thou p=httr] :: raw http response [%thus p=@ud q=(unit hiss)] :: http request/cancel == :: +++ hope (pair ,? path) :: see %gall ++ kiss :: in request ->$ $% [%born ~] :: new unix process [%crud p=@tas q=(list tank)] :: XX rethink @@ -32,9 +33,10 @@ [%warp p=sock q=riff] :: to %clay == :: ++ sign :: in result $-< - $% [%crud p=@tas q=(list tank)] :: by any + $% [%boot ~] :: by %gall + [%crud p=@tas q=(list tank)] :: by any [%helo p=path q=prod] :: by %batz - [%made p=(each beet (list tank))] :: by %ford + [%made p=(each bead (list tank))] :: by %ford :: [%rush p=@da q=json] :: by %gall [%rust p=@da q=cage] :: by %gall [%talk p=tank] :: by %batz @@ -47,7 +49,7 @@ [%writ p=riot] :: by %clay == -- -|% :: structures +|% :: models ++ bolo :: eyre state $: %0 :: version gub=@t :: random identity @@ -83,7 +85,7 @@ == :: $% [%err p=@ud q=(list tank)] :: error report [%fin p=love] :: ready to send - [%fud p=(each beet (list tank))] :: function finished + [%fud p=(each bead (list tank))] :: function finished [%haz p=riot] :: clay responded [%raw p=hiss] :: wild url [%who p=@tas q=@ta] :: awaiting auth @@ -99,6 +101,21 @@ sor=@p :: home sponsor rem=[p=@ud q=(map ,@ud duct)] :: active requests == :: +++ seam :: logical request + $% [%ape p=term q=@ud] :: await update + [%apg p=term q=logo r=path] :: app get + [%apl p=term q=@ud r=term] :: app poll + [%apm p=term q=json] :: app message + [%aps p=term q=term r=(unit path)] :: app subscribe + [%apu p=term q=logo r=octs] :: app upload + [%cog p=@ud q=@ud] :: console get + [%con p=@ud] :: console face + [%cop p=@ud q=@ud r=json] :: console put + [%det p=desk q=moat] :: load changes + [%fun p=term q=tube r=(list manx)] :: functional + [%lon p=seal] :: authentication flow + [%red p=purl] :: redirect + == :: ++ serf :: local server $: pef=@t :: server prefix wup=(map hole cyst) :: secure sessions @@ -211,6 +228,10 @@ |= [tea=wire sin=sign] ^+ +> ?- -.sin + %boot + ~& %eyre-boot + +>.$ + :: %crud +>.$(mow [[hen %slip %d %flog sin] mow]) :: @@ -344,7 +365,7 @@ [sas ~[content-type/'text/plain'] [~ (tact str)]] :: ++ galt - |= [our=ship ses=hole num=@ud mez=(each beet (list tank))] + |= [our=ship ses=hole num=@ud mez=(each bead (list tank))] ^+ +> =+ suf=(~(get by own) our) ?~ suf +>.$ @@ -1176,7 +1197,7 @@ +>.$ :: ++ inch :: function built - |= [num=@ud mez=(each beet (list tank))] + |= [num=@ud mez=(each bead (list tank))] ^+ +> ~& [%inch num -.mez] =+ pup=(~(get by q.rey) num) @@ -1517,7 +1538,7 @@ :: %fun :- [~ pip(pez %way)] - =+ bem=`bead`(need (tome q.som.pip)) + =+ bem=`beam`(need (tome q.som.pip)) =+ bek=`beak`[p.bem q.bem r.bem] =+ kas=`silk`[%cast %mime bek `silk`[%boil p.som.pip bem]] +>.$(..ya (honk our num ses kas)) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index fbbd0ff19..92725fbf7 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -6,7 +6,7 @@ :: structures |% ++ gift :: out result <-$ - $% [%made p=(each beet (list tank))] :: computed result + $% [%made p=(each bead (list tank))] :: computed result == :: ++ kiss :: in request ->$ $% [%exec p=@p q=(unit silk)] :: make / kill @@ -33,8 +33,8 @@ |* a=$+(* *) :: product clam $: p=cafe :: cache $= q :: - $% [%0 p=(set bead) q=a] :: depends/product - [%1 p=(set ,[p=bead q=(list tank)])] :: blocks + $% [%0 p=(set beam) q=a] :: depends/product + [%1 p=(set ,[p=beam q=(list tank)])] :: blocks [%2 p=(list tank)] :: error == :: == :: @@ -50,7 +50,7 @@ :: :: ++ calm :: cache metadata $: laz=@da :: last accessed - dep=(set bead) :: dependencies + dep=(set beam) :: dependencies == :: ++ calx :: concrete cache line $% [%comp p=calm q=cage r=twig] :: compile by text @@ -59,7 +59,7 @@ ++ task :: problem in progress $: nah=duct :: cause kas=silk :: problem - kig=[p=@ud q=(map ,@ud bead)] :: blocks + kig=[p=@ud q=(map ,@ud beam)] :: blocks == :: -- :: |% :: @@ -100,7 +100,7 @@ == :: ++ fine |* [a=cafe b=*] :: bolt from data - [p=`cafe`a q=[%0 p=*(set bead) q=b]] :: + [p=`cafe`a q=[%0 p=*(set beam) q=b]] :: ++ flaw |=([a=cafe b=(list tank)] [p=a q=[%2 p=b]]) :: bolt from error :: ++ grom :: merge sets @@ -167,7 +167,7 @@ == ++ camo :: stop requests ^+ . - =+ kiz=(~(tap by q.kig) *(list ,[p=@ud q=bead])) + =+ kiz=(~(tap by q.kig) *(list ,[p=@ud q=beam])) |- ^+ +> ?~ kiz +> %= $ @@ -180,7 +180,7 @@ == :: ++ camp :: request a file - |= [ren=care bem=bead] + |= [ren=care bem=beam] ^+ +> =+ tik=(scot %ud p.kig) =: p.kig +(p.kig) @@ -260,13 +260,13 @@ ^= q ?- -.ton %2 [%2 p=p.ton] - %0 [%0 p=*(set bead) q=(fun p.ton)] + %0 [%0 p=*(set beam) q=(fun p.ton)] %1 =- ?- faw - & [%1 p=(turn p.faw |=(a=bead [a *(list tank)]))] + & [%1 p=(turn p.faw |=(a=beam [a *(list tank)]))] | [%2 p=p.faw] == ^= faw - |- ^- (each (list bead) (list tank)) + |- ^- (each (list beam) (list tank)) ?~ p.ton [%& ~] =+ nex=$(p.ton t.p.ton) =+ pax=(path i.p.ton) @@ -297,7 +297,7 @@ =< abet |- ^+ ..exec ?~ zuk ..exec - =+ foo=`_..exec`(camp %x `bead`p.i.zuk) + =+ foo=`_..exec`(camp %x `beam`p.i.zuk) $(zuk t.zuk, ..exec foo) == :: @@ -363,7 +363,7 @@ (fine cof p.cay vax) :: ++ krab :: load to twig - |= [cof=cafe for=logo how=logo rem=spur bem=bead] + |= [cof=cafe for=logo how=logo rem=spur bem=beam] ^- (bolt vase) %+ cope (fade cof %bake how bem) |= [cof=cafe gen=twig] @@ -372,7 +372,7 @@ (maul cof gat !>([`beak`[p.bem q.bem r.bem] for +:s.bem rem])) :: ++ lace :: load and check - |= [cof=cafe for=logo rem=spur bem=bead] + |= [cof=cafe for=logo rem=spur bem=beam] ^- (bolt (unit vase)) =+ bek=`beak`[p.bem q.bem r.bem] %+ cope (lend cof bem) @@ -407,7 +407,7 @@ (fine cof ~ pro) :: ++ lair :: metaload - |= [for=logo bem=bead] + |= [for=logo bem=beam] |= [cof=cafe vax=vase] ^- (bolt vase) ?. (~(nest ut -:!>(*silk)) | p.vax) @@ -423,14 +423,14 @@ |=(ref=type ref) :: ++ lend :: load arch - |= [cof=cafe bem=bead] + |= [cof=cafe bem=beam] ^- (bolt arch) =+ von=(ska %cy (tope bem)) ?~ von [p=cof q=[%1 [bem ~] ~ ~]] (fine cof ((hard arch) (need u.von))) :: ++ liar :: load vase - |= [cof=cafe bem=bead] + |= [cof=cafe bem=beam] ^- (bolt vase) =+ von=(ska %cx (tope bem)) ?~ von @@ -450,7 +450,7 @@ (fine cof ?.(=(%hoon for) all [%hoot all])) :: ++ lima :: load at depth - |= [cof=cafe for=logo rem=spur bem=bead] + |= [cof=cafe for=logo rem=spur bem=beam] ^- (bolt (unit vase)) %+ cope (lend cof bem) |= [cof=cafe arc=arch] @@ -472,8 +472,8 @@ |= [cof=cafe vax=vase] (fine cof ~ vax) :: - ++ lime :: load bead - |= [cof=cafe for=logo bem=bead] + ++ lime :: load beam + |= [cof=cafe for=logo bem=beam] =+ [mob=bem rem=*path] |- ^- (bolt vase) %+ cope (lima cof for rem bem) diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 747d84cbb..d0e908232 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -9,33 +9,32 @@ pol=(map ship mast) :: apps by ship == :: ++ bone ,@ud :: opaque duct +++ chop ,[p=@ud q=@da] :: revision/date ++ gift :: out result <-$ $% [%back p=?] :: %mess ack good/bad - [%boot ~] :: app boot/reboot + [%boot p=@ud q=@da] :: response to %wait [%crud p=@tas q=(list tank)] :: error + [%done ~] :: reset duct [%rasp p=cage] :: reaction message - [%rush p=@da q=json] :: difference (web) - [%rusk p=@da q=cage] :: difference (urbit) - [%rust p=@da q=cage] :: full update + [%rush p=chop q=cage] :: difference + [%rust p=chop q=cage] :: full update [%meta p=vase] :: meta-gift == :: +++ hope (pair ,? path) :: view/subscribe ++ kiss :: in request ->$ $% [%show p=hasp q=(unit hope)] :: urb subscribe/cancel [%cuff p=(unit cuff) q=kiss] :: controlled kiss - [%mesh p=hasp q=path r=json] :: web message (json) - [%mess p=hasp q=cage] :: urbit message - [%mush p=hasp q=path r=cage] :: web message (mime) + [%mess p=hasp q=cage] :: message [%nuke p=hasp] :: reset this duct - :: [%puke p=(list tank) q=kiss] :: kiss will fail - [%shah p=hasp q=(unit hope)] :: web subscribe/cancel + [%show p=hasp q=(unit hope)] :: web subscribe/cancel + [%wait p=@ud] :: await revision == :: ++ knob :: pending action $% [%boot ~] :: boot/reboot [%crud p=@tas q=(list tank)] :: error [%mess p=cage] :: message - [%nuke ~] :: reboot - [%shah p=(unit hope)] :: web subscribe/cancel - [%show p=(unit hope)] :: urb subscribe/cancel + [%nuke ~] :: destroy duct + [%show p=(unit hope)] :: subscribe/cancel [%take p=path q=vase] :: user result == :: ++ mast :: apps by ship @@ -55,14 +54,16 @@ == :: ++ seat :: the living app $: huv=(unit vase) :: application vase - qic=(unit toil) :: project - vey=(qeu toil) :: pending calls - orm=(unit ,@da) :: last buildtime + qic=(unit toil) :: current project + vey=(qeu toil) :: pending projects + tik=@ud :: build number + orm=(unit ,@da) :: build date + med=(map duct ,@ud) :: waiters ped=(set (pair ship desk)) :: dependencies zam=scar :: opaque ducts == :: ++ sign :: in result $-< - $% [%made p=(each beet (list tank))] :: by %ford + $% [%made p=(each bead (list tank))] :: by %ford [%ruse p=curd] :: user wrapper [%writ p=riot] :: by %clay == :: @@ -148,12 +149,10 @@ == ?- -.q.hic %cuff $(q.hic q.q.hic, law (limp p.q.hic law)) - %mesh !! %mess [law p.q.hic %mess q.q.hic] - %mush !! - %shah [law p.q.hic %shah q.q.hic] %show [law p.q.hic %show q.q.hic] %nuke [law p.q.hic %nuke ~] + %wait !! == abet:work:(quem:(boar:(goat hap) hen law) kon) :: @@ -185,7 +184,7 @@ :- [who syd ((hard case) p.lot)] (flop tyl) |= $: use=(unit (set monk)) :: observers - bid=bead :: position + bid=beam :: position == :: (beef:(gaur p.bid q.bid) use r.bid s.bid) %+ bind @@ -379,7 +378,7 @@ %_(+>.$ ped.sat pen, mow :(weld new old mow)) :: ++ drum :: raw dependencies - |= dep=(set bead) + |= dep=(set beam) ^+ +> ?> ?=(^ orm.sat) %- drug @@ -466,6 +465,8 @@ :: ++ morn :: successful boot |= vax=vase + ^+ +> + :: =. +> (give [%boot ~]) %_(+> huv.sat `vax) :: ++ mort :: failed boot @@ -503,7 +504,7 @@ :: [%rust *] :^ %rust - ((hard ,@da) +<.q.vig) + ((hard chop) +<.q.vig) ((hard lode) +>-.q.vig) (slot 15 vig) == @@ -579,17 +580,9 @@ ~& %yawn-show ?~ huv.sat ~& [%show-none our app] - gone:(give %boot ~) + gone:(give %done ~) %^ game [%step %peer] u.huv.sat !>([ost use | p.kon]) - :: - %shah - ~& %yawn-shah - ?~ huv.sat - ~& [%show-none our app] - gone:(give %boot ~) - %^ game [%step %peer] u.huv.sat - !>([ost use & p.kon]) :: %take ~& %yawn-take diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index d34250c43..fea78b8b5 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -9090,7 +9090,8 @@ |% ++ arch ,[p=@uvI q=(unit ,@uvI) r=(map ,@ta ,~)] :: fundamental node ++ arvo (mold mill mill) :: arvo card -++ bead ,[[p=ship q=desk r=case] s=path] :: global name +++ beam ,[[p=ship q=desk r=case] s=path] :: global name +++ beak ,[p=ship q=desk r=case] :: garnish with beak ++ bone ,@ud :: opaque ++ care ?(%$ %u %v %w %x %y %z) :: namespace mode ++ case :: version @@ -9101,7 +9102,7 @@ ++ desk ,@tas :: ship desk case spur ++ cage ,[p=lode q=vase] :: structured data ++ cuff :: permissions - $: p=(unit (set monk)) :: readers + $: p=kirk :: readers q=(set monk) :: authors == :: ++ curd ,[p=@tas q=*] :: typeless card @@ -9168,7 +9169,7 @@ ++ pane (list ,[p=@tas q=vase]) :: kernel modules ++ pone (list ,[p=@tas q=vise]) :: kernel modules, old ++ ship ,@p :: network identity -++ sled $+ [(unit (set monk)) term bead] :: namespace function +++ sled $+ [(unit (set monk)) term beam] :: namespace function (unit (unit cage)) :: ++ slut $+(* (unit (unit))) :: old namespace ++ vile :: reflexive constants @@ -9207,7 +9208,7 @@ ++ slub !: |= sul=slut ^- sled - |= [fur=(unit (set monk)) ron=term bed=bead] + |= [fur=(unit (set monk)) ron=term bed=beam] ^- (unit (unit cage)) =+ ^= pax ^- path :* ron @@ -9357,7 +9358,7 @@ ++ scry :: read namespace |= $: fur=(unit (set monk)) ren=care - bed=bead + bed=beam == ^- (unit (unit cage)) =+ ^= old @@ -9423,7 +9424,7 @@ |_ now=@da ++ beck ^- sled - |= [fur=(unit (set monk)) ron=term bed=bead] + |= [fur=(unit (set monk)) ron=term bed=beam] ^- (unit (unit cage)) => .(fur ?^(fur fur `[[%& p.bed] ~ ~])) :: XX heinous =+ lal=(end 3 1 ron) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 7dc5ff832..44f41aabf 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1951,7 +1951,7 @@ :: ++ tome :: parse path |= pax=path - ^- (unit bead) + ^- (unit beam) ?. ?=([* * * *] pax) ~ %+ biff (slaw %p i.pax) |= who=ship @@ -1960,10 +1960,10 @@ %+ biff (slay i.t.t.pax) |= cis=coin ?. ?=([%$ case] cis) ~ - `(unit bead)`[~ [who dex `case`p.cis] (flop t.t.t.pax)] + `(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)] :: -++ tope :: bead to path - |= bem=bead +++ tope :: beam to path + |= bem=beam ^- path [(scot %p p.bem) q.bem (scot r.bem) (flop s.bem)] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @@ -2022,8 +2022,9 @@ pot=tape :: prompt text == :: == :: +++ bead ,[p=(set beam) q=cage] :: computed result +++ beam ,[[p=ship q=desk r=case] s=path] :: global name ++ beak ,[p=ship q=desk r=case] :: garnish with beak -++ beet ,[p=(set bead) q=cage] :: computed result ++ bird :: packet in travel $: gom=soap :: message identity mup=@ud :: pktno in msg @@ -2226,11 +2227,9 @@ ++ hiss ,[p=purl q=moth] :: outbound request ++ hist ,[p=@ud q=(list ,@t)] :: depth texts ++ hole ,@t :: session identity -++ hope (pair ,? path) :: view/subscribe ++ hook path :: request origin ++ hoot ,[p=? q=? r=(unit ,@ud) s=host] :: secure/mapped/host ++ hort ,[p=(unit ,@ud) q=host] :: http port/host -++ hose ,[p=(list tank) q=(unit vase) r=seam s=heir] :: http environment ++ host $%([& p=(list ,@t)] [| p=@if]) :: http host ++ httq :: raw http request $: p=meth :: method @@ -2420,7 +2419,6 @@ ++ rump ,[p=care q=case r=@tas s=path] :: relative path ++ rung $: rus=(map desk rede) :: neighbor desks == :: -++ sash (pair term (unit hope)) :: web subscribe ++ saba ,[p=ship q=@tas r=moar s=(list nori)] :: patch/merge ++ sufi :: domestic host $: hoy=(list ship) :: hierarchy @@ -2437,21 +2435,6 @@ foy=(unit ,[p=ship q=hole]) :: partner to notify pus=(unit ,@ta) :: password == :: -++ seam :: logical request - $% [%ape p=term q=@ud] :: await update - [%apg p=term q=logo r=path] :: app get - [%apl p=term q=@ud r=term] :: app poll - [%apm p=term q=json] :: app message - [%aps p=term q=term r=(unit path)] :: app subscribe - [%apu p=term q=logo r=octs] :: app upload - [%cog p=@ud q=@ud] :: console get - [%con p=@ud] :: console face - [%cop p=@ud q=@ud r=json] :: console put - [%det p=desk q=moat] :: load changes - [%fun p=term q=tube r=(list manx)] :: functional - [%lon p=seal] :: authentication flow - [%red p=purl] :: redirect - == :: ++ sect ?(%black %blue %red %orange %white) :: banner ++ shed :: packet flow $: $: rtt=@dr :: smoothed rtt @@ -2472,11 +2455,11 @@ == :: ++ silk :: construction layer $& [p=silk q=silk] :: cons - $% [%bake p=logo q=bead] :: local synthesis - [%boil p=logo q=bead] :: general synthesis + $% [%bake p=logo q=beam] :: local synthesis + [%boil p=logo q=beam] :: general synthesis [%call p=silk q=silk] :: slam [%cast p=logo q=beak r=silk] :: translate - [%done p=(set bead) q=cage] :: literal + [%done p=(set beam) q=cage] :: literal [%mute p=silk q=(list (pair wing silk))] :: mutant [%pass p=silk q=sill] :: twig construction [%reef ~] :: kernel reef @@ -2484,7 +2467,7 @@ ++ sill :: code construction $% [%0 p=@] :: direct text [%1 p=twig] :: direct twig - [%2 p=bead] :: bead over %hoon + [%2 p=beam] :: beam over %hoon [%3 p=silk] :: build a %hoot == :: ++ skit ,[p=(unit ,@ta) q=(list ,@ta) r=(list ,@ta)] :: tracking path From ff2c010efe4eaf211d8de286aab1b84d1bb407b1 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 7 Jun 2014 19:45:00 -0700 Subject: [PATCH 3/4] Applications properly self-reload. --- arvo/ames.hoon | 2 +- arvo/clay.hoon | 2 +- arvo/eyre.hoon | 127 +++++++++++++++++++++++++++++++++++++++++-------- arvo/ford.hoon | 3 +- arvo/gall.hoon | 67 +++++++++++++++----------- arvo/zuse.hoon | 1 - 6 files changed, 149 insertions(+), 53 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 108808845..d5fcc5231 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -1,4 +1,4 @@ -!: +:: :: ames (4a), networking :: |= pit=vase diff --git a/arvo/clay.hoon b/arvo/clay.hoon index df95647f3..69f551f97 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -1,4 +1,4 @@ -!: +:: :: clay (4c), revision control :: |= pit=vase diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 5be74d8ee..1bffc94dd 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -1,13 +1,15 @@ -:: :: %eyre, http servant +!: :: %eyre, http servant !? 164 :::: |= pit=vase => =~ |% :: interfaces +++ chop ,[p=@ud q=@da] :: see ++ gift :: out result <-$ $% [%thou p=httr] :: raw http response [%thus p=@ud q=(unit hiss)] :: http request/cancel == :: +++ hasp ,[p=ship q=term] :: see %gall ++ hope (pair ,? path) :: see %gall ++ kiss :: in request ->$ $% [%born ~] :: new unix process @@ -26,19 +28,19 @@ [%flog p=[%crud p=@tas q=(list tank)]] :: to %dill [%line p=@t] :: to %batz [%ling ~] :: to %batz - [%shah p=hasp q=(unit hope)] :: to %gall + [%show p=hasp q=(unit hope)] :: to %gall [%this p=? q=clip r=httq] :: to %eyre [%thud ~] :: to %eyre + [%wait p=hasp q=@ud] :: to %gall [%want p=sock q=path r=*] :: to %ames [%warp p=sock q=riff] :: to %clay == :: ++ sign :: in result $-< - $% [%boot ~] :: by %gall + $% [%boot p=@ud] :: by %gall [%crud p=@tas q=(list tank)] :: by any [%helo p=path q=prod] :: by %batz [%made p=(each bead (list tank))] :: by %ford - :: [%rush p=@da q=json] :: by %gall - [%rust p=@da q=cage] :: by %gall + [%rust p=chop q=cage] :: by %gall [%talk p=tank] :: by %batz [%tell p=(list ,@t)] :: by %batz [%text p=tape] :: by %batz @@ -95,6 +97,7 @@ hen=duct :: event trace som=seam :: logical request pez=pest :: request state + sip=(list manx) :: scripts in result == :: ++ rote :: remote server $: cnt=@ud :: number served @@ -229,8 +232,9 @@ ^+ +> ?- -.sin %boot - ~& %eyre-boot - +>.$ + ?> ?=([%hova @ @ @ ~] tea) + %- goja + [(need (slaw %p i.t.tea)) i.t.t.tea (need (slaw %ud i.t.t.t.tea)) +.sin] :: %crud +>.$(mow [[hen %slip %d %flog sin] mow]) @@ -381,13 +385,21 @@ ?~ cuz +>.$ abet:work:(~(dodo ya [our ses] u.suf u.cuz) num sin) :: - ++ gojo :: app result - |= [our=ship ses=hole num=@ud wen=@da cay=cage] + ++ goja :: app result + |= [our=ship ses=hole num=@ud tik=@ud] =+ suf=(~(get by own) our) ?~ suf +>.$ =+ cuz=(~(get by wup.u.suf) ses) ?~ cuz +>.$ - abet:work:(~(dojo ya [our ses] u.suf u.cuz) num wen cay) + abet:work:(~(doja ya [our ses] u.suf u.cuz) num tik) + :: + ++ gojo :: app result + |= [our=ship ses=hole num=@ud cup=chop cay=cage] + =+ suf=(~(get by own) our) + ?~ suf +>.$ + =+ cuz=(~(get by wup.u.suf) ses) + ?~ cuz +>.$ + abet:work:(~(dojo ya [our ses] u.suf u.cuz) num cup cay) :: ++ gosh :: receive %pr response |= [him=ship num=@ud har=httr] @@ -502,6 +514,16 @@ [%want [sor.rot him] [%q %pr %e %hork mun ~] ~] == :: + ++ hova :: app wait + |= [our=ship num=@ud ses=hole app=term tik=@ud] + %_ +> + mow + :_ mow + :^ hen %toss %g + :- [%hova (scot %p our) ses (scot %ud num) ~] + [%wait [our app] tik] + == + :: ++ hove :: app peek |= [our=ship num=@ud ses=hole app=term pax=path] %_ +> @@ -509,7 +531,7 @@ :_ mow :^ hen %toss %g :- [%hove (scot %p our) ses (scot %ud num) ~] - [%shah [our app] `[%| pax]] + [%show [our app] `[%| pax]] == :: ++ hork :: remote request @@ -900,18 +922,41 @@ ?~(yov +>.$ (dove ~[%a (jone ono.cal) (jone ino.cal) jon] yov)) :: ++ dojo :: app view - |= [num=@ud wen=@da cay=cage] + |= [num=@ud cup=chop cay=cage] ^+ +> =+ pup=(~(get by q.rey) num) ?~ pup ~&([%dojo-lost ses num] +>.$) - ~& [%dojo num wen] ?> ?=(%way pez.u.pup) ?> ?=(%apg -.som.u.pup) + =. q.rey + %+ ~(put by q.rey) + num + %= u.pup + sip + :_ sip.u.pup + %- dute + ^- path + :~ (rsh 3 1 (scot %p our)) + %gez + p.som.u.pup + (scot %ud +(p.cup)) + == + == =+ bek=`beak`[our %main [%da now]] =+ kas=`silk`[%cast %mime bek [%cast q.som.u.pup bek [%done ~ cay]]] +>.$(..ya (honk our num ses kas)) :: - ++ iota :: change response + ++ doja :: app reboot + |= [num=@ud tik=@ud] + ^+ +> + =+ pup=(~(get by q.rey) num) + ?~ pup + ~& [%doja-lost ses num tik] + +>.$ + ?> ?=(%way pez.u.pup) + +>.$(q.rey (~(put by q.rey) num u.pup(pez [%fin %mid /text/plain *octs]))) + :: + ++ iota :: fun change response |= [num=@ud rot=riot] ^+ +> =+ pup=(~(get by q.rey) num) @@ -932,6 +977,41 @@ ?> ?=(%way pez.u.pup) $(yov t.yov, q.rey (~(put by q.rey) i.yov u.pup(pez noz))) :: + ++ dute :: reload script + |= pax=path + =- =+ cal=:/("path=\"{}\"") + [-.sac [cal +.sac]] + ^= sac + ;script + ; + ; tries = 0; + ; call = function() { + ; xhr = new XMLHttpRequest(); + ; xhr.open('GET', path, true); + ; xhr.addEventListener('load', function() { + ; if(this.status !== 200) { + ; return keep(); + ; } + ; document.location.reload(); + ; }); + ; xhr.addEventListener('error', keep); + ; xhr.addEventListener('abort', keep); + ; xhr.send(); + ; } + ; keep = function() { + ; setTimeout(call,1000*tries); + ; tries++; + ; } + ; call(); + == + :: + ++ fape + |= [fur=(unit term) paw=path] + ^- (unit seam) + ?> ?=(~ fur) + ?> ?=([@ @ ~] paw) + `[%ape i.paw (need (slaw %ud i.t.paw))] + :: ++ fapp :: dispatch app |= [fur=(unit term) paw=path] ^- (unit seam) @@ -1147,10 +1227,11 @@ ?= $? %p :: application %c :: console %f :: functional - %v :: version + %v :: functional version %l :: local login %m :: remote login %n :: now + %z :: app version == tri :: @@ -1170,6 +1251,7 @@ %c (flub paw ~) %l (fool r.pul) %p (fapp p.q.pul paw) + %z (fape p.q.pul paw) == :: %p @@ -1199,7 +1281,6 @@ ++ inch :: function built |= [num=@ud mez=(each bead (list tank))] ^+ +> - ~& [%inch num -.mez] =+ pup=(~(get by q.rey) num) ?~ pup ~& [%inch-lost ses num mez] @@ -1221,6 +1302,7 @@ hen *seam `pest`[%raw pul moh] + ~ == == :: @@ -1259,9 +1341,11 @@ %way [[~ pip] +>.$] %new ?- -.som.pip - %ape !! + %ape + :- [~ pip(pez %way)] + +>.$(..ya (hova our num ses p.som.pip q.som.pip)) + :: %apg :: simple get - ~& [%wink-apg p.som.pip r.som.pip] :- [~ pip(pez %way)] +>.$(..ya (hove our num ses p.som.pip r.som.pip)) :: @@ -1608,9 +1692,10 @@ [~ pip(pez [%fin %wan 'Hello, world' ~])] :: [%fud *] - =+ ^= mog - ?: ?=(%fun -.som.pip) r.som.pip - ~ + =+ ^= mog ^- (list manx) + ?: ?=(%fun -.som.pip) + (weld r.som.pip sip.pip) + sip.pip :_ +>.$ :- ~ %= pip diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 92725fbf7..1d8e010b2 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -303,7 +303,6 @@ :: ++ expo :: return gift |= gef=gift - ~& [%expo -.gef] %_(+> mow :_(mow [hen %give gef])) :: ++ fade :: compile @@ -537,7 +536,7 @@ ++ make :: reduce silk |= [cof=cafe kas=silk] ^- (bolt cage) - ~& [%ford-make -.kas] + :: ~& [%ford-make -.kas] ?- -.kas ^ %. [cof p.kas q.kas] diff --git a/arvo/gall.hoon b/arvo/gall.hoon index d0e908232..5bd919ca0 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -12,7 +12,7 @@ ++ chop ,[p=@ud q=@da] :: revision/date ++ gift :: out result <-$ $% [%back p=?] :: %mess ack good/bad - [%boot p=@ud q=@da] :: response to %wait + [%boot p=@ud] :: response to %wait [%crud p=@tas q=(list tank)] :: error [%done ~] :: reset duct [%rasp p=cage] :: reaction message @@ -20,6 +20,7 @@ [%rust p=chop q=cage] :: full update [%meta p=vase] :: meta-gift == :: +++ hasp ,[p=ship q=term] :: app identity ++ hope (pair ,? path) :: view/subscribe ++ kiss :: in request ->$ $% [%show p=hasp q=(unit hope)] :: urb subscribe/cancel @@ -27,7 +28,7 @@ [%mess p=hasp q=cage] :: message [%nuke p=hasp] :: reset this duct [%show p=hasp q=(unit hope)] :: web subscribe/cancel - [%wait p=@ud] :: await revision + [%wait p=hasp q=@ud] :: await tick == :: ++ knob :: pending action $% [%boot ~] :: boot/reboot @@ -36,6 +37,7 @@ [%nuke ~] :: destroy duct [%show p=(unit hope)] :: subscribe/cancel [%take p=path q=vase] :: user result + [%wait p=@ud] :: await tick == :: ++ mast :: apps by ship $: bum=(map ,@ta seat) :: apps by name @@ -58,7 +60,7 @@ vey=(qeu toil) :: pending projects tik=@ud :: build number orm=(unit ,@da) :: build date - med=(map duct ,@ud) :: waiters + med=(map ,@ud (list duct)) :: waiters ped=(set (pair ship desk)) :: dependencies zam=scar :: opaque ducts == :: @@ -152,7 +154,7 @@ %mess [law p.q.hic %mess q.q.hic] %show [law p.q.hic %show q.q.hic] %nuke [law p.q.hic %nuke ~] - %wait !! + %wait [law p.q.hic %wait q.q.hic] == abet:work:(quem:(boar:(goat hap) hen law) kon) :: @@ -353,16 +355,29 @@ ^- silk [%done ~ cay] :: + ++ deal :: advance tick + ^+ . + =. tik.sat +(tik.sat) + =+ dyq=(dear tik.sat) + |- ^+ +>.$ + ?~ dyq +>.$(med.sat (~(del by med.sat) tik.sat)) + =. +>.$ $(dyq t.dyq) + (give(hen i.dyq) %boot tik.sat) + :: + ++ dear :: waiters + |= tik=@ud + ^- (list duct) + =+ dyq=(~(get by med.sat) tik.sat) + ?~(dyq ~ u.dyq) + :: ++ drug :: set dependencies |= pen=(set (pair ship desk)) - ~& [%drug-want ped.sat] ^+ +> =+ ^= new ^- (list move) %+ turn %+ skip (~(tap in pen) ~) |=(a=(pair ship desk) (~(has in ped.sat) a)) |= a=(pair ship desk) - ~& [%drug-gain a] :- hen :^ %toss %c (away %s %drug ~) [%warp [our p.a] q.a ~ %| [%da now] [%da (add now ~d1000)]] @@ -371,7 +386,6 @@ %+ skip (~(tap in ped.sat) ~) |=(a=(pair ship desk) (~(has in pen) a)) |= a=(pair ship desk) - ~& [%drug-stop a] :- hen :^ %toss %c (away %s %drug ~) [%warp [our p.a] q.a ~] @@ -440,14 +454,13 @@ ?> ?=([~ * %boot ~] qic.sat) ?> ?=(%made -.q.hin) ?- -.p.q.hin - & ~& %boot-good - (drum:(morn:gone q.q.p.p.q.hin) p.p.p.q.hin) - | ~& %boot-lost + & :: ~& %boot-good + deal:(drum:(morn:gone q.q.p.p.q.hin) p.p.p.q.hin) + | :: ~& %boot-lost (mort p.p.q.hin) == :: %drug - ~& %more-drug ?> ?=(%writ -.q.hin) ?~ p.q.hin +>.$ +>.$(vey.sat (~(put to vey.sat) hen %boot ~)) @@ -455,11 +468,11 @@ %step ?> ?=(%made -.q.hin) ?- -.p.q.hin - & ~& %step-good - %- obey:(morn:gone (slot 3 q.q.p.p.q.hin)) + & :: ~& %step-good + %- obey:(morn:gone (slot 3 q.q.p.p.q.hin)) (slot 2 q.q.p.p.q.hin) - | ~& %step-fail - (give %crud %made p.p.q.hin) + | :: ~& %step-fail + (give %crud %made p.p.q.hin) == == :: @@ -480,7 +493,12 @@ :: ++ quem :: queue action |= kon=knob :: content - %_(+> vey.sat (~(put to vey.sat) hen kon)) + ^+ +> + ?. ?=(%wait -.kon) + %_(+> vey.sat (~(put to vey.sat) hen kon)) + ?: (lte p.kon tik.sat) + (give %boot p.kon) + %_(+>.$ med.sat (~(put by med.sat) p.kon [hen (dear p.kon)])) :: ++ said |= vud=vase @@ -504,9 +522,9 @@ :: [%rust *] :^ %rust - ((hard chop) +<.q.vig) - ((hard lode) +>-.q.vig) - (slot 15 vig) + [tik.sat now] + ((hard lode) +<.q.vig) + (slot 7 vig) == :: ++ sump @@ -532,7 +550,6 @@ :: ++ work :: eat queue ^+ . - ~& %gall-work ?: |(?=(^ qic.sat) =(~ vey.sat)) . :: nothing to do =^ yev vey.sat [p q]:~(get to vey.sat) work:(yawn:(bing p.yev) q.yev) @@ -540,11 +557,10 @@ ++ yawn :: start event |= kon=knob ^+ +> - ~& [%gall-yawn -.kon] + :: ~& [%gall-yawn -.kon] =. qic.sat `[hen kon] ?- -.kon %boot - ~& %yawn-boot =. orm.sat `now %+ ford %boot ^- silk @@ -554,7 +570,6 @@ [nile (harm %save (conf u.huv.sat))] :: %crud - ~& %yawn-crud ?~ huv.sat ~& [%crud-none our app] gone:(give %crud p.kon q.kon) @@ -562,7 +577,6 @@ !>([ost use p.kon]) :: %mess - ~& %yawn-mess ?~ huv.sat ~& [%mess-none our app] gone:(give %back |) @@ -570,14 +584,12 @@ :(slop [[%atom %ud] ost] !>((ride use say)) q.p.kon) :: %nuke - ~& %yawn-mess ?~ huv.sat ~& [%nuke-none our app] gone (game [%step %punk] u.huv.sat !>([ost ~])) :: %show - ~& %yawn-show ?~ huv.sat ~& [%show-none our app] gone:(give %done ~) @@ -585,10 +597,11 @@ !>([ost use | p.kon]) :: %take - ~& %yawn-take ?> ?=(^ huv.sat) %^ game [%step %peck] u.huv.sat :(slop [[%atom %ud] ost] !>((ride use say)) !>(p.kon) q.kon) + :: + %wait !! :: handled above == -- -- diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 44f41aabf..4a5b0b408 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2221,7 +2221,6 @@ ++ gram ,@uw :: physical datagram ++ hand ,@uvH :: hash of code ++ hart ,[p=? q=(unit ,@ud) r=host] :: http sec/port/host -++ hasp ,[p=ship q=term] :: app identity ++ hate ,[p=purl q=@p r=moth] :: semi-cooked request ++ heir ,[p=@ud q=mess r=(unit love)] :: status/headers/data ++ hiss ,[p=purl q=moth] :: outbound request From e84c4e258dcc3fe192cab300e1a209a4b29727a0 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 7 Jun 2014 20:05:32 -0700 Subject: [PATCH 4/4] Demo app. --- main/app/foobug/core.hoon | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 main/app/foobug/core.hoon diff --git a/main/app/foobug/core.hoon b/main/app/foobug/core.hoon new file mode 100644 index 000000000..0dc732ab6 --- /dev/null +++ b/main/app/foobug/core.hoon @@ -0,0 +1,35 @@ +!: +=> |% + ++ foobug-state + $% [%0 bug=@ud] + == + -- +|= * +|_ [hide foo=foobug-state] +++ prep + |= old=foobug-state + +>(foo old) +++ save + ^- foobug-state + foo +:: +++ peer + |= [ost=bone aud=kirk web=? hup=(unit (pair ,? path))] + ~& [%peer lat.seq] + :_ +> :_ ~ + :+ ost %give + :- %rust + :- %html + %- crip + %+ xmlt | + :_ ~ + ^- manx + ;html + ;head + ;title: Hi, Pi! + == + ;body + ;p: Yo, world. + == + == +--