From 2554b2f113c97d69d839a5b646e5079dd34cb691 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 26 Jun 2014 20:31:31 -0700 Subject: [PATCH 1/9] Duh. --- main/sys/json/ref/gate.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/main/sys/json/ref/gate.hoon b/main/sys/json/ref/gate.hoon index 3c840093b7..a1e0f90ba5 100644 --- a/main/sys/json/ref/gate.hoon +++ b/main/sys/json/ref/gate.hoon @@ -1 +1,2 @@ +|= * json From 28e63d7a36faac6b65ce5458fce16e84eaf7fe31 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 26 Jun 2014 21:02:05 -0700 Subject: [PATCH 2/9] Trailing whitespace and stuff. --- arvo/ames.hoon | 40 ++++++++++++++++++++-------------------- arvo/ford.hoon | 9 ++++++++- arvo/hoon.hoon | 1 + arvo/zuse.hoon | 6 +++--- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 20c21ff064..2deac0646d 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -470,7 +470,7 @@ :: |% ++ go :: go - |_ ton=toun :: ames state + |_ ton=town :: ames state ++ as :: as:go |_ [our=ship saf=sufi] :: per server ++ born :: born:as:go @@ -741,7 +741,7 @@ :: ++ ha !: :: adopt new license |= [our=ship mac=mace wil=will] - ^- toun + ^- town ?> !=(~ mac) ?> ?=(^ wil) :: ?> =(our r.p.q.i.wil) @@ -765,12 +765,12 @@ :: ++ su :: install safe |= new=_as - ^- toun + ^- town ton(urb (~(put by urb.ton) our.new saf.new)) :: ++ ti :: expire by time |= [now=@da] - ^- toun + ^- town !! :: ++ us :: produce safe @@ -993,9 +993,9 @@ :: |% ++ am :: am - |_ [now=@da fox=furt] :: protocol engine + |_ [now=@da fox=fort] :: protocol engine ++ boot :: boot:am - ^- furt :: restore from noun + ^- fort :: restore from noun %= fox urb.ton %- ~(gas by *(map ship sufi)) @@ -1010,7 +1010,7 @@ == ++ come :: come:am |= [ges=(unit ,@t) wid=@ bur=@ fak=?] :: instantiate pawn - ^- [p=[p=ship q=@uvG] q=furt] + ^- [p=[p=ship q=@uvG] q=fort] =+ loy=(bruw wid bur) =+ rig=sec:ex:loy =+ our=`@p`fig:ex:loy @@ -1028,7 +1028,7 @@ :: ++ czar !: :: czar:am |= [our=ship ger=@uw fak=?] :: instantiate emperor - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] =+ loy=?:(fak (bruw 2.048 our) (bruw 2.048 ger)) :: fake uses carrier # =+ fim==(fig:ex:loy (zeno our)) ?: &(!fak !fim) !! :: not fake & bad fig @@ -1044,7 +1044,7 @@ :: ++ gnaw :: gnaw:am |= [kay=cape ryn=lane pac=rock] :: process packet - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] ?. =(1 (end 0 3 pac)) [~ fox] =+ kec=(bite pac) ?: (goop p.p.kec) [~ fox] @@ -1075,7 +1075,7 @@ :: ++ have :: have:am |= [our=ship buq=buck] :: acquire license - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] =: ton.fox (~(ha go ton.fox) our buq) zac.fox (~(put by zac.fox) our *corn) == @@ -1084,7 +1084,7 @@ ++ kick :: kick:am |= hen=duct :: refresh net =+ aks=(turn (~(tap by urb.ton.fox) ~) |=([p=ship q=sufi] p)) - |- ^- [p=(list boon) q=furt] + |- ^- [p=(list boon) q=fort] ?~ aks [~ fox] =^ buz fox zork:(kick:(um i.aks) hen) =^ biz fox $(aks t.aks) @@ -1092,10 +1092,10 @@ :: ++ wake :: wake:am |= hen=duct :: harvest packets - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] =+ sox=hall =| bin=(list boon) - |- ^- [p=(list boon) q=furt] + |- ^- [p=(list boon) q=fort] ?~ sox =^ ban fox (kick hen) [(weld bin p.ban) fox] @@ -1104,12 +1104,12 @@ :: ++ wash :: wash:am |= [soq=sock sup=soap ham=meal] :: dispatch and send - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] zork:zank:(wind:(ho:(um p.soq) q.soq) [q.sup r.sup] ham) :: ++ wise :: wise:am |= [soq=sock hen=duct cha=path val=*] :: send a statement - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] zork:zank:(wool:(ho:(um p.soq) q.soq) hen cha val) :: ++ um :: per server @@ -1476,7 +1476,7 @@ zank:(pong:(ho her) hen) :: ++ zork :: zork:um:am - ^- [p=(list boon) q=furt] :: resolve + ^- [p=(list boon) q=fort] :: resolve :- (flop bin) %_ fox ton (~(su go ton.fox) gus) @@ -1489,7 +1489,7 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 4aH, protocol vane :: :: - =| $: fox=furt :: kernel state + =| $: fox=fort :: kernel state == :: |= [now=@da eny=@ ski=sled] :: current invocation ^? :: opaque core @@ -1529,7 +1529,7 @@ (hunt doz rtn.sop.bah) :: ++ load - |= old=furt + |= old=fort ^+ ..^$ ..^$(fox old) :: @@ -1568,7 +1568,7 @@ ++ claw |=(our=ship ^-(duct hen:(need (~(get by zac.fox) our)))) ++ clop |= [now=@da hen=duct bon=boon] - ^- [(list move) furt] + ^- [(list move) fort] ?- -.bon %beer :_ fox(zac (~(put by zac.fox) p.bon `corn`[hen ~ ~ ~])) @@ -1697,7 +1697,7 @@ ?: ?=([%crud *] kyz) [[[hen [%slip %d %flog kyz]] ~] +>] =+ ^= fuy - ^- [p=(list boon) q=furt] + ^- [p=(list boon) q=fort] ?- -.kyz %cash (~(have am [now fox]) p.kyz q.kyz) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 4b05d99433..afdc88e6d9 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -1,4 +1,4 @@ -:: :: %ford, new execution control +!: :: %ford, new execution control !? 164 :::: |= pit=vase @@ -403,14 +403,20 @@ ^- (bolt (unit vase)) ?: ?=(?(%gate %core %hoon %hook) for) (fine cof ~ sam) + ~& [%lake for bek] %+ cope (make cof %boil %gate bek /ref/[for]/sys) |= [cof=cafe cay=cage] + ~& %lake-a %+ cope (lane cof p.q.cay [%cnzy %$]) |= [cof=cafe ref=type] + ~& %lake-b ?: (~(nest ut ref) | p.sam) + ~& %lake-c (fine cof ~ sam) + ~& %lake-d %+ cope (maul cof q.cay sam) |= [cof=cafe pro=vase] + ~& %lake-e (fine cof ~ pro) :: ++ lave :: validate @@ -419,6 +425,7 @@ =+ ^= own ^- ship =+ von=(ska %cy (tope [[p.sax %main lok] /core/ref/[for]/sys])) ?~(von q.sax p.sax) + ~& [%lave for sax som] ((lake for [own %main lok]) cof [%noun som]) :: ++ lair :: metaload diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 4148d6818e..65b821e18e 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -154,6 +154,7 @@ ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule ++ span ,@ta :: text-atom (ASCII) ++ spot ,[p=path q=pint] :: range in file +++ tang (list tank) :: general error ++ tank $% [%leaf p=tape] :: printing formats [%palm p=[p=tape q=tape r=tape s=tape] q=(list tank)] [%rose p=[p=tape q=tape r=tape] q=(list tank)] diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 4d8310f9b3..b793e4a33d 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2120,10 +2120,10 @@ $: rtt=@dr :: decaying avg rtt wid=@ud :: logical wdow msgs == :: -++ furt :: formal state +++ fort :: formal state $: %0 :: version hop=@da :: network boot date - ton=toun :: security + ton=town :: security zac=(map ship corn) :: flows by server == :: ++ frog ,[p=@da q=nori] :: time and change @@ -2445,7 +2445,7 @@ ++ taxi ,[p=lane q=rock] :: routed packet ++ tick ,@ud :: process id ++ toro ,[p=@ta q=nori] :: general change -++ toun :: all security state +++ town :: all security state $: lit=@ud :: imperial modulus any=@ :: entropy urb=(map ship sufi) :: all keys and routes From f7f3e434240946091c7977f75da78815cf55eece Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sun, 29 Jun 2014 16:58:17 -0700 Subject: [PATCH 3/9] %gall over %ames, first cut. --- arvo/ames.hoon | 19 ++-- arvo/gall.hoon | 284 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 257 insertions(+), 46 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 2deac0646d..d9e67287ac 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -39,8 +39,9 @@ $% [%kick p=@da] :: == == :: $: %g :: to %gall - [%muss p=hasp q=ship r=logo s=*] :: - == + $% [%rote p=sack q=term r=*] :: + [%roth p=sack q=term r=*] :: + == == :: $: @tas :: to any $% [%init p=@p] :: [%want p=sock q=path r=*] :: @@ -1616,13 +1617,15 @@ [%sick %wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon] == :: - %gm :: general message - ?> ?=([@ @ *] t.t.q.q.bon) + %ge :: gall request + ?> ?=([@ ~] t.t.q.q.bon) =+ app=`term`(need ((sand %tas) i.t.t.q.q.bon)) - =+ for=`logo`(need ((sand %tas) i.t.t.t.q.q.bon)) - :_ fox - :~ [hen [%pass ~ %g %muss [p.p.bon app] q.p.bon for r.bon]] - == + :_(fox [hen %pass ~ %g %roth p.bon app r.bon]~) + :: + %gh :: gall response + ?> ?=([@ ~] t.t.q.q.bon) + =+ app=`term`(need ((sand %tas) i.t.t.q.q.bon)) + :_(fox [hen %pass ~ %g %rote p.bon app r.bon]~) :: %pi :: ping $(bon [%wine p.bon " sent a ping at {(scow %da now)}"]) diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 201de8d177..28ecc0e19d 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -1,4 +1,4 @@ -!: :: %gall, user-level applications +:: :: %gall, user-level applications !? 164 :::: |= pit=vase @@ -23,30 +23,39 @@ [%show p=hasp q=ship r=path] :: subscribe :: [%cuff p=(unit cuff) q=kiss] :: controlled kiss [%mess p=hasp q=ship r=cage] :: typed message - [%muss p=hasp q=ship r=logo s=*] :: untyped message - [%nuke p=hasp] :: clear duct + [%nuke p=hasp q=ship] :: clear duct + [%rote p=sack q=term r=*] :: remote request + [%roth p=sack q=term r=*] :: remote response == :: ++ knob :: pending action $% [%boot ~] :: begin boot [%crud p=@tas q=(list tank)] :: error [%load p=cage] :: continue boot [%mess p=ship q=cage] :: typed message - [%muss p=ship q=logo r=*] :: untyped message [%show p=ship q=path] :: subscribe - [%nuke ~] :: clear duct + [%nuke p=ship] :: clear duct [%take p=path q=vase] :: user result == :: ++ mast :: apps by ship $: hun=duct :: control duct + sap=(map ship scad) :: foreign contacts bum=(map ,@ta seat) :: apps by name == :: ++ move ,[p=duct q=(mold note gift)] :: typed move ++ note :: out request $-> - $? $: %c :: to %clay + $? $: %a :: to %ames + $% [%want p=sock q=path r=*] :: + == == :: + $: %c :: to %clay $% [%warp p=sock q=riff] :: == == :: $: %f :: to %ford $% [%exec p=@p q=(unit silk)] :: + == == :: + $: %g :: to %gall + $% [%show p=hasp q=ship r=path] :: + [%mess p=hasp q=ship r=cage] :: + [%nuke p=hasp q=ship] :: == == :: $: @tas :: to any $% [%meta p=vase] :: @@ -57,11 +66,28 @@ [| p=moat] :: change range == :: ++ riff ,[p=desk q=(unit rave)] :: see %clay +++ scad :: opaque for foreign + $: p=@ud :: index + q=(map duct ,@ud) :: by duct + r=(map ,@ud duct) :: by index + == :: ++ scar :: opaque duct system $: p=@ud :: bone sequence q=(map duct ,[p=bone q=(unit cuff)]) :: by duct r=(map bone duct) :: by bone == :: +++ roon :: foreign response + $% [%d p=logo q=*] :: diff + [%e p=(list tank)] :: error + [%f p=logo q=*] :: full refresh + [%n ~] :: cancel subscription + [%r p=(unit (pair logo noun))] :: message response + == :: +++ rook :: foreign request + $% [%m p=term q=logo r=*] :: message + [%s p=term q=path] :: subscribe + [%u p=term] :: cancel/unsubscribe + == :: ++ seat :: the living app $: huv=(unit vase) :: application vase qic=(unit toil) :: current project @@ -78,9 +104,16 @@ zam=scar :: opaque ducts == :: ++ sign :: in result $-< - $? [?(%a %b %c %d %e %g) @tas *] - [%f %made p=(each bead (list tank))] - == + $? [?(%a %b %c %d %e) @tas *] :: + $: %g :: by %gall + $% [%dumb ~] :: + [%rasp p=(unit (pair logo noun))] :: + [%rush p=logo q=*] :: + [%rust p=logo q=*] :: + == == :: + $: %f :: by %ford + $% [%made p=(each bead (list tank))] :: + == == == :: ++ toil (pair duct knob) :: work in progress -- :::::::::::::::::::::::::::::::::::::::::::::::::::::: |% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions @@ -148,7 +181,11 @@ |= [hen=duct hic=(hypo (hobo kiss))] => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) ?: ?=(%init -.q.hic) - [p=~ q=..^$(pol.all (~(put by pol.all) p.q.hic hen ~))] + [p=~ q=..^$(pol.all (~(put by pol.all) p.q.hic hen ~ ~))] + ?: ?=(%rote -.q.hic) :: remote layer + (gawk hen p.q.hic q.q.hic ((hard ,[@ud rook]) r.q.hic)) + ?: ?=(%roth -.q.hic) + (gawd hen p.q.hic q.q.hic ((hard ,[@ud roon]) r.q.hic)) |- ^- [p=(list move) q=_..^^$] =+ =| law=(unit cuff) |- ^- $: law=(unit cuff) @@ -158,18 +195,22 @@ ?- -.q.hic :: %cuff $(q.hic q.q.hic, law (limp p.q.hic law)) %mess [law p.q.hic %mess q.q.hic r.q.hic] - %muss [law p.q.hic %muss q.q.hic r.q.hic s.q.hic] %show [law p.q.hic %show q.q.hic r.q.hic] - %nuke [law p.q.hic %nuke ~] + %nuke [law p.q.hic %nuke q.q.hic] == abet:work:(quem:(boar:(goat hap) hen law) kon) :: ++ take :: accept response |= [pax=path hen=duct hin=(hypo sign)] :: ^- [p=(list move) q=_..^$] - =+ lum=(lump pax) + ?: ?=([%r *] pax) + (gave hen t.pax q.hin) + ?: ?=([%x *] pax) + (gasp hen t.pax q.hin) + ?> ?=([%a *] pax) + =+ lum=(lump t.pax) =< abet =< work - (more:(bear:(gaur p.lum) hen) q.lum hin) + (more:(bear:(gaff p.lum) hen) q.lum hin) :: ++ scry |= $: use=(unit (set monk)) @@ -187,7 +228,7 @@ |= $: use=(unit (set monk)) :: observers bid=beam :: position == :: - (beef:(gaur p.bid q.bid) use r.bid s.bid) + (beef:(gaff p.bid q.bid) use r.bid s.bid) %+ bind ?+ ren ~ %u u.vew @@ -212,12 +253,190 @@ ++ stay `axle`+>-.$ -- |% :: inner core -++ gaur :: take and go +:: +++ best :: cage to gift + |= [sem=?(%rush %rust) cay=cage] + ^- gift + :- %meta + ^- vase + :- :+ %cell [%cube %rust %atom %tas] + [%cell [%atom %tas] p.q.cay] + [sem p.cay q.q.cay] +:: +++ besp :: best for rasp grr + |= cuy=(unit cage) + ^- gift + ?~ cuy [%rasp ~] + :- %meta + ^- vase + :- :+ %cell [%cube %rasp %atom %tas] + :+ %cell [%cube 0 [%atom %n]] + [%cell [%atom %tas] p.q.u.cuy] + [%rasp ~ p.u.cuy q.q.u.cuy] +:: +++ gaff :: take and go |= [our=@p app=@tas] =+ mat=(need (~(get by pol.all) our)) =+ sat=(need (~(get by bum.mat) app)) ~(. go [our app] mat sat) :: +++ gape :: %r send query + |= [hen=duct law=(unit cuff)] + |= [our=@p app=@tas kon=knob] + ^- [(list move) _..^^$] + ?> ?=(?(%mess %show %nuke) -.kon) + =+ you=`ship`?-(-.kon %mess p.kon, %nuke p.kon, %show p.kon) + =+ mat=(need (~(get by pol.all) you)) + =+ sad==+(sad=(~(get by sap.mat) our) ?^(sad u.sad *scad)) + =^ num sad + =+ nym=(~(get by q.sad) hen) + ?^ nym [u.nym sad] + :- p.sad + :+ +(p.sad) + (~(put by q.sad) hen p.sad) + (~(put by r.sad) p.sad hen) + :- =+ ^= roc ^- rook + ?- -.kon + %mess [%m app p.q.kon q.q.q.kon] + %nuke [%u app] + %show [%s app q.kon] + == + ^- (list move) + :~ :- hen + :+ %pass + ~[%x -.roc (scot %p you) app (scot %p our) (scot %ud num)] + `note`[%a [%want [you our] [%q %gq app ~] [num roc]]] + == + %= ..^^$ + pol.all + %+ ~(put by pol.all) + you + mat(sap (~(put by sap.mat) our sad)) + == +:: +++ gasp :: %x take + |= [hen=duct pax=path sih=sign] + ^- [(list move) _..^$] + :_ ..^$ + :_ ~ + :- hen + ?> ?=(%f -.sih) + ?- -.p.+.sih + %| + [%give %crud %gasp-crud p.p.+.sih] + :: + %& + =+ cay=`cage`q.p.p.+.sih + ?+ -.pax !! + %d [%give (best %rush cay)] + %f [%give (best %rust cay)] + %r [%give (besp ~ cay)] + == + == +:: +++ gave :: %r take + |= [hen=duct pax=path sih=sign] + ^- [(list move) _..^$] + ?> ?=([@ @ @ @ @ ~] pax) + =+ :* our=`ship`(slav %p i.t.pax) + app=`term`i.t.t.pax + you=`ship`(slav %p i.t.t.t.pax) + num=(scot %ud i.t.t.t.t.pax) + == + :_ ..^$ :_ ~ :- hen + :+ %pass [%r pax] + ^- note + =+ rod=|=(ron=roon `note`[%a %want [you our] /q/gr/[app] num ron]) + ?+ -.pax !! + %m ?+ -.sih !! + %f + ?- -.p.+.sih + %& [%g %mess [our app] you `cage`q.p.p.+.sih] + %| (rod %e p.p.+.sih) + == + :: + %g + ?- -.+.sih + %dumb !! + %rasp (rod %r p.+.sih) + %rush !! + %rust !! + == + == + %s ?+ -.sih !! + %g + ?- -.+.sih + %dumb !! + %rasp !! + %rush (rod %d p.+.sih q.+.sih) + %rust (rod %f p.+.sih q.+.sih) + == + == + %u !! + == +:: +++ gawd :: %r handle response + |= [hen=duct saq=sack app=term num=@ud ron=roon] + ^- [p=(list move) q=_..^$] + =+ mat=(need (~(get by pol.all) p.saq)) + =+ sad=(need (~(get by sap.mat) q.saq)) + =+ neh=(need (~(get by r.sad) num)) + :_ ..^$ :_ ~ + ^- move :- neh + ?- -.ron + %d [%pass /x/d `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]] + %e !! + %f [%pass /x/f `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]] + %n !! + %r ?~ p.ron + [%give %rasp ~] + [%pass /x/r `note`[%f %exec p.saq ~ %vale p.u.p.ron saq q.u.p.ron]] + == +:: +++ gawk :: %r call/request + |= [hen=duct saq=sack app=term num=@ud rok=rook] + ^- [p=(list move) q=_..^$] + ~& [%gawk hen saq num -.rok] + :_ ..^$ :_ ~ + ^- move :- hen + :+ %pass + :~ %r + -.rok + (scot %p p.saq) + ?-(-.rok %m p.rok, %s p.rok, %u p.rok) + (scot %p q.saq) + (scot %ud num) + == + ^- note + ?- -.rok + %m [%f %exec p.saq ~ %vale q.rok saq r.rok] + %s [%g %show [p.saq p.rok] q.saq q.rok] + %u [%g %nuke [p.saq p.rok] q.saq] + == +:: +++ gent :: seat in mast + |= [our=@p app=@tas mat=mast] + =+ ^= sat ^- seat + =+ syt=(~(get by bum.mat) app) + ?^ syt u.syt + %* . *seat + zam + ^- scar + :+ 1 + [[hun.mat 0 ~] ~ ~] + [[0 hun.mat] ~ ~] + == + ~(. go [our app] mat sat) +:: +++ goad :: handle request + |= [hen=duct law=(unit cuff)] + |= [our=@p app=@tas kon=knob] + ^- [(list move) _..^^$] + =+ mut=(~(get by pol.all) our) + ?^ mut + abet:work:(quem:(boar:(gent our app u.mut) hen law) kon) + ((gape hen law) our app kon) +:: ++ goat :: call and go |= [our=@p app=@tas] =+ mat=(need (~(get by pol.all) our)) @@ -248,9 +467,10 @@ mat(bum (~(put by bum.mat) app sat)) == == + :: ++ away :: application path |= pax=path ^- path - [(scot %p our) app pax] + [%a (scot %p our) app pax] :: ++ bear :: write backward |= hen=duct @@ -471,7 +691,14 @@ | [~ (give %crud %made p.p.+.sih)] == :: - ++ more :: accept result + ++ moar :: foreign take + |= $: pax=path + sih=sign + == + ^+ +> + !! + :: + ++ more :: domestic take |= $: pax=path :: internal position hin=(hypo sign) :: typed event == @@ -486,14 +713,6 @@ qic.sat ~ == ?+ i.t.pax !! - %muss - ?> ?=([@ ~] t.t.pax) - =+ you=(need (slaw %p i.t.t.pax)) - ?> ?=(%f -.q.hin) - ?- -.p.+.q.hin - | (give:(give %rasp ~) [%crud %vale p.p.+.q.hin]) - & (quen %mess you q.p.p.+.q.hin) - == :: %park =^ gyd +>.$ (murk q.hin) @@ -515,11 +734,7 @@ peq.sat (~(put by peq.sat) ost ash) sup.sat (~(put by sup.sat) ost kee) == - :- %meta - ^- vase - :- :+ %cell [%cube %rust %atom %tas] - [%cell [%atom %tas] p.q.u.gyd] - [%rust p.u.gyd q.q.u.gyd] + (best %rust u.gyd) :: %peer ?> ?=([@ *] t.t.pax) @@ -624,9 +839,6 @@ |= [you=ship pax=path] :: subscription %_(+> vey.sat (~(put to vey.sat) hen %show you pax)) :: - ++ nuke :: end - %_(. vey.sat (~(put to vey.sat) hen %nuke ~)) - :: ++ sumo :: standard gift |= vig=vase ^- gift @@ -718,10 +930,6 @@ :: ~& [%mess-poke cog] %+ ford /s/poke [%call (harm cog (conf (core u.huv.sat))) (cove %$ sam)] - :: - %muss - %+ ford /s/muss/[(scot %p p.kon)] - [%vale q.kon [our p.kon] r.kon] :: %show ?: (warm %peer) From f5a50256e3bcebafd8bb5fd6cee084fe2790c696 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sun, 29 Jun 2014 17:07:47 -0700 Subject: [PATCH 4/9] Remove some redundancy. --- arvo/gall.hoon | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 28ecc0e19d..48d1dd48cb 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -84,9 +84,9 @@ [%r p=(unit (pair logo noun))] :: message response == :: ++ rook :: foreign request - $% [%m p=term q=logo r=*] :: message - [%s p=term q=path] :: subscribe - [%u p=term] :: cancel/unsubscribe + $% [%m p=logo q=*] :: message + [%s p=path] :: subscribe + [%u ~] :: cancel/unsubscribe == :: ++ seat :: the living app $: huv=(unit vase) :: application vase @@ -297,9 +297,9 @@ (~(put by r.sad) p.sad hen) :- =+ ^= roc ^- rook ?- -.kon - %mess [%m app p.q.kon q.q.q.kon] - %nuke [%u app] - %show [%s app q.kon] + %mess [%m p.q.kon q.q.q.kon] + %nuke [%u ~] + %show [%s q.kon] == ^- (list move) :~ :- hen @@ -403,15 +403,15 @@ :~ %r -.rok (scot %p p.saq) - ?-(-.rok %m p.rok, %s p.rok, %u p.rok) + app (scot %p q.saq) (scot %ud num) == ^- note ?- -.rok - %m [%f %exec p.saq ~ %vale q.rok saq r.rok] - %s [%g %show [p.saq p.rok] q.saq q.rok] - %u [%g %nuke [p.saq p.rok] q.saq] + %m [%f %exec p.saq ~ %vale p.rok saq q.rok] + %s [%g %show [p.saq app] q.saq p.rok] + %u [%g %nuke [p.saq app] q.saq] == :: ++ gent :: seat in mast From ac9feb75429446507130abe60a7cad87afbbbbf3 Mon Sep 17 00:00:00 2001 From: Jared Hance Date: Mon, 30 Jun 2014 11:23:46 -0400 Subject: [PATCH 5/9] Fix add:rd & sub:rd jet failure. --- arvo/hoon.hoon | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index d0835fa9e5..047db74bf0 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1141,6 +1141,21 @@ (new | (add +.c +.d)) ++ sun |=(a=@u (mul 2 a)) :: @u to @s ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test + ++ cmp |= [a=@s b=@s] :: compare + ^- @s + ?: =(a b) + --0 + ?: (syn a) + ?: (syn b) + ?: (gth a b) + --1 + -1 + --1 + ?: (syn b) + -1 + ?: (gth a b) + -1 + --1 -- ++ fe :: modulo bloq |_ a=bloq @@ -1393,12 +1408,12 @@ m ?: (zer:te:fl b p m) n - ?: &(!s.n !s.m) :: both negative + ?: &(!s.n !s.m) :: both negative =+ r=$(s.n %.y, s.m %.y) [s=%.n e=e.r a=a.r] - ?. &(s.n s.m) :: if not both positive - (sub b p n [s=!s.m e=e.m a=a.m]) :: is actually sub - ?. (^gte e.n e.m) :: guarantee e.n > e.m + ?. &(s.n s.m) :: if not both positive + (sub b p n [s=!s.m e=e.m a=a.m]) :: is actually sub + ?: =(-1 (cmp:si e.n e.m)) :: guarantee e.n > e.m $(n m, m n) =+ dif=(abs:si (dif:si e.n e.m)) :: always pos =+ a2=(lsh 0 dif a.n) :: p+1+dif bits @@ -1417,7 +1432,7 @@ (add b p m [s=%.n e.m a.m]) :: add handles negative case ?: &(s.n !s.m) :: a+b (add b p m [s=%.y e.m a.m]) :: is actually add - ?. |((^gth e.n e.m) &(=(e.n e.m) (^gte a.n a.m))) :: n > m + ?. |(=(--1 (cmp:si e.n e.m)) &(=(e.n e.m) (^gte a.n a.m))) :: n > m $(n m(s !s.m), m n(s !s.n)) =+ dif=(abs:si (dif:si e.n e.m)) =+ a2=(lsh 0 dif a.n) :: p+1+dif bits From 40672c8b08cbcc610d76f2850b151a2dd245c681 Mon Sep 17 00:00:00 2001 From: Jared Hance Date: Mon, 30 Jun 2014 11:44:26 -0400 Subject: [PATCH 6/9] Fix decrement underflow in flpt. --- arvo/hoon.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 047db74bf0..e3be579ea0 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1429,9 +1429,9 @@ ?: |((zer:te:fl b p n) (zer:te:fl b p m)) (add b p n m) :: why not ?: &(!s.n s.m) :: -a-b - (add b p m [s=%.n e.m a.m]) :: add handles negative case + (add b p n [s=%.n e.m a.m]) :: add handles negative case ?: &(s.n !s.m) :: a+b - (add b p m [s=%.y e.m a.m]) :: is actually add + (add b p n [s=%.y e.m a.m]) :: is actually add ?. |(=(--1 (cmp:si e.n e.m)) &(=(e.n e.m) (^gte a.n a.m))) :: n > m $(n m(s !s.m), m n(s !s.n)) =+ dif=(abs:si (dif:si e.n e.m)) From 01a148f852da5f5058bf0abcafb410fee20fa108 Mon Sep 17 00:00:00 2001 From: Jared Hance Date: Mon, 30 Jun 2014 12:24:32 -0400 Subject: [PATCH 7/9] More floating point bugfixes. Also enable FTZ, a SSE instruction... For now at least. --- arvo/hoon.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index e3be579ea0..88bdef3498 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1462,10 +1462,10 @@ (szer:vl:fl b p =(s.n s.m)) ?: (zer:te:fl b p m) (inft:vl:fl b p =(s.n s.m)) - =+ b=(lia p (^div (lsh 0 (^mul p 3) a.n) a.m)) + =+ c=(lia p (^div (lsh 0 (^mul p 3) a.n) a.m)) ?: (^gte a.n a.m) - (pro:te:fl b p [s==(s.n s.m) e=(dif:si e.n e.m) a=b]) - (pro:te:fl b p [s=|(s.n s.m) e=(dif:si (dif:si e.n e.m) (sun:si 1)) a=b]) + (pro:te:fl b p [s==(s.n s.m) e=(dif:si e.n e.m) a=c]) + (pro:te:fl b p [s==(s.n s.m) e=(dif:si (dif:si e.n e.m) (sun:si 1)) a=c]) ++ lte |= [n=[s=? e=@s a=@u] m=[s=? e=@s a=@u]] ^- ? ?: (^lte e.n e.m) From efc0aa0c70be87e0818f0aedc89d528ec84669ed Mon Sep 17 00:00:00 2001 From: Jared Hance Date: Mon, 30 Jun 2014 14:25:36 -0400 Subject: [PATCH 8/9] More flpt bug fixes --- arvo/hoon.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 88bdef3498..23a5849d3a 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1360,7 +1360,7 @@ ++ te |% ++ zer |= [b=@u p=@u n=[s=? e=@s a=@u]] - &(=(e.n (dec (^mul b 2))) =(0 (ira a.n))) + =(e.n (dec (^mul b 2))) ++ nan |= [b=@u n=[s=? e=@s a=@u]] &(=(e.n (^mul 2 +(b))) !=(0 (ira a.n))) @@ -1427,7 +1427,7 @@ ?: ?=(^ g) u.g ?: |((zer:te:fl b p n) (zer:te:fl b p m)) - (add b p n m) :: why not + (add b p n m(s !s.m)) :: why not ?: &(!s.n s.m) :: -a-b (add b p n [s=%.n e.m a.m]) :: add handles negative case ?: &(s.n !s.m) :: a+b @@ -1513,7 +1513,7 @@ (hol:fl 52 (sea a)) :: Convert to sign/exp/ari form ++ sea |= a=@rd ^- [s=? e=@s a=@u] - [s=(sig a) e=(exp a) a=(ari:fl 52 (end 0 52 a))] + (pro:te:fl 1.023 52 [s=(sig a) e=(exp a) a=(ari:fl 52 (end 0 52 a))]) ++ err |= a=@rd ^- (unit tape) (err:te:fl 1.023 52 (sea a)) From 573630e28dc28705f8bc5fb74cb9e7f79ffcd0b9 Mon Sep 17 00:00:00 2001 From: Jared Hance Date: Mon, 30 Jun 2014 14:43:06 -0400 Subject: [PATCH 9/9] Fl Pt works. The only failure I can get in the test suite is that signalling nan'n crash it, which is expected behavior anyway. Enables sse3 and fast-math. --- try/bin/fptest.hoon | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 try/bin/fptest.hoon diff --git a/try/bin/fptest.hoon b/try/bin/fptest.hoon new file mode 100644 index 0000000000..f0511da5c7 --- /dev/null +++ b/try/bin/fptest.hoon @@ -0,0 +1,25 @@ +:: +:: /=try=/bin/aestest/hoon +:: +|= [est=time eny=@uw] +|= ~ +:_ ~ :_ ~ +=+ i=0 +:- %$ +!> +|- ^- @ +?: =(1.000.000 i) 0 +=+ n=`@rd`(end 6 1 (en:aesc eny i)) +=+ m=`@rd`(rsh 6 1 (en:aesc +(eny) i)) +~& [%try `@ux`n `@ux`m] +=+ a=(add:rd n m) +=+ b=(sub:rd n m) +=+ c=(mul:rd n m) +=+ d=(div:rd n m) +=+ suc=%.y +?. suc + ~| [%fail i `@ux`n `@ux`m] + !! +?: &(!=(0 i) =(0 (mod i 1.000))) + $(i +(i)) +$(i +(i))