From 1fb108907ce6e6717623d8e842e109b79377a942 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 28 Aug 2014 12:40:40 -0700 Subject: [PATCH 01/63] Various fixes and improvements. --- arvo/hoon.hoon | 7 ------- 1 file changed, 7 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 71a9e47dd..a24c1cbeb 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -6786,7 +6786,6 @@ %peek peek %repo repo %rest rest - %sift sift %seek seek %tack tack %tock tock @@ -8347,12 +8346,6 @@ =+ zar=(seek way hyp) ?>(?=(& -.q.zar) [p.zar p.q.zar]) :: - ++ sift - |= ref=type - ~+ - ^- type - ~|(%sift-lose ?>((nest(sut ref) & -:!>(*typo)) ref)) - :: ++ snub ~/ %snub |= har=(list ,[p=wing q=twig]) From 1ffb73c558830f2a44d3c14e5549afb2b43b33f8 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 2 Sep 2014 13:45:49 -0700 Subject: [PATCH 02/63] Pull in murmur3. --- arvo/hoon.hoon | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index a24c1cbeb..054093913 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1074,6 +1074,45 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cD, insecure hashing :: :: +++ mum :: mug with murmur3 + ~/ %mum + |= a=* + |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a))))) + ++ spec :: standard murmur3 + |= [syd=@ key=@] + ?> (lte (met 5 syd) 1) + =+ ^= row + |= [a=@ b=@] + (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b)) + =+ mow=|=([a=@ b=@] (end 5 1 (mul a b))) + =+ len=(met 5 key) + =- =. goc (mix goc len) + =. goc (mix goc (rsh 4 1 goc)) + =. goc (mow goc 0x85eb.ca6b) + =. goc (mix goc (rsh 0 13 goc)) + =. goc (mow goc 0xc2b2.ae35) + (mix goc (rsh 4 1 goc)) + ^= goc + =+ [inx=0 goc=syd] + |- ^- @ + ?: =(inx len) goc + =+ kop=(cut 5 [inx 1] key) + =. kop (mow kop 0xcc9e.2d51) + =. kop (row 15 kop) + =. kop (mow kop 0x1b87.3593) + =. goc (mix kop goc) + =. goc (row 13 goc) + =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc))) + $(inx +(inx)) + :: + ++ trim :: 31-bit nonzero + |= key=@ + =+ syd=0xcafe.babe + |- ^- @ + =+ haz=(spec syd key) + =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz)) + ?.(=(0 ham) ham $(syd +(syd))) + -- ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler ++ mug :: 31bit nonzero FNV1a ~/ %mug From 0cab269935ed0ca5a55c90ad6b1bc7e66f75ab5d Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 2 Sep 2014 19:58:36 -0700 Subject: [PATCH 03/63] Before jet renaming. --- arvo/hoon.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 054093913..5cab6d98e 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -370,7 +370,7 @@ [%cube p=* q=type] :: constant [%face p=term q=type] :: name [%fork p=type q=type] :: union/branch - [%hold p=(list ,[p=type q=twig])] :: infinite genrator + [%hold p=(list ,[p=type q=twig])] :: infinite generator == :: ++ typo type :: old type ++ udal :: atomic change (%b) From 76c9b0316641a782bc35291ef42faf0211e1a8dd Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 8 Sep 2014 19:35:25 -0700 Subject: [PATCH 04/63] Compatible with k.164. --- arvo/hoon.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 5cab6d98e..838bd5c85 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2462,7 +2462,7 @@ vex [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]] :: -++ inde |* sef=_rule :: indentation block +++ inde |* sef=_rule :: indentation block |= nail ^+ (sef) =+ [har tap]=[p q]:+< =+ lev=(fil 3 (dec q.har) ' ') From 9456e17bae91d77b1093cead3004c79659a93b12 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 8 Sep 2014 19:38:41 -0700 Subject: [PATCH 05/63] Tweak test. --- arvo/test.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/test.hoon b/arvo/test.hoon index ab7bd592d..a632f70f6 100644 --- a/arvo/test.hoon +++ b/arvo/test.hoon @@ -4,7 +4,7 @@ =- (add:all x y) ^= all => %164 -~% %k164 ~ ~ +~% %k.164 ~ ~ |% ++ add ~/ %add From 3bb082fbdc08e9d83c670113c29bd582d8001fcc Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Thu, 11 Sep 2014 11:00:58 -0700 Subject: [PATCH 06/63] finally favicon. not perfect, but better. --- arvo/eyre.hoon | 68 ++++---------------------------------------------- 1 file changed, 5 insertions(+), 63 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index d3437bd20..232eb4bf8 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -773,69 +773,11 @@ == :: ^= fac - 0w89.wgGV4.jAl90.00003.sV4OG.IJjfa.1vYpi.gRxB9.3m6kA.dopig. - RxB93.m6kAd.opigR.xB93m.6kAdo.pigRx.B93m6.kAdop.igRxB.93m6k. - Adopi.gRxBf.vGSfy.m8hQj.T-DiD.7kqvH.vEpA3.3vH-C.in~Tq.l8U0n. - 1FVhj.w9E1A.NIF6w.4j9v~.VZ0~B.9flkB.IY90B.-ieSV.Ky8Q~.4~07s. - JcXFC.DtI-1.GGz-1.V-olV.g3wsv.ZCQM1.BJbVj.Vwiv0.uo7Gh.4qsxA. - 92ZYU.tJ5uH.yiIzV.FwvJR.UUq6z.cpKIG.Hck9v.qGDm1.PY2rM.itxLB. - fn0Bo.5DO8x.oO7KE.kYh-P.NiKp1.HT88j.Mu3ZK.ciKsU.TnlkV.0Zo77. - 12ciy.nY3dM.7nDnY.GVgGh.ZllpO.SFHFb.p1Ae0.uUpXV.eqFvS.pkBRl. - jv0MP.ilRHP.1HwtK.GFptt.2KdpP.RsYqI.wRHEG.j~LZQ.I06qJ.fP0Pp. - 77qjo.s0PU0.rGGg6.lgNvc.~CZE~.bSp9j.EGHF~.UqYB6.l4Y~Z.P~GGE. - LwrJs.ZvYV-.U4Wh4.04dws.6HeuZ.2ZF7A.y4MN5.3vsCj.QHzjW.4lflk. - WU6X0.AmMws.vbMfB.3e1s~.aeE7W.0hQPH.ODvMf.cvgzb.Y15Ah.01384. - YwVPT.KzILB.PlaqN.pNlvw.fdQ79.~mPpo.YaHqw.fnWGB.QYM4F.w3E0b. - 0o~n-.faydD.zlllI.0nU3D.w5rlI.4nrSG.VkhPM.NTkpa.eoXzw.9AEYN. - auZGt.99gxL.8RlsI.aXMXX.tFVhX.V4kj8.yczjh.faRI3.JTg1H.-0uZM. - JA6rR.z0~pO.uXiSg.rvU27.A58MU.TBijQ.23F1J.CCIYE.IO8w-.cMlMA. - hvKh4.zY16M.gjRlk.v--9h.TNNRR.HhIGo.8kZXk.Wb74j.faHlk.6V-Vw. - jMan8.yb37R.Q2h42.Or3Nw.Pp39w.jZ--3.-jwZH.U~3Za.Uu0u6.bNAOP. - U2jux.Jqo2R.O8x1~.ecZvL.30ug~.qpoFw.vwtqD.Vb6EI.cZQyO.EN-xl. - nlsLC.dT099.apOh5.SEeDz.07-GE.xFzZk.KcmCl.SJWF5.v3u1x.Uq1Cj. - tV~hG.YuGGb.SgpdR.xHaBh.S3eEv.q0mSg.RZh8s.wxhnk.EcNvW.GccZQ. - yO0Jb.n18hs.BLFx2.iigqf.AhsKS.LWqby.TUEmv.gmmhR.6DW3w.uLR0Y. - QQBC8.YoQ63.g8m8i.iq3B-.SxwLn.jLbh3.l7cq3.eVQmV.5O2df.SXBkv. - Y3LLb.denQq.GvR0R.P3Gh4.2iiq2.h-srW.o0ZZ-.HIrdj.npm5n.pnv07. - vyT77.43WGP.Bciiq.zt1cI.7A4xB.zK9xm.-tV6x.ZdA6P.pheXQ.aSz4X. - Zj2bS.C1UPx.~c1dS.xwF3b.6jZ-M.WI2eQ.e69Qw.DGFly.tTze-.GGbZU. - qJ-m-.fD8yI.Adktz.oqTsF.F7ltA.6no6T.~fWJU.0gRsp.-P88x.a9I9b. - Adkvz.ory8J.Ouhfu.H8c-U.2HLgE.Wi4xH.3AEGK.VjkS-.Z5hMx.UN5o~. - Y~EWp.7LGox.IQxpt.cgONH.CEyKJ.jjTdM.GJ9HL.RloJZ.xuRtL.JZ7jg. - ZZj6w.2AOoM.CENdS.xxegZ.RzTdh.i-1hZ.N1HPF.EqHU0.XzN6K.mBedG. - uvBiL.HqpmY.Bl9z2.qzqA8.WzKqz.h~S1J.K2QHQ.Dy-CM.7RO0l.QksW3. - mpFnx.fy-Pa.p7xhW.SboOd.fOBon.mCgSX.Z38Qe.dMHUC.79wje.wziG5. - 6Xtn7.ksEHO.xkBrO.e7yFe.vNaYx.FgDsI.BS9y8.AELs-.C9-DB.FAZI-. - wKt2N.8qQhA.Apxm7.O5yIB.X51l9.Kduxm.SRA5N.UYi6I.MrySX.RZXrT. - 8UcY2.zUAfu.SOcUK.vZrDL.vBAHb.eOo~N.7J3sR.eJhSo.4~YE1.5k0h5. - 51RqS.b0jyR.RfhON.4Dt07.idahL.5isLK.eeBv3.znQxC.9LXkE.xKghP. - Ia-R0.AgmB5.pGGIA.slCGu.CtR5q.NrzHh.1bscz.8CsWC.KH4it.LLrWm. - UlRdr.lUGji.W76xr.kVAmO.6oAYS.7nXX~.kfeM2.TSS2m.JOCAb.sFFWg. - 4xH3C.MDKh4.FZso1.tXwUJ.Taq5K.8yS24.xHr4M.Kvu~E.HTpka.-Zg3f. - KEXFS.qCKwh.l1KRN.c9H8A.HFcSw.rePCF.Iy93m.njkMZ.IEyiq.lFq3y. - gRFzg.uL9tz.zP8du.Y1ZWP.PtQ6G.gzIt5.K8hNz.UAdpM.Q43L6.IMHx5. - N8qPh.EfX8G.UC~68.S93ms.d18Vh.adkOx.GLkTI.khFcL.ZWG5G.Adoeh. - hx~As.hci6I.Uq2pG.ykqHO.yUAdq.gQ7FD.4sOjn.IwGGw.UAdqo.Q4jVN. - eJP8c.xQlm~.8nJ1y.gRF3g.oSPAM.fuqE0.M~23y.gRHyo.gngjF.ceM3n. - V~uQy.93m-9.xa-3N.T80~v.GzR-g.HqBGA.mi4xH.3AMOL.mCjT5.Blqab. - 60ruw.HDV~k.Tj~fX.Swx8u.ZFOoi.m1GUF.Gs4-q.0kfxh.H8yjt.OCXGL. - PYGTY.23LgI.Wl4x6.8bI3e.MXeVb.h6rL9.DXWyt.8wJ8W.HalWR.itqp3. - pkrSC.8bQSM.HLV2J.G7sCj.QtGEi.AkSwI.A4P0J.gJ85j.MuMUY.nkT45. - -rkqv.BFBFU.KGd98.qRs~A.iblOv.mVKWx.Z19cs.AxHc6.UIKJc.NIHW8. - EnOEy.fygRG.29bbR.FBDVL.Ter6T.SBKat.MFBPE.AfuO9.kBHV~.QstE-. - VaYNV.qpfhL.sFHj0.eFphG.U6Hw6.EsVox.7kpks.N6bRk.GMLY~.HWBVj. - Snx6X.0GY2b.GhzmW.udfRF.jTgLC.uPWGL.fIwM6.16Ah4.NFZjz.Ftln7. - KQ-k-.0SO8H.xrqcw.MXZG9.6BZsJ.zULJU.NPDy3.aewMa.3auiA.Ysei3. - YQJGB.PlCAQ.S5YPU.uGEtI.wQrw1.cy8Sd.bFYuX.GGWZS.DSq1Y.O8ELq. - cR6kA.dopig.RxB93.m6kAd.opigR.xB93m.6kAdo.pigRx.B93m6.kAdop. - igRxB.93m6k.Adopi.gRxB9.3m6kA.doSsI.1Tves.7Fb5l.hneus.VDLsZ. - ~P3DD.D~CpI.BALPA.rxSTT.fuXa4.gP3Yv.sPKOY.KSMKP.balqk.xjbEH. - idkbq.Elo0N.dHjkM.vEBiq.BC-Rb.IKMiB.JiaoS.x3mLy.Jr6P5.ToiS2. - gAz4y.qNHiI.k7WIl.9EJGb.iJ2Tp.NQ5H5.VpSni.By-OX.TfvYs.plRic. - rpPJD.7xkgk.h9BMw.001EY.XFJDs.CYKpn.1xoTd.HrCAK.tTtT0.6lOon. - tQpCZ.jt5x5.t1A00.01UCO.x20ts.d003n.3g00s.RB8s0.A0002.8p0xY. - 20w82.5h9gD.c4000.0l9ny.s0000.0o8p0.0006g.0001i.h4x93.g0000. - Eq2wR.7jB29 + 0w89wg.GV4jA.l9000.00dPb.YzBT6.giO00.o100d.wZcqc.a9tg-.VTG0b. + AUIvE.HBM3g.cK4SE.0aagi.l090p.I1P5g.Y-80r.y1YS9.1xE~Y.qgpFY. + vKN1V.905y0.2UwvL.43TUw.uL406.0-31h.xwoJF.Ul454.ilk00.00Yps. + BNumh.xpl9B.pS5Ji.i1BoC.ZAgg1.BsC5T.t6pLk.Thohn.gp000.0ov~P. + 7M000.0o840.00010.0001i.h4x93.g0000.Eq2wR.7jB29 == :: ++ huff :: request by ship From 102fced646fe700e3a47c552f82112f6fb6ab45a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 11 Sep 2014 18:52:25 +0000 Subject: [PATCH 07/63] clay fixes --- arvo/clay.hoon | 4 ++-- arvo/zuse.hoon | 37 ++++++++++++++++------------------ main/pub/src/doc/ref/vol/4c.md | 24 +++++++++++----------- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index dfa068872..243dd3ad4 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -126,9 +126,9 @@ ?~(nao ~ [~ (~(read-at-aeon ze lim dom ran) u.nao mun)]) :: ++ balk :: read and send - |= [hen=duct oan=@ud mun=mood] + |= [hen=duct yon=@ud mun=mood] ^+ +> - =+ vid=(~(read-at-aeon ze lim dom ran) oan mun) + =+ vid=(~(read-at-aeon ze lim dom ran) yon mun) ?~ vid (blub hen) (blab hen mun u.vid) :: ++ blab :: ship result diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 96413dfd6..6ada5eaf2 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1039,6 +1039,7 @@ ++ ze |_ [lim=@da dome rang] ++ aeon-to-tako ~(got by hit) + ++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki) ++ make-yaki :: make yaki |= [p=(list tako) q=(map path lobe) t=@da] ^- yaki @@ -1109,17 +1110,16 @@ ((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq) :: ++ lobes-at-path :: lobes-at-path:ze - |= [oan=aeon pax=path] :: data at path + |= [yon=aeon pax=path] :: data at path ^- (map path lobe) - ?: =(0 oan) ~ + ?: =(0 yon) ~ %- mo %+ skim %. ~ %~ tap by =< q - %- tako-to-yaki - %- aeon-to-tako - oan + %- aeon-to-yaki + yon |= [p=path q=lobe] ?| ?=(~ pax) ?& !?=(~ p) @@ -1137,8 +1137,7 @@ ?: =(0 let) [~ 0] :: avoid underflow ?: %+ gte p.lok =< t - %- tako-to-yaki - %- aeon-to-tako + %- aeon-to-yaki let [~ let] $(let (dec let)) @@ -1248,11 +1247,11 @@ == :: ++ rewind :: rewind:ze - |= oan=aeon :: rewind to aeon + |= yon=aeon :: rewind to aeon ^+ +> - ?: =(let oan) +> - ?: (gth oan let) !! :: don't have version - +>(ank (checkout-ankh q:(tako-to-yaki (aeon-to-tako oan))), let oan) + ?: =(let yon) +> + ?: (gth yon let) !! :: don't have version + +>(ank (checkout-ankh q:(aeon-to-yaki yon)), let yon) :: :::: ++ update-lat :: update-lat:ze @@ -1272,8 +1271,7 @@ ?: =(let 0) :: initial commit ~ :: has nothing =< q - %- tako-to-yaki - %- aeon-to-tako + %- aeon-to-yaki let %- |= bar=(map path blob) :: find unchanged =+ sar=(sa (turn lar |=([p=path *] p))) :: changed paths @@ -1784,19 +1782,18 @@ ?^(r.mun ~ [~ let]) ?: ?=(%w p.mun) =+ ^= yak - %- tako-to-yaki - %- aeon-to-tako + %- aeon-to-yaki let ?^(r.mun ~ [~ [t.yak (forge-nori yak)]]) ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] (query(ank ank:(descend-path:(zu ank) r.mun)) p.mun) :: ++ read-at-aeon :: read-at-aeon:ze - |= [oan=aeon mun=mood] :: seek and read + |= [yon=aeon mun=mood] :: seek and read ^- (unit) ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed - ?^(r.mun ~ [~ oan]) - (read:(rewind oan) mun) + ?^(r.mun ~ [~ yon]) + (read:(rewind yon) mun) :: ++ equiv :: test paths |= [p=(map path lobe) q=(map path lobe)] @@ -1824,12 +1821,12 @@ %+ forge-yaki wen ?: =(let 0) :: initial import [~ q.lem] - [(some r:(tako-to-yaki (aeon-to-tako let))) q.lem] + [(some r:(aeon-to-yaki let)) q.lem] =+ yak=-.yet =. lat +.yet :: merge objects ?. ?| =(0 let) !=((lent p.yak) 1) - !(equiv q.yak q:(tako-to-yaki (aeon-to-tako let))) + !(equiv q.yak q:(aeon-to-yaki let)) == +>.$ :: silently ignore =: let +(let) diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index 1e780b5d0..5ba5770bd 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -1024,11 +1024,11 @@ which reads the requested data at the given revision. ``` ++ read-at-aeon :: read-at-aeon:ze - |= [oan=aeon mun=mood] :: seek and read + |= [yon=aeon mun=mood] :: seek and read ^- (unit) ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed - ?^(r.mun ~ [~ oan]) - (read:(rewind oan) mun) + ?^(r.mun ~ [~ yon]) + (read:(rewind yon) mun) ``` If we're requesting the revision number with a case other than by number, then @@ -1038,11 +1038,11 @@ to get the requested information. ``` ++ rewind :: rewind:ze - |= oan=aeon :: rewind to aeon + |= yon=aeon :: rewind to aeon ^+ +> - ?: =(let oan) +> - ?: (gth oan let) !! :: don't have version - +>(ank (checkout-ankh q:(tako-to-yaki (aeon-to-tako oan))), let oan) + ?: =(let yon) +> + ?: (gth yon let) !! :: don't have version + +>(ank (checkout-ankh q:(tako-to-yaki (aeon-to-tako yon))), let yon) ``` If we're already at the requested version, we do nothing. If we're requesting @@ -1490,9 +1490,9 @@ We call `++lobes-at-path:ze` to get the data at the particular path. ``` ++ lobes-at-path :: lobes-at-path:ze - |= [oan=aeon pax=path] :: data at path + |= [yon=aeon pax=path] :: data at path ^- (map path lobe) - ?: =(0 oan) ~ + ?: =(0 yon) ~ %- mo %+ skim %. ~ @@ -1500,7 +1500,7 @@ We call `++lobes-at-path:ze` to get the data at the particular path. =< q %- tako-to-yaki %- aeon-to-tako - oan + yon |= [p=path q=lobe] ?| ?=(~ pax) ?& !?=(~ p) @@ -2001,9 +2001,9 @@ subscription case. ``` ++ balk :: read and send - |= [hen=duct oan=@ud mun=mood] + |= [hen=duct yon=@ud mun=mood] ^+ +> - =+ vid=(~(read-at-aeon ze lim dom ran) oan mun) + =+ vid=(~(read-at-aeon ze lim dom ran) yon mun) ?~ vid (blub hen) (blab hen mun u.vid) ``` From be18a61cb1446e86b5b9bf5086dde1619ae1d2f4 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 12 Sep 2014 12:32:59 -0700 Subject: [PATCH 08/63] Boot process. --- arvo/test.hoon | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 arvo/test.hoon diff --git a/arvo/test.hoon b/arvo/test.hoon deleted file mode 100644 index a632f70f6..000000000 --- a/arvo/test.hoon +++ /dev/null @@ -1,24 +0,0 @@ -?> ?=([@ @] .) -%. . -|= [x=@ y=@] -=- (add:all x y) -^= all -=> %164 -~% %k.164 ~ ~ -|% -++ add - ~/ %add - |= [a=@ b=@] - ^- @ - ?: =(0 a) b - $(a (dec a), b +(b)) -:: -++ dec - ~/ %dec - |= a=@ - ?< =(0 a) - =+ b=0 - |- ^- @ - ?: =(a +(b)) b - $(b +(b)) --- From 69de3fdb92f13a8429e4e2e7964be5922b8603ea Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 12 Sep 2014 12:55:15 -0700 Subject: [PATCH 09/63] Some support stuff. --- main/bin/liquid.hoon | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 main/bin/liquid.hoon diff --git a/main/bin/liquid.hoon b/main/bin/liquid.hoon new file mode 100644 index 000000000..4bdf81d15 --- /dev/null +++ b/main/bin/liquid.hoon @@ -0,0 +1,20 @@ +!: +:: /=main=/bin/liquid/hoon +:: +=> .(- `[who=@p how=path]`-) +|= [est=time eny=@uw] +|= arg=* +=+ ^= lok ^- case + ?: =(~ arg) [%da est] + ?> =(~ +.arg) + ((hard case) -.arg) +=+ cav=(scot (dime lok)) +=+ top=`path`[(scot %p who) %arvo cav ~] +=+ pax=`path`(weld top `path`[%hoon ~]) +~& %liquid-start +=+ gen=(reck pax) +~& %liquid-parsed +=+ ken=q:(~(mint ut %noun) %noun gen) +~& %liquid-compiled +:_ ~ :_ ~ +[%xx %sage [%dummy %pill ~] [ken 0]] From 54775317554d64b84025e275de8da33a2ef23135 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 12 Sep 2014 16:06:33 -0700 Subject: [PATCH 10/63] Jets? --- arvo/hoon.hoon | 87 ++++++++++++++++++-------------------------------- 1 file changed, 31 insertions(+), 56 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 0cedcb0dd..b8c7e5290 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -363,7 +363,7 @@ [%cube p=* q=type] :: constant [%face p=term q=type] :: name [%fork p=type q=type] :: union/branch - [%hold p=(list ,[p=type q=twig])] :: infinite generator + [%hold p=(list ,[p=type q=twig])] :: infinite genrator == :: ++ typo type :: old type ++ udal :: atomic change (%b) @@ -1036,45 +1036,6 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cD, insecure hashing :: :: -++ mum :: mug with murmur3 - ~/ %mum - |= a=* - |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a))))) - ++ spec :: standard murmur3 - |= [syd=@ key=@] - ?> (lte (met 5 syd) 1) - =+ ^= row - |= [a=@ b=@] - (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b)) - =+ mow=|=([a=@ b=@] (end 5 1 (mul a b))) - =+ len=(met 5 key) - =- =. goc (mix goc len) - =. goc (mix goc (rsh 4 1 goc)) - =. goc (mow goc 0x85eb.ca6b) - =. goc (mix goc (rsh 0 13 goc)) - =. goc (mow goc 0xc2b2.ae35) - (mix goc (rsh 4 1 goc)) - ^= goc - =+ [inx=0 goc=syd] - |- ^- @ - ?: =(inx len) goc - =+ kop=(cut 5 [inx 1] key) - =. kop (mow kop 0xcc9e.2d51) - =. kop (row 15 kop) - =. kop (mow kop 0x1b87.3593) - =. goc (mix kop goc) - =. goc (row 13 goc) - =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc))) - $(inx +(inx)) - :: - ++ trim :: 31-bit nonzero - |= key=@ - =+ syd=0xcafe.babe - |- ^- @ - =+ haz=(spec syd key) - =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz)) - ?.(=(0 ham) ham $(syd +(syd))) - -- ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler :: ++ mum :: mug with murmur3 @@ -2472,7 +2433,7 @@ vex [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]] :: -++ inde |* sef=_rule :: indentation block +++ inde |* sef=_rule :: indentation block |= nail ^+ (sef) =+ [har tap]=[p q]:+< =+ lev=(fil 3 (dec q.har) ' ') @@ -2985,8 +2946,7 @@ ?: =(inx len) & =+ cur=(cut 3 [inx 1] b) ?& ?| &((gte cur 'a') (lte cur 'z')) - &((gte cur 'A') (lte cur 'Z')) - &(&((gte cur '0') (lte cur '9')) !=(0 inx)) + &((gte cur '0') (lte cur '9')) |(=('-' cur) =('~' cur) =('_' cur) =('.' cur)) == $(inx +(inx)) @@ -6835,6 +6795,7 @@ %peek peek %repo repo %rest rest + %sift sift %seek seek %tack tack %tock tock @@ -8402,6 +8363,12 @@ =+ zar=(seek way hyp) ?>(?=(& -.q.zar) [p.zar p.q.zar]) :: + ++ sift + |= ref=type + ~+ + ^- type + ~|(%sift-lose ?>((nest(sut ref) & -:!>(*typo)) ref)) + :: ++ snub ~/ %snub |= har=(list ,[p=wing q=twig]) @@ -8500,28 +8467,36 @@ ;~(plug (star low) (star hig)) :: ++ plex - |= gen=twig ~| [%plex gen] ^- path + |= gen=twig ^- (unit path) ?: ?=([%zpcb *] gen) $(gen q.gen) - ?> ?=([%clsg *] gen) - (turn p.gen |=(a=twig ?>(?=(%dtzy -.a) q.a))) + ?. ?=([%clsg *] gen) ~ + %+ reel p.gen + |= [a=twig b=_`(unit path)`[~ u=/]] + ?~ b ~ + ?. ?=(%dtzy -.a) ~ + `[q.a u.b] :: ++ pray - |= gen=twig ~| %pray ^- twig + |= gen=twig ~| %pray ^- (unit twig) =+ rev=(plex gen) - ?: (~(has in was) rev) + ?~ rev ~ + :- ~ + ?: (~(has in was) u.rev) ~|(%pray-loop !!) - =+ ruv=`path`(weld rev `path`[%hoon ~]) + =+ ruv=`path`(weld u.rev `path`[%hoon ~]) =+ txt=(,@ta .^(%cx ruv)) ~| ruv %+ rash txt - (ifix [gay gay] tall(was (~(put in was) rev), wer rev)) + (ifix [gay gay] tall(was (~(put in was) u.rev), wer u.rev)) :: ++ prey - |= gun=(list twig) ^- twig - ?~ gun [~ 1] - ?~ t.gun (pray i.gun) - [%tsgr (pray i.gun) $(gun t.gun)] + |= gun=(list twig) ^- (unit twig) + ?~ gun `[~ 1] + =+ gup=(pray i.gun) + ?~ gup ~ + ?~ t.gun gup + (bind $(gun t.gun) |=(a=twig [%tsgr u.gup a])) :: ++ phax |= ruw=(list (list beer)) @@ -8943,7 +8918,7 @@ [%dtkt %dtzz %$ %cx rev] ;~(plug hill rood) == - (cook prey (most ket rood)) + (sear prey (most ket rood)) == == (stag %cnzz rope) @@ -9235,7 +9210,7 @@ :~ [':' ;~(pfix col (toad expz))] [',' (rune com %zpcm expb)] [';' (rune sem %zpsm expb)] - ['^' ;~(pfix ket (cook prey (toad exps)))] + ['^' ;~(pfix ket (sear prey (toad exps)))] ['>' (rune gar %zpgr expa)] ['=' (rune tis %zpts expa)] ['?' (rune wut %zpwt hinh)] From acca268df38da3e9d6337a883423d1df9122e272 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Sat, 13 Sep 2014 17:56:36 -0700 Subject: [PATCH 11/63] Partially fixed %gall .^ --- arvo/ames.hoon | 2 +- arvo/gall.hoon | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 0d5f096ba..2f8d2573b 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -1433,7 +1433,7 @@ =+ bou=bust:puz =. bin ?. &(bou !oub) bin - :_(bin [%wine [our her] " not responding still trying"]) + :_(bin [%wine [our her] " not responding still crying"]) =. diz ?:((boom:puz now) (pode:diz now) diz) (busk xong:diz yem) :: diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 847dfea2d..84a0b3442 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -1,4 +1,4 @@ -:: :: %gall, user-level applications +!: :: %gall, user-level applications !? 164 :::: |= pit=vase @@ -528,7 +528,7 @@ ^- lens ?~ huv.sat *lens =+ gat=(slap u.huv.sat [%cnzy %peek]) - =+ cor=(slam gat !>(pax)) + =+ cor=(slam gat !>([our pax])) =+ ^= dek |* fun=$+(vase *) |= nam=@tas From e44b3766e04443def792f8b8b070dada5864e337 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sun, 14 Sep 2014 20:34:32 -0700 Subject: [PATCH 12/63] Elide superfluous dummy jet for ++sear. --- arvo/hoon.hoon | 2 -- 1 file changed, 2 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index b8c7e5290..4cb8b2b79 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2502,9 +2502,7 @@ [zac [~ i.q.tub [zac t.q.tub]]] :: ++ sear :: conditional cook - ~/ %sear |* [pyq=_|=(* *(unit)) sef=_rule] - ~/ %fun |= tub=nail =+ vex=(sef tub) ?~ q.vex From baab963d78c8dab7edddc0aed35a19143d88b240 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sun, 14 Sep 2014 20:38:19 -0700 Subject: [PATCH 13/63] Another fake jet. --- arvo/hoon.hoon | 2 -- 1 file changed, 2 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 4cb8b2b79..87fa1d0a3 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2599,9 +2599,7 @@ [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]] :: ++ stun :: parse several times - ~/ %stun |* [[les=@ mos=@] fel=_rule] - ~/ %fun |= tub=nail ^- (like (list ,_(wonk (fel)))) ?: =(0 mos) From c5a2f469bc79fbd92807b754f8ac2c5d6bc0438a Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 15 Sep 2014 16:56:37 -0700 Subject: [PATCH 14/63] Debugging stash. --- arvo/hoon.hoon | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index b8c7e5290..87fa1d0a3 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2502,9 +2502,7 @@ [zac [~ i.q.tub [zac t.q.tub]]] :: ++ sear :: conditional cook - ~/ %sear |* [pyq=_|=(* *(unit)) sef=_rule] - ~/ %fun |= tub=nail =+ vex=(sef tub) ?~ q.vex @@ -2601,9 +2599,7 @@ [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]] :: ++ stun :: parse several times - ~/ %stun |* [[les=@ mos=@] fel=_rule] - ~/ %fun |= tub=nail ^- (like (list ,_(wonk (fel)))) ?: =(0 mos) From c33eab76453b10e2e55af64ba8ce70fbbfb7cd8c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Sep 2014 12:42:37 +0000 Subject: [PATCH 15/63] updated clay doc --- main/pub/src/doc/ref/vol/4c.md | 106 ++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index 5ba5770bd..ff9c1767d 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -685,8 +685,8 @@ each in detail. These two kisses are nearly identical. At a high level, they apply changes to the filesystem. Whenever we add, remove, or edit a file, one of these cards is sent. The `p` is the ship whose filesystem we're trying to change, the `q` is -the desk we're changing, and the `r` is the request change. For the format of -the requested change, see the documentation for `++nori` above. +the desk we're changing, and the `r` is the requested change. For the format +of the requested change, see the documentation for `++nori` above. When a file is changed in the unix filesystem, vere will send a `%into` kiss. This tells clay that the duct over which the kiss was sent is the duct that @@ -2035,3 +2035,105 @@ producing it if it has; else, we call `++blub` since no more data can be produced over this subscription. This concludes our discussion of foreign requests. + +Lifecycle of a Local Write +-------------------------- + +There are two kisses that cause a local write: `%info` and `%into`. These are +exactly identical except that `%into` resets the the sync duct in clay, so it +ought only to be called from unix. Within arvo, we call `%info`. + +Both are handled in `++call`. + +``` + ?(%info %into) + ?: =(%$ q.q.hic) + ?. ?=(%into -.q.hic) [~ ..^$] + =+ yar=(need (~(get by fat.ruf) p.q.hic)) + [~ ..^$(fat.ruf (~(put by fat.ruf) p.q.hic yar(hez [~ hen])))] + =^ mos ruf + =+ une=(un p.q.hic now ruf) + =+ ^= zat + (exec:(di:wake:une q.q.hic) hen now r.q.hic) + =+ zot=abet.zat + :- -.zot + =. une (pish:une q.q.hic +.zot ran.zat) + abet:une(hez.yar ?.(=(%into -.q.hic) hez.yar.une [~ hen])) + [mos ..^$] +``` + +Recall that in the kiss (`q.hic`) the `p` is the ship whose filesystem we're +trying to change, the `q` is the desk we're changing, and the `r` is the +requested change. + +If `q`, the desk name, is empty, then we don't make any actual changes to the +filesystem. In the case of `%info`, we do nothing at all. For the `%into` +kiss, we simply set the sync duct to the duct we received this kiss on. This +allows us to set the sync duct without making a change to our filesystem. + +Otherwise, we construct the core for a local ship with `++un` and for the local +desk with `++di`, as described above. We then apply the change with +`++exec:de`, which contains the meat of the write functionality. Afterward, we +call `++abet:de` to resolve our changes to the desk and `++pish:un` and +`++abet:un` to resolve our changes to the ship, as described above. Again, if +this is a `%info` kiss, then we don't change the sync duct; else, we set it to +the calling duct. + +The interesting call here was, of course, `++exec:de`. + +``` + ++ exec :: change and update + |= [hen=duct wen=@da lem=nori] + ^+ +> + (echo:wake:(edit wen lem) hen wen lem) +``` + +First, we call `++edit` to apply our changes, then we call `++wake` to push out +any new updates to our subscribers. Finally, we call `++echo` to announce our +changes to both unix and the terminal. + +We have described `++wake` above, so we'll discuss `++edit` and `++echo` here. +Since `++echo` is significantly simpler, we'll start with it. + +``` + ++ echo :: announce changes + |= [hen=duct wen=@da lem=nori] + ^+ +> + %= +> + vag ?~(hez vag :_(vag [u.hez [%ergo who syd let.dom]])) + yel + =+ pre=`path`~[(scot %p for) syd (scot %ud let.dom)] + ?- -.lem + | :_ yel + [hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))] + & |- ^+ yel + ?~ q.q.lem yel + :_ $(q.q.lem t.q.q.lem) + :- hen + :+ %note + ?-(-.q.i.q.q.lem %del '-', %ins '+', %mut ':') + [%leaf (spud (weld pre p.i.q.q.lem))] + == + == +``` + +If we have a sync duct, then we push out a `%ergo` gift along it so that unix +knows there has been a change to the filesystem and can update the copy on the +unix filesystem. + +Additionally, we push out a `%note` gift to the terminal duct to display the +new changes to the user. This is responsible for the printed lines we see when +a file is added, removed, or modified. + +It remains to discuss `++edit:de`. + +``` + ++ edit :: apply changes + |= [wen=@da lem=nori] + ^+ +> + =+ axe=(~(edit ze lim dom ran) wen lem) + =+ `[l=@da d=dome r=rang]`+<.axe + +>.$(dom d, ran r) +``` + + From fabf390eac80e45c5fa77115aeb7a2820e26e18c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Sep 2014 14:19:15 +0000 Subject: [PATCH 16/63] updated clay doc and code --- arvo/clay.hoon | 2 +- arvo/zuse.hoon | 20 ++-- main/pub/src/doc/ref/vol/4c.md | 169 +++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+), 14 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 243dd3ad4..02902960c 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -72,7 +72,7 @@ == :: ++ room :: fs per ship $: hun=duct :: terminal duct - hez=(unit duct) :: sync duch + hez=(unit duct) :: sync duct dos=(map desk dojo) :: native desk == :: ++ rove (each mood moot) :: stored request diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 6ada5eaf2..880becd65 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1798,17 +1798,13 @@ ++ equiv :: test paths |= [p=(map path lobe) q=(map path lobe)] ^- ? - %- |= qat=? - ?. qat %.n - %+ roll (~(tap by q) ~) - |= [[pat=path lob=lobe] eq=?] - ^- ? - ?. eq %.n + =- ?. qat %.n + %+ levy (~(tap by q) ~) + |= [pat=path lob=lobe] (~(has by p) pat) - %+ roll (~(tap by p) ~) - |= [[pat=path lob=lobe] eq=?] - ^- ? - ?. eq %.n + ^= qat + %+ levy (~(tap by p) ~) + |= [pat=path lob=lobe] =+ zat=(~(get by q) pat) ?~ zat %.n =((lobe-to-noun u.zat) (lobe-to-noun lob)) @@ -1817,13 +1813,11 @@ |= [wen=@da lem=nori] :: edit ^+ +> ?- -.lem - & =+ ^= yet + & =^ yak lat :: merge objects %+ forge-yaki wen ?: =(let 0) :: initial import [~ q.lem] [(some r:(aeon-to-yaki let)) q.lem] - =+ yak=-.yet - =. lat +.yet :: merge objects ?. ?| =(0 let) !=((lent p.yak) 1) !(equiv q.yak q:(aeon-to-yaki let)) diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index ff9c1767d..ca5d2c391 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -2136,4 +2136,173 @@ It remains to discuss `++edit:de`. +>.$(dom d, ran r) ``` +We very simply call `++edit:ze` and apply the resultant dome and rang back into +ourself. As we should expect, the actual handling of the changes themselves +is delegated to `++ze` in `arvo/zuse.hoon`. +``` + ++ edit :: edit:ze + |= [wen=@da lem=nori] :: edit + ^+ +> + ?- -.lem + & =^ yak lat :: merge objects + %+ forge-yaki wen + ?: =(let 0) :: initial import + [~ q.lem] + [(some r:(aeon-to-yaki let)) q.lem] + ?. ?| =(0 let) + !=((lent p.yak) 1) + !(equiv q.yak q:(aeon-to-yaki let)) + == + +>.$ :: silently ignore + =: let +(let) + hit (~(put by hit) +(let) r.yak) + hut (~(put by hut) r.yak yak) + == + +>.$(ank (checkout-ankh q.yak)) + | +>.$(lab ?<((~(has by lab) p.lem) (~(put by lab) p.lem let))) + == +``` + +Two kinds of changes may be made to a filesystem: we can modify the contents +or we can label a revision. + +Labeling a revision (the `|` case) is much simpler. We first assert that the +label doesn't already exist. Then, we put in `lab` in our dome the label +associated with the current revision number. + +In the `&` case, we're actually modifying the contents of the filesystem. +First, we create the commit in `++forge-yaki` by applying the given changes to +our current revision. This also updates `lat` in our rang with the new data +objects. + +Unless either this is the initial import, the generated yaki doesn't have +exactly one parent, or the data in the generated yaki is the same as that in +our current revision, we silently ignore the request. Note that this only +allows changes that don't affect the contents of the filesystem if this is a +merge. + +If one of the conditions does hold, then we apply the generated commit. We +increment `let`, the revision number of our head; associate the new revision +number with the hash of the new commit; and put the new commit in `hut`. +Finally, we update our current ankh by checking out the new commit. + +We discussed `++checkout-ankh` above, so it remains only to discuss +`++forge-yaki` and `++equiv`. We begin with the simpler, `++equiv:ze`. + +``` + ++ equiv :: test paths + |= [p=(map path lobe) q=(map path lobe)] + ^- ? + =- ?. qat %.n + %+ levy (~(tap by q) ~) + |= [pat=path lob=lobe] + (~(has by p) pat) + ^= qat + %+ levy (~(tap by p) ~) + |= [pat=path lob=lobe] + =+ zat=(~(get by q) pat) + ?~ zat %.n + =((lobe-to-noun u.zat) (lobe-to-noun lob)) +``` + +We're checking to see if the data in both filesystem trees is identical. We +start by going through `p` and checking to see if (1) the path exists in `q` +and (2) the data is the same as in `q`. + +This shows that `q` is a superset of `p`. To show that `p` and `q` are +equivalent, we have to make sure there is nothing in `q` that is not also in +`p`. Once we've done that, we know `p` and `q` are equivalent. + +``` + ++ forge-yaki :: forge-yaki:ze + |= [wen=@da par=(unit tako) lem=soba] :: forge yaki + =+ ^= per + ?~ par ~ + ~[u.par] + =+ gar=(update-lat (apply-changes q.lem) lat) + :- %^ make-yaki per +.gar wen :: from existing diff + -.gar :: fix lat +``` + +Here, we first make `per`, our list of parents. If we have a parent, we put it +in the list, else the list is empty. Simple. + +We then apply the changes and update `lat`, our object store. Finally, we make +a yaki out of the generated change information and produce both it and the new +object store. + +Lifecycle of a Local Merge +-------------------------- + +Merges are pretty simple from the perspective of clay. A `%merg` kiss is sent +with already-generated merge state, and we simply apply the new state. The +question of how the merge is generated is much more complicated, but it is also +out of the scope of this section. + +We've seen most of the arms involved, so we'll go through most of it pretty +quickly. In `++call` we handle the `%merg` kiss. + +``` + %merg :: direct state up + =^ mos ruf + =+ une=(un p.q.hic now ruf) + =+ ^= zat + (exem:(di:wake:une q.q.hic) hen now r.q.hic) + =+ zot=abet.zat + :- -.zot + =. une (pish:une q.q.hic +.zot ran.zat) + abet:une(hez.yar ?.(=(%into -.q.hic) hez.yar.une [~ hen])) + [mos ..^$] +``` + +As we've seen several times before, we set up a core for the local ship with +`++un`. We set up a core for the local desk with `++di` and updating our +subscribers with `++wake`. We call `++exem` to execute the merge. `++abet:de`, +`++pish:un` and `++abet:un` resolve all our changes. + +The only new arm here is `++exem:de`. + +``` + ++ exem :: execute merge + |= [hen=duct wen=@da mer=mizu] :: aka direct change + ?. (gte p.mer let.dom) !! :: no + =. +>.$ %= +>.$ + hut.ran (~(uni by hut.r.mer) hut.ran) + lat.ran (~(uni by lat.r.mer) lat.ran) + let.dom p.mer + hit.dom (~(uni by q.mer) hit.dom) + == + =+ ^= hed :: head commit + =< q + %- ~(got by hut.ran) + %- ~(got by hit.dom) + let.dom + =. ank.dom :: real checkout + (~(checkout-ankh ze lim dom ran) hed) + (echa:wake hen wen mer) :: notify or w/e +``` + +We first do a quick sanity check that the head of the merge data is greater +than the head of the old data. Merges must add at least one revision. + +We merge the new data in the obvious way. We do map merges for `hut` and `lat` +in rang to get all the new data and commits, we do a map merge in`hit` in our +dome to get all the new revision numbers, and we update our head to the most +recent revision. + +Then, we checkout the commit at our head and announce the results to unix. +`++echa` is the only new arm here. + +``` + ++ echa :: announce raw + |= [hen=duct wen=@da mer=mizu] + ^+ +> + %= +> + vag ?~(hez vag :_(vag [u.hez [%ergo who syd let.dom]])) + == +``` + +If we have a sync duct, we tell unix that a new revision is available. + +This concludes our discussion of a local merge. From f92a2652160d59f51a59391cc130fb3a061a3623 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Sep 2014 15:25:06 +0000 Subject: [PATCH 17/63] finished clay doc --- arvo/zuse.hoon | 6 +- main/pub/src/doc/ref/vol/4c.md | 119 ++++++++++++++++++++++++++++++++- 2 files changed, 121 insertions(+), 4 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 880becd65..2775ce3b4 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1273,13 +1273,13 @@ =< q %- aeon-to-yaki let - %- |= bar=(map path blob) :: find unchanged - =+ sar=(sa (turn lar |=([p=path *] p))) :: changed paths - %+ roll (~(tap by hat) ~) + =- =+ sar=(sa (turn lar |=([p=path *] p))) :: changed paths + %+ roll (~(tap by hat) ~) :: find unchanged |= [[pat=path gar=lobe] bat=_bar] ?: (~(has in sar) pat) :: has update bat (~(put by bat) pat (lobe-to-blob gar)) :: use original + ^= bar ^- (map path blob) %+ roll lar |= [[pat=path mys=miso] bar=(map path blob)] ^+ bar diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index ca5d2c391..b99254a5d 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -2232,13 +2232,130 @@ We then apply the changes and update `lat`, our object store. Finally, we make a yaki out of the generated change information and produce both it and the new object store. +In increasing order of complexity, the new arms here are `++make-yaki`, +`++update-lat`, and `++make-yaki`. + +``` + ++ make-yaki :: make yaki + |= [p=(list tako) q=(map path lobe) t=@da] + ^- yaki + =+ ^= has + %^ cat 7 (sham [%yaki (roll p add) q t]) + (sham [%tako (roll p add) q t]) + [p q has t] +``` + +We're given almost everything we need to make a yaki, so we just need to +generate the hash of the new yaki. We take a noun hash of a noun that depends +on the hashes of the parents, the data at this commit, and the date of the +commit. Note that this means two identical changes made on the same parents at +different times will have different hashes. + +``` + ++ update-lat :: update-lat:ze + |= [lag=(map path blob) sta=(map lobe blob)] :: fix lat + ^- [(map lobe blob) (map path lobe)] + %+ roll (~(tap by lag) ~) + |= [[pat=path bar=blob] [lut=_sta gar=(map path lobe)]] + ?~ (~(has by lut) p.bar) + [lut (~(put by gar) pat p.bar)] + :- (~(put by lut) p.bar bar) + (~(put by gar) pat p.bar) +``` + +We're given a map of paths directly to their contents, but we wish to have both +a map from paths to hashes of their contents and a map from hashes to the +content itself. We're given an initial map of the second kind, but when +applying the changes, we may add new content which is not yet stored here. + +We roll over the given map from paths to data and, if the data is already in +our store, then we simply add a reference to the hash in the map from paths to +hashes. Otherwise, we also have to add the entry in the map from hashes to +data. + +``` + ++ apply-changes :: apply-changes:ze + |= lar=(list ,[p=path q=miso]) :: store changes + ^- (map path blob) + =+ ^= hat :: current state + ?: =(let 0) :: initial commit + ~ :: has nothing + =< q + %- aeon-to-yaki + let + =- =+ sar=(sa (turn lar |=([p=path *] p))) :: changed paths + %+ roll (~(tap by hat) ~) :: find unchanged + |= [[pat=path gar=lobe] bat=_bar] + ?: (~(has in sar) pat) :: has update + bat + (~(put by bat) pat (lobe-to-blob gar)) :: use original + ^= bar ^- (map path blob) + %+ roll lar + |= [[pat=path mys=miso] bar=(map path blob)] + ^+ bar + ?- -.mys + %ins :: insert if not exist + ?: (~(has by bar) pat) !! :: + ?: (~(has by hat) pat) !! :: + (~(put by bar) pat (make-direct p.mys %c)) :: TODO content type? + %del :: delete if exists + ?. |((~(has by hat) pat) (~(has by bar) pat)) !! + (~(del by bar) pat) + %mut :: mutate, must exist + =+ ber=(~(get by bar) pat) + ?~ ber + =+ har=(~(get by hat) pat) + ?~ har !! + %+ ~(put by bar) pat + (make-delta u.har p.mys) + %+ ~(put by bar) pat + (make-delta p.u.ber p.mys) + == +``` + +We let `hat` be the state of our head. We let `bar` be the new state of +the files we touch in our changes, and then we add in the unchanged files. + +To compute `bar`, we go through each change, handling each one individually. +If the change is an insert, then we first assert that the file doesn't already +exist and that we haven't already added it in this changeset. Note that this +means it is impossible to delete a file and then insert it again in the same +changeset. If this is indeed a new file, then put the path into `bar`, +associated with its data blob, as calculated by `++make-direct`. + +``` + ++ make-direct :: make blob + |= [p=* q=umph] + ^- blob + [%direct (mug p) p q] +``` + +We're given everything we need to create a `%direct` blob except the hash, +which we calculate as the simple mug of the file contents. + +In the case of a delete, we first assert that the file exists in either the +current head or our new changes. Note that it is possible to insert a file and +then delete it in the same changeset. If the file does exist, then we remove +it from `bar`. + +Finally, in the case of a mutation, we try to get the current state of the file +from our new changes in `bar`. If it's not there, then we assert that the file +exists in our current head (it must, after all, if we're changing it), and we +make a `%delta` blob out of the difference between the old contents and the new +contents. If the file is in `bar`, then make the `%delta` blob as a change +from from the contents already in `bar` to the new contents. This means it is +possible to have multiple mutations to a file in the same changeset. + +This concludes our discussion of a local write. + Lifecycle of a Local Merge -------------------------- Merges are pretty simple from the perspective of clay. A `%merg` kiss is sent with already-generated merge state, and we simply apply the new state. The question of how the merge is generated is much more complicated, but it is also -out of the scope of this section. +out of the scope of this section. If you're interested, take a look at +`++construct-merge:ze`. We've seen most of the arms involved, so we'll go through most of it pretty quickly. In `++call` we handle the `%merg` kiss. From 9bdfaa845e4f18b1b548f75f9f7238fa7b517af6 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Sep 2014 15:30:11 +0000 Subject: [PATCH 18/63] really finished clay doc --- main/pub/src/doc/ref/vol/4c.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index b99254a5d..571eead4c 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -2346,6 +2346,12 @@ contents. If the file is in `bar`, then make the `%delta` blob as a change from from the contents already in `bar` to the new contents. This means it is possible to have multiple mutations to a file in the same changeset. +After we've computed the contents of modified files, we must add all the +unmodified files. We might naively suppose that `(~(uni by hat) bar)` would do +this, but this would add back all the deleted files. To get around this, we +let `sar` be the changed files, and then we simply roll over the files at our +current head, adding everything that isn't in `sar`. + This concludes our discussion of a local write. Lifecycle of a Local Merge From 9f222877913ce383d547be625ce38d71d683387e Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 16 Sep 2014 17:29:12 -0700 Subject: [PATCH 19/63] Merges and bugfixes. --- arvo/ames.hoon | 6 +- arvo/clay.hoon | 64 +-- arvo/eyre.hoon | 74 +-- arvo/ford.hoon | 2 +- arvo/hoon.hoon | 3 +- arvo/zuse.hoon | 510 ++++++++++----------- main/app/chat/core.hook | 4 +- main/bin/update.hoon | 2 +- main/pub/src/doc/ref/vol/4c.md | 801 ++++++++++++++++++++++++++------- try/bin/merge.hoon | 2 +- 10 files changed, 941 insertions(+), 527 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 2a6b74458..0d5f096ba 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -439,7 +439,7 @@ vix=(bex +((cut 0 [25 2] mag))) :: width of sender tay=(cut 0 [27 5] mag) :: message type == - ?> =(7 vez) + ?> =(1 vez) ?> =(chk (end 0 20 (mug bod))) :+ [(end 3 wix bod) (cut 3 [wix vix] bod)] (kins tay) @@ -459,7 +459,7 @@ =+ tay=(ksin q.kec) %+ mix %+ can 0 - :~ [3 7] + :~ [3 1] [20 (mug bod)] [2 yax] [2 qax] @@ -1047,7 +1047,7 @@ ++ gnaw :: gnaw:am |= [kay=cape ryn=lane pac=rock] :: process packet ^- [p=(list boon) q=fort] - ?. =(7 (end 0 3 pac)) [~ fox] + ?. =(1 (end 0 3 pac)) [~ fox] =+ kec=(bite pac) ?: (goop p.p.kec) [~ fox] ?. (~(has by urb.ton.fox) q.p.kec) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 71ca2ed34..243dd3ad4 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -20,7 +20,7 @@ [%wart p=sock q=@tas r=path s=*] :: network request [%warp p=sock q=riff] :: file request == :: -++ moot ,[p=case q=case r=path s=(map path lobe)] :: +++ moot ,[p=case q=case r=path s=(map path lobe)] :: stored change range ++ move ,[p=duct q=(mold note gift)] :: local move ++ nako $: gar=(map ,@ud tako) :: new ids let=@ud :: next id @@ -75,7 +75,7 @@ hez=(unit duct) :: sync duch dos=(map desk dojo) :: native desk == :: -++ rove (each mood moot) :: +++ rove (each mood moot) :: stored request ++ rung $: rus=(map desk rede) :: neighbor desks == :: -- => @@ -121,14 +121,14 @@ !! =+ ezy=?~(ref ~ (~(get by haw.u.ref) mun)) ?^ ezy ezy - =+ nao=(~(aeon ze lim dom ran) q.mun) + =+ nao=(~(case-to-aeon ze lim dom ran) q.mun) :: ~& [%aver-mun nao [%from syd lim q.mun]] - ?~(nao ~ [~ (~(avid ze lim dom ran) u.nao mun)]) + ?~(nao ~ [~ (~(read-at-aeon ze lim dom ran) u.nao mun)]) :: ++ balk :: read and send - |= [hen=duct oan=@ud mun=mood] + |= [hen=duct yon=@ud mun=mood] ^+ +> - =+ vid=(~(avid ze lim dom ran) oan mun) + =+ vid=(~(read-at-aeon ze lim dom ran) yon mun) ?~ vid (blub hen) (blab hen mun u.vid) :: ++ blab :: ship result @@ -137,7 +137,7 @@ +>(byn [[hen ~ [p.mun q.mun syd] r.mun dat] byn]) :: ++ bleb :: ship sequence - |= [hen=duct ins=@ud hip=*] + |= [hen=duct ins=@ud hip=nako] ^+ +> (blab hen [%w [%ud ins] ~] hip) :: @@ -211,19 +211,19 @@ (blab hen p.rav u.u.ver) :: | - =+ nab=(~(aeon ze lim dom ran) p.p.rav) + =+ nab=(~(case-to-aeon ze lim dom ran) p.p.rav) ?~ nab - ?> =(~ (~(aeon ze lim dom ran) q.p.rav)) - ~! [%um rav] + ?> =(~ (~(case-to-aeon ze lim dom ran) q.p.rav)) (duce hen (rive rav)) - =+ huy=(~(aeon ze lim dom ran) q.p.rav) + =+ huy=(~(case-to-aeon ze lim dom ran) q.p.rav) ?: &(?=(^ huy) |((lth u.huy u.nab) &(=(0 u.huy) =(0 u.nab)))) (blub hen) =+ top=?~(huy let.dom u.huy) - =+ sar=(~(apax ze lim dom ran) u.nab r.p.rav) - =+ ear=(~(apax ze lim dom ran) top r.p.rav) - =. +>.$ ?: =(sar ear) +>.$ - =+ fud=(~(gack ze lim dom ran) u.nab top) + =+ sar=(~(lobes-at-path ze lim dom ran) u.nab r.p.rav) + =+ ear=(~(lobes-at-path ze lim dom ran) top r.p.rav) + =. +>.$ + ?: =(sar ear) +>.$ + =+ fud=(~(make-nako ze lim dom ran) u.nab top) (bleb hen u.nab fud) ?^ huy (blub hen) @@ -263,7 +263,7 @@ ++ edit :: apply changes |= [wen=@da lem=nori] ^+ +> - =+ axe=(~(axel ze lim dom ran) wen lem) + =+ axe=(~(edit ze lim dom ran) wen lem) =+ `[l=@da d=dome r=rang]`+<.axe +>.$(dom d, ran r) :: @@ -276,7 +276,7 @@ lat.ran %+ roll (~(tap in bar.nak) ~) =< .(yeb lat.ran) |= [sar=blob yeb=(map lobe blob)] - =+ zax=(zaax sar) + =+ zax=(blob-to-lobe sar) %+ ~(put by yeb) zax sar hut.ran %+ roll (~(tap in lar.nak) ~) =< .(yeb hut.ran) @@ -303,7 +303,8 @@ %- ~(got by hut.ran) %- ~(got by hit.dom) let.dom - =. ank.dom (~(azel ze lim dom ran) hed) :: real checkout + =. ank.dom :: real checkout + (~(checkout-ankh ze lim dom ran) hed) (echa:wake hen wen mer) :: notify or w/e :: ++ knit :: external change @@ -337,8 +338,9 @@ =+ nex=(~(get by haw.u.ref) nez) ?~ nex +>+.^$ ?~ u.nex +>+.^$ :: should never happen - =. +>+.^$ =+ roo=(edis ((hard nako) u.u.nex)) - ?>(?=(^ ref.roo) roo) + =. +>+.^$ + =+ roo=(edis ((hard nako) u.u.nex)) + ?>(?=(^ ref.roo) roo) %= $ haw.u.ref (~(del by haw.u.ref) nez) == @@ -370,33 +372,35 @@ ..wake ?~ u.cas (blub p.i.xiq) (blab p.i.xiq p.q.i.xiq u.u.cas) == - =+ nao=(~(aeon ze lim dom ran) q.p.q.i.xiq) + =+ nao=(~(case-to-aeon ze lim dom ran) q.p.q.i.xiq) ?~ nao $(xiq t.xiq, xaq [i.xiq xaq]) $(xiq t.xiq, ..wake (balk p.i.xiq u.nao p.q.i.xiq)) :: | =+ mot=`moot`p.q.i.xiq - =+ nab=(~(aeon ze lim dom ran) p.mot) + =+ nab=(~(case-to-aeon ze lim dom ran) p.mot) ?~ nab $(xiq t.xiq, xaq [i.xiq xaq]) - =+ huy=(~(aeon ze lim dom ran) q.mot) + =+ huy=(~(case-to-aeon ze lim dom ran) q.mot) ?~ huy =+ ptr=[%ud +(let.dom)] %= $ xiq t.xiq xaq [[p.i.xiq [%| ptr q.mot r.mot s.mot]] xaq] - ..wake =+ ear=(~(apax ze lim dom ran) let.dom r.p.q.i.xiq) + ..wake =+ ^= ear + (~(lobes-at-path ze lim dom ran) let.dom r.p.q.i.xiq) ?: =(s.p.q.i.xiq ear) ..wake - =+ fud=(~(gack ze lim dom ran) u.nab let.dom) - (bleb p.i.xiq let.dom ear) + =+ fud=(~(make-nako ze lim dom ran) u.nab let.dom) + (bleb p.i.xiq let.dom fud) == %= $ xiq t.xiq ..wake =- (blub:- p.i.xiq) - =+ ear=(~(apax ze lim dom ran) u.huy r.p.q.i.xiq) - ?: =(s.p.q.i.xiq ear) ..wake - =+ fud=(~(gack ze lim dom ran) u.nab u.huy) - (bleb p.i.xiq +(u.nab) ear) + =+ ^= ear + (~(lobes-at-path ze lim dom ran) u.huy r.p.q.i.xiq) + ?: =(s.p.q.i.xiq ear) (blub p.i.xiq) + =+ fud=(~(make-nako ze lim dom ran) u.nab u.huy) + (bleb p.i.xiq +(u.nab) fud) == == -- diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 5437ed8a1..232eb4bf8 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -773,69 +773,11 @@ == :: ^= fac - 0w89.wgGV4.jAl90.00003.sV4OG.IJjfa.1vYpi.gRxB9.3m6kA.dopig. - RxB93.m6kAd.opigR.xB93m.6kAdo.pigRx.B93m6.kAdop.igRxB.93m6k. - Adopi.gRxBf.vGSfy.m8hQj.T-DiD.7kqvH.vEpA3.3vH-C.in~Tq.l8U0n. - 1FVhj.w9E1A.NIF6w.4j9v~.VZ0~B.9flkB.IY90B.-ieSV.Ky8Q~.4~07s. - JcXFC.DtI-1.GGz-1.V-olV.g3wsv.ZCQM1.BJbVj.Vwiv0.uo7Gh.4qsxA. - 92ZYU.tJ5uH.yiIzV.FwvJR.UUq6z.cpKIG.Hck9v.qGDm1.PY2rM.itxLB. - fn0Bo.5DO8x.oO7KE.kYh-P.NiKp1.HT88j.Mu3ZK.ciKsU.TnlkV.0Zo77. - 12ciy.nY3dM.7nDnY.GVgGh.ZllpO.SFHFb.p1Ae0.uUpXV.eqFvS.pkBRl. - jv0MP.ilRHP.1HwtK.GFptt.2KdpP.RsYqI.wRHEG.j~LZQ.I06qJ.fP0Pp. - 77qjo.s0PU0.rGGg6.lgNvc.~CZE~.bSp9j.EGHF~.UqYB6.l4Y~Z.P~GGE. - LwrJs.ZvYV-.U4Wh4.04dws.6HeuZ.2ZF7A.y4MN5.3vsCj.QHzjW.4lflk. - WU6X0.AmMws.vbMfB.3e1s~.aeE7W.0hQPH.ODvMf.cvgzb.Y15Ah.01384. - YwVPT.KzILB.PlaqN.pNlvw.fdQ79.~mPpo.YaHqw.fnWGB.QYM4F.w3E0b. - 0o~n-.faydD.zlllI.0nU3D.w5rlI.4nrSG.VkhPM.NTkpa.eoXzw.9AEYN. - auZGt.99gxL.8RlsI.aXMXX.tFVhX.V4kj8.yczjh.faRI3.JTg1H.-0uZM. - JA6rR.z0~pO.uXiSg.rvU27.A58MU.TBijQ.23F1J.CCIYE.IO8w-.cMlMA. - hvKh4.zY16M.gjRlk.v--9h.TNNRR.HhIGo.8kZXk.Wb74j.faHlk.6V-Vw. - jMan8.yb37R.Q2h42.Or3Nw.Pp39w.jZ--3.-jwZH.U~3Za.Uu0u6.bNAOP. - U2jux.Jqo2R.O8x1~.ecZvL.30ug~.qpoFw.vwtqD.Vb6EI.cZQyO.EN-xl. - nlsLC.dT099.apOh5.SEeDz.07-GE.xFzZk.KcmCl.SJWF5.v3u1x.Uq1Cj. - tV~hG.YuGGb.SgpdR.xHaBh.S3eEv.q0mSg.RZh8s.wxhnk.EcNvW.GccZQ. - yO0Jb.n18hs.BLFx2.iigqf.AhsKS.LWqby.TUEmv.gmmhR.6DW3w.uLR0Y. - QQBC8.YoQ63.g8m8i.iq3B-.SxwLn.jLbh3.l7cq3.eVQmV.5O2df.SXBkv. - Y3LLb.denQq.GvR0R.P3Gh4.2iiq2.h-srW.o0ZZ-.HIrdj.npm5n.pnv07. - vyT77.43WGP.Bciiq.zt1cI.7A4xB.zK9xm.-tV6x.ZdA6P.pheXQ.aSz4X. - Zj2bS.C1UPx.~c1dS.xwF3b.6jZ-M.WI2eQ.e69Qw.DGFly.tTze-.GGbZU. - qJ-m-.fD8yI.Adktz.oqTsF.F7ltA.6no6T.~fWJU.0gRsp.-P88x.a9I9b. - Adkvz.ory8J.Ouhfu.H8c-U.2HLgE.Wi4xH.3AEGK.VjkS-.Z5hMx.UN5o~. - Y~EWp.7LGox.IQxpt.cgONH.CEyKJ.jjTdM.GJ9HL.RloJZ.xuRtL.JZ7jg. - ZZj6w.2AOoM.CENdS.xxegZ.RzTdh.i-1hZ.N1HPF.EqHU0.XzN6K.mBedG. - uvBiL.HqpmY.Bl9z2.qzqA8.WzKqz.h~S1J.K2QHQ.Dy-CM.7RO0l.QksW3. - mpFnx.fy-Pa.p7xhW.SboOd.fOBon.mCgSX.Z38Qe.dMHUC.79wje.wziG5. - 6Xtn7.ksEHO.xkBrO.e7yFe.vNaYx.FgDsI.BS9y8.AELs-.C9-DB.FAZI-. - wKt2N.8qQhA.Apxm7.O5yIB.X51l9.Kduxm.SRA5N.UYi6I.MrySX.RZXrT. - 8UcY2.zUAfu.SOcUK.vZrDL.vBAHb.eOo~N.7J3sR.eJhSo.4~YE1.5k0h5. - 51RqS.b0jyR.RfhON.4Dt07.idahL.5isLK.eeBv3.znQxC.9LXkE.xKghP. - Ia-R0.AgmB5.pGGIA.slCGu.CtR5q.NrzHh.1bscz.8CsWC.KH4it.LLrWm. - UlRdr.lUGji.W76xr.kVAmO.6oAYS.7nXX~.kfeM2.TSS2m.JOCAb.sFFWg. - 4xH3C.MDKh4.FZso1.tXwUJ.Taq5K.8yS24.xHr4M.Kvu~E.HTpka.-Zg3f. - KEXFS.qCKwh.l1KRN.c9H8A.HFcSw.rePCF.Iy93m.njkMZ.IEyiq.lFq3y. - gRFzg.uL9tz.zP8du.Y1ZWP.PtQ6G.gzIt5.K8hNz.UAdpM.Q43L6.IMHx5. - N8qPh.EfX8G.UC~68.S93ms.d18Vh.adkOx.GLkTI.khFcL.ZWG5G.Adoeh. - hx~As.hci6I.Uq2pG.ykqHO.yUAdq.gQ7FD.4sOjn.IwGGw.UAdqo.Q4jVN. - eJP8c.xQlm~.8nJ1y.gRF3g.oSPAM.fuqE0.M~23y.gRHyo.gngjF.ceM3n. - V~uQy.93m-9.xa-3N.T80~v.GzR-g.HqBGA.mi4xH.3AMOL.mCjT5.Blqab. - 60ruw.HDV~k.Tj~fX.Swx8u.ZFOoi.m1GUF.Gs4-q.0kfxh.H8yjt.OCXGL. - PYGTY.23LgI.Wl4x6.8bI3e.MXeVb.h6rL9.DXWyt.8wJ8W.HalWR.itqp3. - pkrSC.8bQSM.HLV2J.G7sCj.QtGEi.AkSwI.A4P0J.gJ85j.MuMUY.nkT45. - -rkqv.BFBFU.KGd98.qRs~A.iblOv.mVKWx.Z19cs.AxHc6.UIKJc.NIHW8. - EnOEy.fygRG.29bbR.FBDVL.Ter6T.SBKat.MFBPE.AfuO9.kBHV~.QstE-. - VaYNV.qpfhL.sFHj0.eFphG.U6Hw6.EsVox.7kpks.N6bRk.GMLY~.HWBVj. - Snx6X.0GY2b.GhzmW.udfRF.jTgLC.uPWGL.fIwM6.16Ah4.NFZjz.Ftln7. - KQ-k-.0SO8H.xrqcw.MXZG9.6BZsJ.zULJU.NPDy3.aewMa.3auiA.Ysei3. - YQJGB.PlCAQ.S5YPU.uGEtI.wQrw1.cy8Sd.bFYuX.GGWZS.DSq1Y.O8ELq. - cR6kA.dopig.RxB93.m6kAd.opigR.xB93m.6kAdo.pigRx.B93m6.kAdop. - igRxB.93m6k.Adopi.gRxB9.3m6kA.doSsI.1Tves.7Fb5l.hneus.VDLsZ. - ~P3DD.D~CpI.BALPA.rxSTT.fuXa4.gP3Yv.sPKOY.KSMKP.balqk.xjbEH. - idkbq.Elo0N.dHjkM.vEBiq.BC-Rb.IKMiB.JiaoS.x3mLy.Jr6P5.ToiS2. - gAz4y.qNHiI.k7WIl.9EJGb.iJ2Tp.NQ5H5.VpSni.By-OX.TfvYs.plRic. - rpPJD.7xkgk.h9BMw.001EY.XFJDs.CYKpn.1xoTd.HrCAK.tTtT0.6lOon. - tQpCZ.jt5x5.t1A00.01UCO.x20ts.d003n.3g00s.RB8s0.A0002.8p0xY. - 20w82.5h9gD.c4000.0l9ny.s0000.0o8p0.0006g.0001i.h4x93.g0000. - Eq2wR.7jB29 + 0w89wg.GV4jA.l9000.00dPb.YzBT6.giO00.o100d.wZcqc.a9tg-.VTG0b. + AUIvE.HBM3g.cK4SE.0aagi.l090p.I1P5g.Y-80r.y1YS9.1xE~Y.qgpFY. + vKN1V.905y0.2UwvL.43TUw.uL406.0-31h.xwoJF.Ul454.ilk00.00Yps. + BNumh.xpl9B.pS5Ji.i1BoC.ZAgg1.BsC5T.t6pLk.Thohn.gp000.0ov~P. + 7M000.0o840.00010.0001i.h4x93.g0000.Eq2wR.7jB29 == :: ++ huff :: request by ship @@ -1125,7 +1067,7 @@ ?> ?=(%way pez.u.pup) $(yov t.yov, q.rey (~(put by q.rey) i.yov u.pup(pez noz))) :: - ++ duty |= [our=ship nap=@ud you=ship orx=oryx] :: interface script + ++ duty |= [nap=@ud you=ship] :: interface script ^- cord %^ cat 3 %- crip @@ -1133,9 +1075,9 @@ :~ [%ship (jape |1:)] [%port (jone nap)] + [%oryx %s orx.ced] [%auto %b %&] [%user (jape |1:)] - [%oryx %s orx] == ''' window.urb.seqn_u = 0 @@ -2036,7 +1978,7 @@ ++ hark |= num=@ud ^- [(unit pimp) _+>] - =. +>.$ abet:(busk:(yule %nil) num _@ ~ %& %js !>((duty our nap you orx.ced))) + =. +>.$ abet:(busk:(yule %nil) num _@ ~ %& %js !>((duty nap you))) [`(need (~(get by q.rey) num)) +>.$] :: ++ harp diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 98fe28311..40aaa5cf4 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -438,7 +438,7 @@ ?. ?=([%$ ?(%da %ud %tas) *] a) ~ [~ u=(^case a)] :: - ++ hath (cook plex:voz (stag %clsg poor:voz)) :: hood path + ++ hath (sear plex:voz (stag %clsg poor:voz)) :: hood path ++ have (sear tome ;~(pfix fas hath)) :: hood beam ++ hood %+ ifix [gay gay] diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 87fa1d0a3..ccc7865b3 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -28,7 +28,8 @@ ++ axis ,@ :: tree address ++ also ,[p=term q=wing r=type] :: alias ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~ -++ bean ,? :: 0=&=yes, 1=|=no +++ bean ,? :: default to yes +++ bane $?(%| %&) :: default to no ++ beer $|(@ [~ p=twig]) :: simple embed ++ beet $| @ :: advanced embed $% [%a p=twig] :: diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index ef6151ec5..6ada5eaf2 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -996,7 +996,7 @@ :: section 3bE, tree sync :: :: :: -++ cure :: invert miso +++ invert-miso :: invert miso |= mis=miso ?- -.mis %del [%ins p.mis] @@ -1005,15 +1005,15 @@ == :: ++ cosh :: locally rehash - |= ank=ankh - ank(p dash:(zu ank)) + |= ank=ankh :: NB v/unix.c + ank(p rehash:(zu ank)) :: ++ cost :: new external patch - |= [bus=ankh ank=ankh] + |= [bus=ankh ank=ankh] :: NB v/unix.c ^- soba :- [p.ank p.bus] %- flop - myz:(dist:(zu ank) %c bus) + myz:(change-tree:(zu ank) %c bus) :: ++ loth |= pat=(map path ,*) @@ -1027,7 +1027,7 @@ ^- (set path) (~(uni in (loth p)) (loth q)) :: -++ zaax :: p.blob +++ blob-to-lobe :: p.blob |= p=blob ^- lobe ?- -.p @@ -1036,19 +1036,11 @@ %indirect p.p == :: -++ qeel :: trim ankh - |= p=ankh - ^- ankz - :- 0 - ^- (map ,@ta ankz) - %- ~(tur by r.p) - |= [pat=@ta ank=ankh] - ^- ankz - ^$(p ank) -:: ++ ze |_ [lim=@da dome rang] - ++ zoal :: make yaki + ++ aeon-to-tako ~(got by hit) + ++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki) + ++ make-yaki :: make yaki |= [p=(list tako) q=(map path lobe) t=@da] ^- yaki =+ ^= has @@ -1056,45 +1048,29 @@ (sham [%tako (roll p add) q t]) [p q has t] :: - ++ zaal :: grab blob - |= p=lobe :: (raw) - ^- blob - (~(got by lat) p) - :: - ++ zaul :: grab blob + ++ tako-to-yaki ~(got by hut) :: grab yaki + ++ lobe-to-blob ~(got by lat) :: grab blob + ++ lobe-to-noun :: grab blob |= p=lobe :: ^- * - %- zaru - (zaal p) + %- blob-to-noun + (lobe-to-blob p) :: - ++ zaru :: grab blob - |= p=blob - ?- -.p - %delta (lump r.p (zaul q.p)) - %direct q.p - %indirect q.p - == + ++ make-direct :: make blob + |= [p=* q=umph] + ^- blob + [%direct (mug p) p q] :: - ++ zeol :: make blob delta + ++ make-delta :: make blob delta |= [p=lobe q=udon] ^- blob =+ t=[%delta 0 p q] - =+ z=(zaru t) + =+ z=(blob-to-noun t) =+ ^= has %^ cat 7 (sham [%blob z]) (sham [%lobe z]) [%delta has p q] :: - ++ zeul :: make blob - |= [p=* q=umph] - ^- blob - [%direct (mug p) p q] - :: - ++ zamp :: grab yaki - |= p=tako - ^- yaki - (need (~(get by hut) p)) - :: - ++ zump :: blob umph [prep] + ++ blob-to-umph :: blob umph [prep] |= p=blob :: used in merge ^- umph ?- -.p @@ -1103,41 +1079,47 @@ %indirect p.r.p == :: + ++ blob-to-noun :: grab blob + |= p=blob + ?- -.p + %delta (lump r.p (lobe-to-noun q.p)) + %direct q.p + %indirect q.p + == :: :: :: - ++ zerg :: fundamental diff + ++ diff-yakis :: fundamental diff |= [p=yaki q=yaki] ^- (map path miso) %+ roll (~(tap in (luth q.p q.q)) ~) |= [pat=path yeb=(map path miso)] =+ leb=(~(get by q.p) pat) =+ lob=(~(get by q.q) pat) - ?~ leb (~(put by yeb) pat [%ins (zaul (need lob))]) - ?~ lob (~(put by yeb) pat [%del (zaul (need leb))]) + ?~ leb (~(put by yeb) pat [%ins (lobe-to-noun (need lob))]) + ?~ lob (~(put by yeb) pat [%del (lobe-to-noun (need leb))]) ?: =(u.leb u.lob) yeb - =+ veq=(zaal u.leb) - =+ voq=(zaal u.lob) + =+ veq=(lobe-to-blob u.leb) + =+ voq=(lobe-to-blob u.lob) %+ ~(put by yeb) pat :- %mut - ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff + ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff r.voq - =+ zeq=(zaru veq) - =+ zoq=(zaru voq) - ((diff (zump (zaal u.leb))) zeq zoq) + =+ zeq=(blob-to-noun veq) + =+ zoq=(blob-to-noun voq) + ((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq) :: - ++ apax :: apax:ze - |= [oan=@ud pax=path] :: data at path + ++ lobes-at-path :: lobes-at-path:ze + |= [yon=aeon pax=path] :: data at path ^- (map path lobe) - ?: =(0 oan) ~ + ?: =(0 yon) ~ %- mo %+ skim %. ~ %~ tap by =< q - %- ~(got by hut) - %- ~(got by hit) - oan + %- aeon-to-yaki + yon |= [p=path q=lobe] ?| ?=(~ pax) ?& !?=(~ p) @@ -1145,18 +1127,17 @@ $(p +.p, pax +.pax) == == :: - ++ aeon :: aeon:ze + ++ case-to-aeon :: case-to-aeon:ze |= lok=case :: act count through - ^- (unit ,@ud) + ^- (unit aeon) ?- -.lok %da ?: (gth p.lok lim) ~ - |- ^- (unit ,@ud) + |- ^- (unit aeon) ?: =(0 let) [~ 0] :: avoid underflow ?: %+ gte p.lok =< t - %- ~(got by hut) - %- ~(got by hit) + %- aeon-to-yaki let [~ let] $(let (dec let)) @@ -1165,7 +1146,7 @@ %ud ?:((gth p.lok let) ~ [~ p.lok]) == :: - ++ ache :: ache:ze + ++ as-arch :: as-arch:ze ^- arch :: arch report :+ p.ank ?~(q.ank ~ [~ p.u.q.ank]) @@ -1173,49 +1154,50 @@ ?~ r.ank ~ [[p.n.r.ank ~] $(r.ank l.r.ank) $(r.ank r.r.ank)] :: - ++ zule :: reachable - |= p=tako :: XX slow + ++ reachable-takos :: reachable + |= p=tako :: XX slow ^- (set tako) - =+ y=(~(got by hut) p) + =+ y=(tako-to-yaki p) =+ t=(~(put in _(set tako)) p) %+ roll p.y |= [q=tako s=_t] - ?: (~(has in s) q) :: already done - s :: hence skip - (~(uni in s) ^$(p q)) :: otherwise traverse + ?: (~(has in s) q) :: already done + s :: hence skip + (~(uni in s) ^$(p q)) :: otherwise traverse :: - ++ garg :: object hash set - |= [b=(set lobe) a=(set tako)] :: that aren't in b + ++ new-lobes :: object hash set + |= [b=(set lobe) a=(set tako)] :: that aren't in b ^- (set lobe) %+ roll (~(tap in a) ~) |= [tak=tako bar=(set lobe)] ^- (set lobe) - =+ yak=(need (~(get by hut) tak)) + =+ yak=(tako-to-yaki tak) %+ roll (~(tap by q.yak) ~) |= [[path lob=lobe] far=_bar] ^- (set lobe) - ?~ (~(has in b) lob) :: don't need + ?~ (~(has in b) lob) :: don't need far - =+ gar=(need (~(get by lat) lob)) + =+ gar=(lobe-to-blob lob) ?- -.gar %direct (~(put in far) lob) %delta (~(put in $(lob q.gar)) lob) %indirect (~(put in $(lob s.gar)) lob) == - ++ garf :: garg & repack + :: + ++ new-lobes-takos :: garg & repack |= [b=(set lobe) a=(set tako)] ^- [(set tako) (set lobe)] - [a (garg b a)] + [a (new-lobes b a)] :: - ++ pack - |= [a=(unit tako) b=tako] :: pack a through b + ++ reachable-between-takos + |= [a=(unit tako) b=tako] :: pack a through b ^- [(set tako) (set lobe)] =+ ^= sar ?~ a ~ - (zule r:(need (~(get by hut) u.a))) - =+ yak=`yaki`(need (~(get by hut) b)) - %+ garf (garg ~ sar) :: get lobes - |- ^- (set tako) :: walk onto sar + (reachable-takos r:(tako-to-yaki u.a)) + =+ yak=`yaki`(tako-to-yaki b) + %+ new-lobes-takos (new-lobes ~ sar) :: get lobes + |- ^- (set tako) :: walk onto sar ?: (~(has in sar) r.yak) ~ =+ ber=`(set tako)`(~(put in `(set tako)`~) `tako`r.yak) @@ -1224,73 +1206,72 @@ %+ roll p.yak |= [yek=tako bar=(set tako)] ^- (set tako) - ?: (~(has in bar) yek) :: save some time + ?: (~(has in bar) yek) :: save some time bar %- ~(uni in bar) - ^$(yak (need (~(get by hut) yek))) + ^$(yak (tako-to-yaki yek)) :: - ++ hack :: trivial - |= [a=(set tako) b=(set lobe)] - ^- [(set yaki) (set blob)] - :- %- sa %+ turn (~(tap by a) ~) - |= tak=tako - (need (~(get by hut) tak)) - %- sa %+ turn (~(tap by b) ~) - |= lob=lobe - (need (~(get by lat) lob)) + ++ takos-to-yakis :: trivial + |= a=(set tako) + ^- (set yaki) + (sa (turn (~(tap by a)) tako-to-yaki)) :: - ++ gack :: gack a through b - |= [a=@ud b=@ud] - ^- [(map ,@ud tako) @ud (set yaki) (set blob)] + ++ lobes-to-blobs :: trivial + |= a=(set lobe) + ^- (set blob) + (sa (turn (~(tap by a)) lobe-to-blob)) + :: + ++ make-nako :: gack a through b + |= [a=aeon b=aeon] + ^- [(map aeon tako) aeon (set yaki) (set blob)] :_ :- b - %- hack - %+ pack - (~(get by hit) a) :: if a not found, a=0 - %- need (~(get by hit) b) - ^- (map ,@ud tako) + =- [(takos-to-yakis -<) (lobes-to-blobs ->)] + %+ reachable-between-takos + (~(get by hit) a) :: if a not found, a=0 + (aeon-to-tako b) + ^- (map aeon tako) %- mo %+ skim (~(tap by hit) ~) - |= [p=@ud *] + |= [p=aeon *] &((gth p a) (lte p b)) :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: - ++ amor :: amor:ze + ++ query :: query:ze |= ren=?(%u %v %x %y %z) :: endpoint query ^- (unit ,*) ?- ren - %u [~ `rang`+<+>.amor] - %v [~ `dome`+<+<.amor] + %u [~ `rang`+<+>.query] + %v [~ `dome`+<+<.query] %x ?~(q.ank ~ [~ q.u.q.ank]) - %y [~ ache] + %y [~ as-arch] %z [~ ank] == :: - ++ argo :: argo:ze - |= oan=@ud :: rewind to aeon + ++ rewind :: rewind:ze + |= yon=aeon :: rewind to aeon ^+ +> - ?: =(let oan) +> - ?: (gth oan let) !! :: don't have this version - +>(ank (azel q:(~(got by hut) (~(got by hit) oan))), let oan) + ?: =(let yon) +> + ?: (gth yon let) !! :: don't have version + +>(ank (checkout-ankh q:(aeon-to-yaki yon)), let yon) :: :::: - ++ aqel :: aqel:ze - |= [lag=(map path blob) sta=(map lobe blob)] :: fix lat - ^- [(map lobe blob) (map path lobe)] - %+ roll (~(tap by lag) ~) - |= [[pat=path bar=blob] [lut=_sta gar=(map path lobe)]] - ?~ (~(has by lut) p.bar) - [lut (~(put by gar) pat p.bar)] - :- (~(put by lut) p.bar bar) - (~(put by gar) pat p.bar) + ++ update-lat :: update-lat:ze + |= [lag=(map path blob) sta=(map lobe blob)] :: fix lat + ^- [(map lobe blob) (map path lobe)] + %+ roll (~(tap by lag) ~) + |= [[pat=path bar=blob] [lut=_sta gar=(map path lobe)]] + ?~ (~(has by lut) p.bar) + [lut (~(put by gar) pat p.bar)] + :- (~(put by lut) p.bar bar) + (~(put by gar) pat p.bar) :: - ++ azal :: azal:ze + ++ apply-changes :: apply-changes:ze |= lar=(list ,[p=path q=miso]) :: store changes ^- (map path blob) =+ ^= hat :: current state ?: =(let 0) :: initial commit ~ :: has nothing =< q - %- need %- ~(get by hut) - %- need %- ~(get by hit) + %- aeon-to-yaki let %- |= bar=(map path blob) :: find unchanged =+ sar=(sa (turn lar |=([p=path *] p))) :: changed paths @@ -1298,7 +1279,7 @@ |= [[pat=path gar=lobe] bat=_bar] ?: (~(has in sar) pat) :: has update bat - (~(put by bat) pat (need (~(get by lat) gar))) :: use original + (~(put by bat) pat (lobe-to-blob gar)) :: use original %+ roll lar |= [[pat=path mys=miso] bar=(map path blob)] ^+ bar @@ -1306,7 +1287,7 @@ %ins :: insert if not exist ?: (~(has by bar) pat) !! :: ?: (~(has by hat) pat) !! :: - (~(put by bar) pat (zeul p.mys %c)) :: TODO content type? + (~(put by bar) pat (make-direct p.mys %c)) :: TODO content type? %del :: delete if exists ?. |((~(has by hat) pat) (~(has by bar) pat)) !! (~(del by bar) pat) @@ -1316,11 +1297,11 @@ =+ har=(~(get by hat) pat) ?~ har !! %+ ~(put by bar) pat - (zeol u.har p.mys) + (make-delta u.har p.mys) %+ ~(put by bar) pat - (zeol p.u.ber p.mys) + (make-delta p.u.ber p.mys) == - ++ azel :: azel:ze + ++ checkout-ankh :: checkout-ankh:ze |= hat=(map path lobe) :: checkout commit ^- ankh %- cosh @@ -1329,7 +1310,7 @@ ^- ankh %- cosh ?~ pat - =+ zar=(zaul bar) + =+ zar=(lobe-to-noun bar) ank(q [~ (sham zar) zar]) =+ nak=(~(get by r.ank) i.pat) %= ank @@ -1337,31 +1318,32 @@ $(pat t.pat, ank (fall nak _ankh)) == :: - ++ azol :: azol:ze + ++ forge-yaki :: forge-yaki:ze |= [wen=@da par=(unit tako) lem=soba] :: forge yaki =+ ^= per ?~ par ~ ~[u.par] - =+ gar=(aqel (azal q.lem) lat) - :- %^ zoal per +.gar wen :: from existing diff + =+ gar=(update-lat (apply-changes q.lem) lat) + :- %^ make-yaki per +.gar wen :: from existing diff -.gar :: fix lat :: - ++ azul :: azul:ze + ++ forge-nori :: forge-nori:ze |= yak=yaki :: forge nori (ugly op) ^- nori :: basically zerg w/ nori ?~ p.yak !! :: no parent -> can't diff - [%& [*cart (~(tap by (zerg (zamp i.p.yak) yak)) ~)]]:: diff w/ 1st parent + :+ %& *cart :: diff w/ 1st parent + (~(tap by (diff-yakis (tako-to-yaki i.p.yak) yak)) ~) :: :: graph algorithms (bottleneck) :: - ++ zear :: reduce merge points + ++ reduce-merge-points :: reduce merge points |= unk=(set yaki) :: maybe need jet =| gud=(set yaki) =+ ^= zar ^- (map tako (set tako)) %+ roll (~(tap in unk) ~) |= [yak=yaki qar=(map tako (set tako))] - (~(put by qar) r.yak (zule r.yak)) + (~(put by qar) r.yak (reachable-takos r.yak)) |- ^- (set yaki) ?~ unk gud @@ -1375,10 +1357,10 @@ $(gud (~(put in gud) tek), unk bun) $(unk bun) :: - ++ zeas :: merge points fast + ++ future-find-merge-points :: merge points fast |= [p=yaki q=yaki] :: (future zeal) ^- (set yaki) :: zear still uses zule - %- zear :: this is test-only + %- reduce-merge-points :: this is test-only =+ s=(~(put in _(set tako)) r.p) :: not actually used =+ t=(~(put in _(set tako)) t.p) :: but might be active =| u=(set yaki) :: eventually @@ -1390,39 +1372,37 @@ |= [tak=tako bar=_s zar=_t] [(~(del in bar) tak) (~(del in zar) tak)] ?: &(=(~ s.qez) =(~ s.qez)) - (~(uni in u) (zeaz v)) - $(u (~(uni in u) (zeaz v)), s (zeat s.qez), t (zeat t.qez)) + (~(uni in u) (takos-to-yakis v)) + %= $ + u (~(uni in u) (takos-to-yakis v)) + s (add-parents s.qez) + t (add-parents t.qez) + == :: - ++ zeaz - |= qez=(set tako) - ^- (set yaki) - %- sa %+ turn (~(tap in qez) ~) - |= tak=tako - (~(got by hut) tak) - ++ zeat :: expand set + ++ add-parents :: expand set |= qez=(set tako) ^- (set tako) %+ roll (~(tap in qez) ~) |= [tak=tako zar=(set tako)] %- ~(uni in (~(put in zar) tak)) - (sa p:(~(got by hut) tak)) + (sa p:(tako-to-yaki tak)) :: - ++ zeal :: merge points + ++ find-merge-points :: merge points |= [p=yaki q=yaki] :: maybe need jet ^- (set yaki) - %- zear - =+ r=(zule r.p) + %- reduce-merge-points + =+ r=(reachable-takos r.p) |- ^- (set yaki) ?: (~(has in r) q) (~(put in _(set yaki)) q) :: done %+ roll p.q |= [t=tako s=(set yaki)] ?: (~(has in r) t) - (~(put in s) (~(got by hut) t)) :: found - (~(uni in s) ^$(q (~(got by hut) t))) :: traverse + (~(put in s) (tako-to-yaki t)) :: found + (~(uni in s) ^$(q (tako-to-yaki t))) :: traverse :: :: merge logic :: - ++ qael :: clean + ++ clean :: clean |= wig=(urge) ^- (urge) ?~ wig ~ @@ -1435,28 +1415,19 @@ $(wig [[%| (welp p.i.wig p.i.t.wig) (welp q.i.wig q.i.t.wig)] t.t.wig]) [i.wig $(wig t.wig)] :: - ++ qaul :: check no delete - |= wig=(urge) - ^- ? - ?~ wig %.y - ?- -.i.wig - %& %.n - %| ?: =(p.i.wig 0) - $(wig t.wig) - %.n - == - ++ quax :: match conflict + ++ match-conflict :: match conflict |= [us=[ship desk] th=[ship desk] p=(urge) q=(urge) r=(list)] ^- [p=[p=(list) q=(list)] q=[p=(urge) q=(urge) r=(list)]] =+ cas=(hard (list ,@t)) =+ cat=(hard (urge ,@t)) - =+ mar=(qear (cat p) (cat q) (cas r)) + =+ mar=(match-merge (cat p) (cat q) (cas r)) :- :- s.q.mar - (quis us th p.p.mar q.p.mar s.q.mar) :: annotation + (annotate us th p.p.mar q.p.mar s.q.mar) :: annotation :- p.q.mar :- q.q.mar r.q.mar - ++ quis :: annotate conflict + :: + ++ annotate :: annotate conflict |= [us=[ship desk] th=[ship desk] p=(list ,@t) q=(list ,@t) r=(list ,@t)] ^- (list ,@t) %- zing @@ -1482,11 +1453,17 @@ +.th ~ :: - ++ qear :: match merge + ++ match-merge :: match merge |= [p=(urge ,@t) q=(urge ,@t) r=(list ,@t)] :: resolve conflict =| s=[p=(list ,@t) q=(list ,@t)] :: p chunk =| t=[p=(list ,@t) q=(list ,@t)] :: q chunk - |- ^- [p=[p=(list ,@t) q=(list ,@t)] q=[p=(urge ,@t) q=(urge ,@t) r=(list ,@t) s=(list ,@t)]] + |- ^- $: p=[p=(list ,@t) q=(list ,@t)] + $= q + $: p=(urge ,@t) + q=(urge ,@t) + r=(list ,@t) + s=(list ,@t) + == == ?~ p [[q.s q.t] p q r p.s] :: can't be conflict ?~ q [[q.s q.t] p q r p.s] :: can't be conflict ?- -.i.p @@ -1527,7 +1504,8 @@ ?. (lth (lent p.i.p) (lent p.i.q)) =+ mar=$(p q, q p, s t, t s) :: swap recursion [[q.p.mar p.p.mar] q.q.mar p.q.mar r.q.mar s.q.mar] - ?> =((slag (sub (lent p.i.q) (lent p.i.p)) p.i.q) p.i.p) :: sane conflict + ?> .= p.i.p :: sane conflict + (slag (sub (lent p.i.q) (lent p.i.p)) p.i.q) %= $ :: extend p p t.p p.s (welp p.i.p p.s) @@ -1547,8 +1525,8 @@ ?> ?=(%mut -.q) ?> ?=(%c -.q.p.p) ?> ?=(%c -.q.p.q) - =+ s=(qael p.q.p.p) - =+ t=(qael p.q.p.q) + =+ s=(clean p.q.p.p) + =+ t=(clean p.q.p.q) :- %mut :- %c :: todo is this p.p.p? :- %c @@ -1576,7 +1554,7 @@ $(t t.t, p.i.s (sub p.i.s (lent p.i.t)), r (slag (lent p.i.t) r)) ?. con ~| %quil-conflict !! :: conflict ~& [%quil-conflict-soft pat] - =+ mar=(quax us th s t r) + =+ mar=(match-conflict us th s t r) [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] == %| @@ -1584,21 +1562,29 @@ %| ?. con ~| %quil-conflict !! ~& [%quil-conflict-soft pat] - =+ mar=(quax us th s t r) + =+ mar=(match-conflict us th s t r) [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] %& ?: =(p.i.t (lent p.i.s)) [i.s $(s t.s, t t.t, r (slag p.i.t r))] ?: (gth p.i.t (lent p.i.s)) - [i.s $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r))] + :- i.s + $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r)) ?. con ~| %quil-conflict !! ~& [%quil-conflict-soft pat] - =+ mar=(quax us th s t r) + =+ mar=(match-conflict us th s t r) [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] == == ++ quil :: merge p,q - |= [us=[ship desk] th=[ship desk] pat=path p=(unit miso) q=(unit miso) r=(unit (list)) con=?] + |= $: us=[ship desk] + th=[ship desk] + pat=path + p=(unit miso) + q=(unit miso) + r=(unit (list)) + con=? + == ^- (unit miso) ?~ p q :: trivial ?~ q p :: trivial @@ -1608,7 +1594,7 @@ %- some :- %ins %- roly - %- quis + %- annotate :- us :- th :- (lore ((hard ,@) p.u.p)) @@ -1626,8 +1612,8 @@ ++ meld :: merge p,q from r |= [p=yaki q=yaki r=yaki con=? us=[ship desk] th=[ship desk]] ^- (map path blob) - =+ s=(zerg r p) - =+ t=(zerg r q) + =+ s=(diff-yakis r p) + =+ t=(diff-yakis r q) =+ lut=(luth s t) %- |= res=(map path blob) :: add old ^- (map path blob) @@ -1638,7 +1624,7 @@ |= [pat=path bar=lobe] ^- ? (~(has in lut) pat) :: skip updated |= [pat=path bar=lobe] ^- [path blob] - [pat (zaal bar)] :: lookup objects + [pat (lobe-to-blob bar)] :: lookup objects %+ roll (~(tap in (luth s t)) ~) |= [pat=path res=(map path blob)] =+ ^= v @@ -1650,20 +1636,20 @@ :_ con %- %- lift lore %- %- lift %- hard ,@ :: for %c - %- %- lift zaul + %- %- lift lobe-to-noun %- ~(get by q.r) pat ?- -.v %del res :: no longer exists %ins :: new file %+ ~(put by res) pat - %+ zeul p.v %c :: TODO content type? + %+ make-direct p.v %c :: TODO content type? %mut :: patch from r %+ ~(put by res) pat - %- zeul + %- make-direct :_ %c %+ lump p.v - %- zaul + %- lobe-to-noun %- ~(got by q.r) pat == :: @@ -1673,7 +1659,7 @@ |= con=? :: %mate, %meld |= [p=yaki q=yaki us=[ship desk] th=[ship desk]] ^- (map path blob) - =+ r=(~(tap in (zeal p q)) ~) + =+ r=(~(tap in (find-merge-points p q)) ~) ?~ r ~|(%mate-no-ancestor !!) ?: =(1 (lent r)) @@ -1686,7 +1672,7 @@ %+ roll (~(tap by q.p) ~) |= [[pat=path lob=lobe] zar=(map path blob)] ^- (map path blob) - (~(put by zar) pat (zaal lob)) + (~(put by zar) pat (lobe-to-blob lob)) :: ++ drop :: %that |= [p=yaki q=yaki r=[ship desk] s=[ship desk]] @@ -1696,29 +1682,29 @@ ++ forge :: %forge |= [p=yaki q=yaki s=[ship desk] t=[ship desk]] ^- (map path blob) - =+ r=(~(tap in (zeal p q)) ~) + =+ r=(~(tap in (find-merge-points p q)) ~) ?~ r ~|(%forge-no-ancestor !!) %- |= [r=yaki lut=(map lobe blob) hat=(map tako yaki)] =. lat lut =. hut hat - (meld p q r & s t) :: fake merge + (meld p q r & s t) :: fake merge %+ roll t.r :: fake ancestor |= [par=yaki [for=_i.r lut=_lat hat=_hut]] =. lat lut =+ ^= far ^- (map path lobe) %- ~(tur by (forge par for s t)) - |= [k=path v=blob] (zaax v) - =+ u=(zoal [r.par r.for ~] far `@da`0) :: fake yaki + |= [k=path v=blob] (blob-to-lobe v) + =+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki :- u :_ (~(put by hat) r.u u) =< - - %- aqel + %- update-lat :_ ~ %- ~(tur by q.u) |= [path k=lobe] - (zaal k) + (lobe-to-blob k) :: :: actual merge :: @@ -1731,11 +1717,11 @@ ^- (map path lobe) %+ roll (~(tap by u) ~) |= [[pat=path bar=blob] yeb=(map path lobe)] - (~(put by yeb) pat (zaax bar)) + (~(put by yeb) pat (blob-to-lobe bar)) :_ u - (zoal [r.p r.q ~] t r) + (make-yaki [r.p r.q ~] t r) :: - ++ strat :: merge strat + ++ strategy :: merge strategy |= gem=?(%meld %mate %that %this) ?- gem %meld (mate %.y) @@ -1744,7 +1730,7 @@ %that drop == :: - ++ auld :: auld:ze + ++ construct-merge :: construct-merge:ze |= [gem=germ who=ship des=desk sab=saba now=@da] :: construct merge ^- (unit (unit mizu)) :::::: =+ for=s.sab :: foreign dome @@ -1753,68 +1739,63 @@ %init :: force fine ?. =(let 0) :: hell no !! - =+ hot=(~(put by _(map ,@ud tako)) 1 (~(got by hit.for) let.for)) + =+ hot=(~(put by _(map aeon tako)) 1 (~(got by hit.for) let.for)) [~ [~ [1 hot hut lat]]] :: trivial %fine =+ der=(~(got by hit.for) let.for) =+ owr=(~(got by hit) let) ?: =(der owr) [~ ~] - ?: (~(has in (zule owr)) der) + ?: (~(has in (reachable-takos owr)) der) [~ ~] - ?. (~(has in (zule der)) owr) + ?. (~(has in (reachable-takos der)) owr) ~ :: not a fast forward ~& [%merge-fine p.sab q.sab] [~ [~ [+(let) (~(put by hit) +(let) der) hut lat]]] ?(%mate %that %this %meld) - =+ foreign-head=(~(got by hut) (~(got by hit.for) let.for)) - =+ our-head=(~(got by hut) (~(got by hit) let)) + =+ foreign-head=(tako-to-yaki (~(got by hit.for) let.for)) + =+ our-head=(tako-to-yaki (~(got by hit) let)) ?: =(r.foreign-head r.our-head) [~ ~] :: up to date - ?: (~(has in (zule r.our-head)) r.foreign-head) + ?: (~(has in (reachable-takos r.our-head)) r.foreign-head) [~ ~] :: up to date - ?: &(|(=(gem %mate) =(gem %meld)) (~(has in (zule r.foreign-head)) r.our-head)) + ?: ?& |(=(gem %mate) =(gem %meld)) + (~(has in (reachable-takos r.foreign-head)) r.our-head) + == $(gem %fine) :: use fast forward - =+ gar=(mer our-head foreign-head now (strat gem)) + =+ gar=(mer our-head foreign-head now (strategy gem)) =+ yak=-.gar =+ hek=+.gar - =. lat -:(aqel hek ~) :: add new blobs + =. lat -:(update-lat hek ~) :: add new blobs =. hut (~(put by _(map tako yaki)) r.yak yak) =. let +(let) - =. hit (~(put by _(map ,@ud tako)) let r.yak) + =. hit (~(put by _(map aeon tako)) let r.yak) [~ [~ [let hit hut lat]]] == :: - ++ auto :: auto:ze + ++ read :: read:ze |= mun=mood :: read at point ^- (unit) ?: ?=(%v p.mun) - [~ `dome`+<+<.auto] + [~ `dome`+<+<.read] ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) ?^(r.mun ~ [~ let]) ?: ?=(%w p.mun) =+ ^= yak - %- ~(got by hut) - %- ~(got by hit) + %- aeon-to-yaki let - ?^(r.mun ~ [~ [t.yak (azul yak)]]) - ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] - (amor(ank ank:(deny:(zu ank) r.mun)) p.mun) + ?^(r.mun ~ [~ [t.yak (forge-nori yak)]]) + ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] + (query(ank ank:(descend-path:(zu ank) r.mun)) p.mun) :: - ++ aver :: aver:ze - |= mun=mood :: direct read - ^- (unit (unit ,*)) - =+ nao=(aeon q.mun) - ?~(nao ~ [~ (avid u.nao mun)]) - :: - ++ avid :: avid:ze - |= [oan=@ud mun=mood] :: seek and read + ++ read-at-aeon :: read-at-aeon:ze + |= [yon=aeon mun=mood] :: seek and read ^- (unit) ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed - ?^(r.mun ~ [~ oan]) - (auto:(argo oan) mun) + ?^(r.mun ~ [~ yon]) + (read:(rewind yon) mun) :: - ++ equi :: test paths + ++ equiv :: test paths |= [p=(map path lobe) q=(map path lobe)] ^- ? %- |= qat=? @@ -1830,33 +1811,31 @@ ?. eq %.n =+ zat=(~(get by q) pat) ?~ zat %.n - =((zaul u.zat) (zaul lob)) + =((lobe-to-noun u.zat) (lobe-to-noun lob)) :: - ++ axel :: axel:ze + ++ edit :: edit:ze |= [wen=@da lem=nori] :: edit ^+ +> ?- -.lem & =+ ^= yet - %+ azol wen + %+ forge-yaki wen ?: =(let 0) :: initial import [~ q.lem] - [(some r:(need (~(get by hut) (need (~(get by hit) let))))) q.lem] + [(some r:(aeon-to-yaki let)) q.lem] =+ yak=-.yet =. lat +.yet :: merge objects - ?. |(=(0 let) !=((lent p.yak) 1) !(equi q.yak q:(need (~(get by hut) (need (~(get by hit) let)))))) + ?. ?| =(0 let) + !=((lent p.yak) 1) + !(equiv q.yak q:(aeon-to-yaki let)) + == +>.$ :: silently ignore =: let +(let) hit (~(put by hit) +(let) r.yak) hut (~(put by hut) r.yak yak) == - +>.$(ank (azel q.yak)) + +>.$(ank (checkout-ankh q.yak)) | +>.$(lab ?<((~(has by lab) p.lem) (~(put by lab) p.lem let))) == - :: - ++ axon :: axon:ze - |= nyp=soba :: apply changes - ^+ +> - +>(ank ank:(durn:(zu ank) nyp)) -- :: ++ zu :: filesystem @@ -1864,7 +1843,7 @@ =| myz=(list ,[p=path q=miso]) :: changes in reverse =| ram=path :: reverse path into |% - ++ dash :: local rehash + ++ rehash :: local rehash ^- cash %+ mix ?~(q.ank 0 p.u.q.ank) =+ axe=1 @@ -1876,8 +1855,8 @@ $(r.ank r.r.ank, axe (peg axe 3)) == :: - ++ dosh %_(. p.ank dash) :: rehash and save - ++ dose :: ascend + ++ update-hash %_(. p.ank rehash) :: rehash and save + ++ ascend :: ascend |= [lol=@ta kan=ankh] ^+ +> ?> &(?=(^ ram) =(lol i.ram)) @@ -1890,61 +1869,61 @@ kan(r (~(put by r.kan) lol ank)) == :: - ++ deaf :: add change + ++ push-change :: add change |= mis=miso ^+ +> +>(myz [[(flop ram) mis] myz]) :: - ++ dent :: descend + ++ descend :: descend |= lol=@ta ^+ +> =+ you=(~(get by r.ank) lol) +>.$(ram [lol ram], ank ?~(you [*cash ~ ~] u.you)) :: - ++ deny :: descend recursively + ++ descend-path :: descend recursively |= way=path ^+ +> - ?~(way +> $(way t.way, +> (dent i.way))) + ?~(way +> $(way t.way, +> (descend i.way))) :: - ++ dest :: write over + ++ overwrite :: write over |= [pum=umph val=(unit ,[p=cash q=*])] ^+ +> ?~ q.ank ?~ val +> - (deaf %ins q.u.val) + (push-change %ins q.u.val) ?~ val - (deaf %del q.u.q.ank) + (push-change %del q.u.q.ank) ?: =(q.u.val q.u.q.ank) +> - (deaf %mut ((diff pum) q.u.q.ank q.u.val)) + (push-change %mut ((diff pum) q.u.q.ank q.u.val)) :: - ++ dist :: modify tree + ++ change-tree :: modify tree |= [pum=umph bus=ankh] ^+ +> - =. +> (dest pum q.bus) + =. +> (overwrite pum q.bus) =+ [yeg=(~(tap by r.ank) ~) gey=(~(tap by r.bus) ~)] =. +>.$ |- ^+ +>.^$ ?~ yeg +>.^$ ?: (~(has by r.bus) p.i.yeg) $(yeg t.yeg) - $(yeg t.yeg, myz myz:dirk(ank q.i.yeg, ram [p.i.yeg ram])) + $(yeg t.yeg, myz myz:rm-r(ank q.i.yeg, ram [p.i.yeg ram])) |- ^+ +>.^$ ?~ gey +>.^$ - $(gey t.gey, myz myz:^$(bus q.i.gey, +> (dent p.i.gey))) + $(gey t.gey, myz myz:^$(bus q.i.gey, +> (descend p.i.gey))) :: - ++ dirk :: rm -r + ++ rm-r :: rm -r |- ^+ + - =. + ?~(q.ank + (deaf %del q.u.q.ank)) + =. + ?~(q.ank + (push-change %del q.u.q.ank)) =+ dyr=(~(tap by r.ank) ~) |- ^+ +.^$ ?~ dyr +.^$ - =. +.^$ dirk:(dent p.i.dyr) + =. +.^$ rm-r:(descend p.i.dyr) $(dyr t.dyr) :: ++ drum :: apply effect - |= [pax=path mis=miso] + |= [pax=path mis=miso] :: XX unused (++dune) ^+ +> ?^ pax - dosh:(dose:$(pax t.pax, +> (dent i.pax)) i.pax ank) + update-hash:(ascend:$(pax t.pax, +> (descend i.pax)) i.pax ank) ~| %clay-fail ?- -.mis %del @@ -1964,13 +1943,13 @@ == :: ++ dune :: apply - |- ^+ + + |- ^+ + :: XX unused (++durn) ?~ myz + => .(+ (drum p.i.myz q.i.myz)) $(myz ?>(?=(^ myz) t.myz)) :: ++ durn :: apply forward - |= nyp=soba + |= nyp=soba :: XX unused ^+ +> ?: =([0 0] p.nyp) dune(myz q.nyp) @@ -2741,13 +2720,14 @@ ++ pac _@uvG :: default passcode ++ pub *pass :: public key ++ sec *ring :: private key - -- + -- :: ++ nu ^? :: reconstructors |% ++ pit |=([a=@ b=@] ^?(..nu)) :: from [width seed] ++ nol |=(a=@ ^?(..nu)) :: from naked ring ++ com |=(a=@ ^?(..nu)) :: from naked pass - -- - -- + -- :: + -- :: +++ aeon ,@ud :: ++ agon (map ,[p=ship q=desk] ,[p=@ud q=@ud r=waks]) :: mergepts ++ ankh :: fs node (new) $: p=cash :: recursive hash diff --git a/main/app/chat/core.hook b/main/app/chat/core.hook index 7ad80c241..e9612fd5f 100644 --- a/main/app/chat/core.hook +++ b/main/app/chat/core.hook @@ -130,9 +130,9 @@ == :: ++ pour - |= [ost=bone pax=path sih=*] + |= [ost=bone pax=path sih=sign] ^- [(list move) _+>] - =+ sih=((hard sign) sih) + :: =+ sih=((hard sign) sih) :: ~& [%chat-pour sih] ?. ?=([@ *] pax) ~& %chat-pour-strange-path !! ?> ?=(%g -.sih) diff --git a/main/bin/update.hoon b/main/bin/update.hoon index efca0a306..07bef22c4 100644 --- a/main/bin/update.hoon +++ b/main/bin/update.hoon @@ -25,7 +25,7 @@ |= [der=dome owr=dome des=desk] ^- gift =+ sab=`saba`[bos des [0 let.der] der] - =+ lum=`(unit (unit mizu))`(~(auld ze est owr ran) gem who des sab est) + =+ lum=`(unit (unit mizu))`(~(construct-merge ze est owr ran) gem who des sab est) ?~ lum ^- gift :^ %la %rose [": " "" ""] diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index d1db462f2..5ba5770bd 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -49,8 +49,6 @@ to clay is stored in this state. `fat` is the set of domestic servers. This stores all the information that is specfic to a particular ship on this pier. The keys to this map are the ships on the current pier. - -`hoy` is the set of foreign servers that we know anything about. This stores all the information that is specific to a particular foreign ship. The keys to this map are all the ships whose filesystems we have attempted to access through clay. @@ -123,6 +121,16 @@ these ducts. The values are a description of the requested information. This represents a subscription request for a desk. The request can be for either a single item in the desk or else for a range of changes on the desk. +###`++rove`, stored general subscription request + +``` +++ rove (each mood moot) :: stored request +``` + +When we store a request, we store subscriptions with a little extra information +so that we can determine whether new versions actually affect the path we're +subscribed to. + ###`++mood`, single subscription request ``` @@ -136,12 +144,23 @@ specifies the path we are requesting. ###`++moat`, range subscription request ``` -++ moat ,[p=case q=case] :: change range +++ moat ,[p=case q=case r=path] :: change range ``` -This represents a request for all changes between `p` and `q`. Note that there -is currently no way to request to be notified only on changes to particular -paths in the filesystem. You must subscribe to the entire desk. +This represents a request for all changes between `p` and `q` on path `r`. You +will be notified when a change is made to the node referenced by the path or to +any of its children. + +###`++moot`, stored range subscription request + +``` +++ moot ,[p=case q=case r=path s=(map path lobe)] :: +``` + +This is just a `++moat` plus a map of paths to lobes. This map represents the +data at the node referenced by the path at case `p`, if we've gotten to that +case (else null). We only send a notification along the subscription if the +data at a new revision is different than it was. ###`++care`, clay submode @@ -613,7 +632,8 @@ subscription). `r.p` is the desk. `q` is the path to the filesystem node. ``` This is the data that is produced by a request for a range of revisions of a -desk. +desk. This allows us to easily keep track of a remote repository -- all the +new information we need is contained in the `nako`. `gar` is a map of the revisions in the range to the hash of the commit at that revision. These hashes can be used with `hut:rang` to find the commit @@ -932,9 +952,8 @@ actually try to read the data. !! =+ ezy=?~(ref ~ (~(get by haw.u.ref) mun)) ?^ ezy ezy - =+ nao=(~(aeon ze lim dom ran) q.mun) - :: ~& [%aver-mun nao [%from syd lim q.mun]] - ?~(nao ~ [~ (~(avid ze lim dom ran) u.nao mun)]) + =+ nao=(~(case-to-aeon ze lim dom ran) q.mun) + ?~(nao ~ [~ (~(read-at-aeon ze lim dom ran) u.nao mun)]) ``` We check immediately that we're not requesting the `rang` for any time other @@ -949,21 +968,21 @@ specified by the given case, and then we try to get the data there. Here, we jump into `arvo/zuse.hoon`, which is where much of the algorithmic code is stored, as opposed to the clay interface, which is stored in -`arvo/clay.hoon`. We examine `++aeon:ze`. +`arvo/clay.hoon`. We examine `++case-to-aeon:ze`. ``` - ++ aeon :: aeon:ze + ++ case-to-aeon :: case-to-aeon:ze |= lok=case :: act count through - ^- (unit ,@ud) + ^- (unit aeon) ?- -.lok %da ?: (gth p.lok lim) ~ - |- ^- (unit ,@ud) + |- ^- (unit aeon) ?: =(0 let) [~ 0] :: avoid underflow ?: %+ gte p.lok =< t - %- ~(got by hut) - %- ~(got by hit) + %- tako-to-yaki + %- aeon-to-tako let [~ let] $(let (dec let)) @@ -976,7 +995,7 @@ code is stored, as opposed to the clay interface, which is stored in We handle each type of `case` differently. The latter two types are easy. If we're requesting a revision by label, then we simply look up the requested -label in `lab` from the given dome. If it exists, that is our number; else we +label in `lab` from the given dome. If it exists, that is our aeon; else we produce null, indicating the requested revision does not yet exist. If we're requesting a revision by number, we check if we've yet reached that @@ -988,30 +1007,42 @@ scan backwards until we find the first revision committed before that date, and we produce that. If we requested a date before any revisions were committed, we produce `0`. -Assuming we got a valid version number, `++aver` calls `++avid:ze`, which reads -the requested data at the given revision. +The definitions of `++aeon-to-tako` and `++tako-to-yaki` are trivial. ``` - ++ avid :: avid:ze - |= [oan=@ud mun=mood] :: seek and read + ++ aeon-to-tako ~(got by hit) +``` + +``` + ++ tako-to-yaki ~(got by hut) :: grab yaki +``` + +We simply look up the aeon or tako in their respective maps (`hit` and `hut`). + +Assuming we got a valid version number, `++aver` calls `++read-at-aeon:ze`, +which reads the requested data at the given revision. + +``` + ++ read-at-aeon :: read-at-aeon:ze + |= [yon=aeon mun=mood] :: seek and read ^- (unit) ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed - ?^(r.mun ~ [~ oan]) - (auto:(argo oan) mun) + ?^(r.mun ~ [~ yon]) + (read:(rewind yon) mun) ``` If we're requesting the revision number with a case other than by number, then we go ahead and just produce the number we were given. Otherwise, we call -`++argo` to rewind our state to the given revision, and then we call `++auto` +`++rewind` to rewind our state to the given revision, and then we call `++read` to get the requested information. ``` - ++ argo :: argo:ze - |= oan=@ud :: rewind to aeon + ++ rewind :: rewind:ze + |= yon=aeon :: rewind to aeon ^+ +> - ?: =(let oan) +> - ?: (gth oan let) !! :: don't have this version - +>(ank (azel q:(~(got by hut) (~(got by hit) oan))), let oan) + ?: =(let yon) +> + ?: (gth yon let) !! :: don't have version + +>(ank (checkout-ankh q:(tako-to-yaki (aeon-to-tako yon))), let yon) ``` If we're already at the requested version, we do nothing. If we're requesting @@ -1019,11 +1050,11 @@ a version later than our head, we are unable to comply. Otherwise, we get the hash of the commit at the number, and from that we get the commit itself (the yaki), which has the map of path to lobe that represents -a version of the filesystem. We call `++azel` to checkout the commit, and we +a version of the filesystem. We call `++checkout-ankh` to checkout the commit, and we replace `ank` in our context with the result. ``` - ++ azel :: azel:ze + ++ checkout-ankh :: checkout-ankh:ze |= hat=(map path lobe) :: checkout commit ^- ankh %- cosh @@ -1032,7 +1063,7 @@ replace `ank` in our context with the result. ^- ankh %- cosh ?~ pat - =+ zar=(zaul bar) + =+ zar=(lobe-to-noun bar) ank(q [~ (sham zar) zar]) =+ nak=(~(get by r.ank) i.pat) %= ank @@ -1042,16 +1073,16 @@ replace `ank` in our context with the result. ``` Twice we call `++cosh`, which hashes a commit, updating `p` in an `ankh`. -Let's jump into that algorithm before we describe `++azel`. +Let's jump into that algorithm before we describe `++checkout-ankh`. ``` ++ cosh :: locally rehash - |= ank=ankh - ank(p dash:(zu ank)) + |= ank=ankh :: NB v/unix.c + ank(p rehash:(zu ank)) ``` We simply replace `p` in the hash with the `cash` we get from a call to -`++dash:zu`. +`++rehash:zu`. ``` ++ zu !: :: filesystem @@ -1059,7 +1090,7 @@ We simply replace `p` in the hash with the `cash` we get from a call to =| myz=(list ,[p=path q=miso]) :: changes in reverse =| ram=path :: reverse path into |% - ++ dash :: local rehash + ++ rehash :: local rehash ^- cash %+ mix ?~(q.ank 0 p.u.q.ank) =+ axe=1 @@ -1076,43 +1107,40 @@ We simply replace `p` in the hash with the `cash` we get from a call to checkout of the filesystem and access the actual data inside it. One of the things we can do with it is to create a recursive hash of the node. -In `++dash`, if this node is a file, then we xor the remainder of the hash with -the hash of the contents of the file. The remainder of the hash is `0` if we -have no children, else we descend into our children. Basically, we do a half -SHA-256 of the xor of the axis of this child and the half SHA-256 of the xor of -the name of the child and the hash of the child. This is done for each child -and all the results are xored together. +In `++rehash`, if this node is a file, then we xor the remainder of the hash +with the hash of the contents of the file. The remainder of the hash is `0` if +we have no children, else we descend into our children. Basically, we do a +half SHA-256 of the xor of the axis of this child and the half SHA-256 of the +xor of the name of the child and the hash of the child. This is done for each +child and all the results are xored together. -Now we return to our discussion of `++azel`. +Now we return to our discussion of `++checkout-ankh`. We fold over every path in this version of the filesystem and create a great -ankh out of them. First, we call `++zaul` to get the raw data referred to be -each lobe. +ankh out of them. First, we call `++lobe-to-noun` to get the raw data referred +to be each lobe. ``` - ++ zaul :: grab blob + ++ lobe-to-noun :: grab blob |= p=lobe :: ^- * - %- zaru - (zaal p) + %- blob-to-noun + (lobe-to-blob p) ``` This converts a lobe into the raw data it refers to by first getting the blob -with `++zaal` and converting that into data with `++zaru`. +with `++lobe-to-blob` and converting that into data with `++blob-to-noun`. ``` - ++ zaal :: grab blob - |= p=lobe :: (raw) - ^- blob - (~(got by lat) p) + ++ lobe-to-blob ~(got by lat) :: grab blob ``` This just grabs the blob that the lobe refers to. ``` - ++ zaru :: grab blob + ++ blob-to-noun :: grab blob |= p=blob ?- -.p - %delta (lump r.p (zaul q.p)) + %delta (lump r.p (lobe-to-noun q.p)) %direct q.p %indirect q.p == @@ -1189,10 +1217,10 @@ are what we expect them to be (`p.i.rug`), crashing on failure. If they're good, then we append the new lines in `q.i.rug` onto `war`. And that's really it. List merges are pretty easy. Anyway, if you recall, we -were discussing `++azel`. +were discussing `++checkout-ankh`. ``` - ++ azel :: azel:ze + ++ checkout-ankh :: checkout-ankh:ze |= hat=(map path lobe) :: checkout commit ^- ankh %- cosh @@ -1201,7 +1229,7 @@ were discussing `++azel`. ^- ankh %- cosh ?~ pat - =+ zar=(zaul bar) + =+ zar=(lobe-to-noun bar) ank(q [~ (sham zar) zar]) =+ nak=(~(get by r.ank) i.pat) %= ank @@ -1213,7 +1241,7 @@ were discussing `++azel`. If the path is null, then we calculate `zar`, the raw data at the path `pat` in this version. We produce the given ankh with the correct data. -Otherwise, we try to get the child we're looking at from our parent `ankh`. If +Otherwise, we try to get the child we're looking at from our parent ankh. If it's already been created, this succeeds; otherwise, we simply create a default blank ankh. We place ourselves in our parent after recursively computing our children. @@ -1249,7 +1277,7 @@ In the recursion, we our path is `/english` and our ankh is again blank. We try to get the `english` child of our ankh, but this of course fails. Thus, we update our blank `/greeting` ankh with a child `english` produced by recursing. -Now our path is null, so we call `++zaul` to get the actual data, and we place +Now our path is null, so we call `++lobe-to-noun` to get the actual data, and we place it in the brand-new ankh. Next, we process `/greeting/russian/short`. Since our path is not null, we try @@ -1288,54 +1316,55 @@ depending on what order the paths come in, but the resulting tree is independent of order. At any rate, we were talking about something important, weren't we? If you -recall, that concludes our discussion of `++argo`, which was called from -`++avid`. In summary, `++argo` returns a context in which our current state is -(very nearly) as it was when the specified version of the desk was the head. -This allows `++avid` to call `++auto` to read the requested information. +recall, that concludes our discussion of `++rewind`, which was called from +`++read-at-aeon`. In summary, `++rewind` returns a context in which our +current state is (very nearly) as it was when the specified version of the desk +was the head. This allows `++read-at-aeon` to call `++read` to read the +requested information. ``` - ++ auto :: auto:ze + ++ read :: read:ze |= mun=mood :: read at point ^- (unit) ?: ?=(%v p.mun) - [~ `dome`+<+<.auto] + [~ `dome`+<+<.read] ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) ?^(r.mun ~ [~ let]) ?: ?=(%w p.mun) =+ ^= yak - %- ~(got by hut) - %- ~(got by hit) + %- tako-to-yaki + %- aeon-to-tako let - ?^(r.mun ~ [~ [t.yak (azul yak)]]) - ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] - (amor(ank ank:(deny:(zu ank) r.mun)) p.mun) + ?^(r.mun ~ [~ [t.yak (forge-nori yak)]]) + ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] + (query(ank ank:(descend-path:(zu ank) r.mun)) p.mun) ``` If we're requesting the dome, then we just return that immediately. If we're requesting the revision number of the desk and we're not requesting it by number, then we just return the current number of this desk. Note of course -that this was really already handled in `++avid`. +that this was really already handled in `++read-at-aeon`. If we're requesting a `%w` with a specific revision number, then we do something or other with the commit there. It's kind of weird, and it doesn't seem to work, so we'll ignore this case. -Otherwise, we descend into the ankh tree with `++deny:zu` to the given path, -and then we handle specific request in `++amor`. +Otherwise, we descend into the ankh tree to the given path with +`++descend-path:zu`, and then we handle specific request in `++query`. ``` - ++ deny :: descend recursively + ++ descend-path :: descend recursively |= way=path ^+ +> - ?~(way +> $(way t.way, +> (dent i.way))) + ?~(way +> $(way t.way, +> (descend i.way))) ``` -This is simple recursion down into the ankh tree. `++dent` descends one level, -so this will eventually get us down to the path we want. +This is simple recursion down into the ankh tree. `++descend` descends one +level, so this will eventually get us down to the path we want. ``` - ++ dent :: descend + ++ descend :: descend |= lol=@ta ^+ +> =+ you=(~(get by r.ank) lol) @@ -1350,24 +1379,25 @@ Once we've decscended to the correct level, we need to actually deal with the request. ``` - ++ amor :: amor:ze + ++ query :: query:ze |= ren=?(%u %v %x %y %z) :: endpoint query ^- (unit ,*) ?- ren - %u [~ `rang`+<+>.amor] - %v [~ `dome`+<+<.amor] + %u [~ `rang`+<+>.query] + %v [~ `dome`+<+<.query] %x ?~(q.ank ~ [~ q.u.q.ank]) - %y [~ ache] + %y [~ as-arch] %z [~ ank] == ``` -Now that everything's set up, it's really easy. If they're requesting the rang -, dome, or ankh, we give it to them. If the contents of a file, we give it to -them if it is in fact a file. If the `arch`, then we calculate it with `++ache`. +Now that everything's set up, it's really easy. If they're requesting the +rang, dome, or ankh, we give it to them. If the contents of a file, we give it +to them if it is in fact a file. If the `arch`, then we calculate it with +`++as-arch`. ``` - ++ ache :: ache:ze + ++ as-arch :: as-arch:ze ^- arch :: arch report :+ p.ank ?~(q.ank ~ [~ p.u.q.ank]) @@ -1389,34 +1419,37 @@ rave. If the head was `&`, then it was a single request, so we handled it above. If `|`, then we handle it with the following code. ``` - | - =+ nab=(~(aeon ze lim dom ran) p.p.rav) + =+ nab=(~(case-to-aeon ze lim dom ran) p.p.rav) ?~ nab - ?> =(~ (~(aeon ze lim dom ran) q.p.rav)) - (duce hen rav) - =+ huy=(~(aeon ze lim dom ran) q.p.rav) + ?> =(~ (~(case-to-aeon ze lim dom ran) q.p.rav)) + (duce hen (rive rav)) + =+ huy=(~(case-to-aeon ze lim dom ran) q.p.rav) ?: &(?=(^ huy) |((lth u.huy u.nab) &(=(0 u.huy) =(0 u.nab)))) (blub hen) =+ top=?~(huy let.dom u.huy) - =+ fud=(~(gack ze lim dom ran) u.nab let.dom) - =. +>.$ (bleb hen u.nab fud) + =+ sar=(~(lobes-at-path ze lim dom ran) u.nab r.p.rav) + =+ ear=(~(lobes-at-path ze lim dom ran) top r.p.rav) + =. +>.$ + ?: =(sar ear) +>.$ + =+ fud=(~(make-nako ze lim dom ran) u.nab top) + (bleb hen u.nab fud) ?^ huy (blub hen) =+ ^= ptr ^- case [%ud +(let.dom)] - (duce hen `rave`[%| ptr q.p.rav]) + (duce hen `rove`[%| ptr q.p.rav r.p.rav ear]) == ``` -Recall that `++aeon:ze` produces the revision number that a case corresponds -to, if it corresponds to any. If it doesn't yet correspond to a revision, then -it produces null. +Recall that `++case-to-aeon:ze` produces the revision number that a case +corresponds to, if it corresponds to any. If it doesn't yet correspond to a +revision, then it produces null. Thus, we first check to see if we've even gotten to the beginning of the range of revisions requested. If not, then we assert that we haven't yet gotten to the end of the range either, because that would be really strange. If not, then we immediately call `++duce`, which, if you recall, for a local request, -simply puts this duct and rave into our cult `qyx`, so that we know who to +simply puts this duct and rove into our cult `qyx`, so that we know who to respond to when the revision does appear. If we've already gotten to the first revision, then we can produce some content @@ -1424,18 +1457,22 @@ immediately. If we've also gotten to the final revision, and that revision is earlier than the start revision, then it's a bad request and we call `++blub`, which tells the subscriber that his subscription will not be satisfied. -Otherwise, we call `++gack`, which creates the `++nako` we need to produce. We -call `++bleb` to actually produce the information. If we already have the last -requested revision, then we also tell the subscriber with `++blub` that the -subscription will receive no further updates. +Otherwise, we find the data at the given path at the beginning of the +subscription and at the last available revision in the subscription. If +they're the same, then we don't send a notification. Otherwise, we call +`++gack`, which creates the `++nako` we need to produce. We call `++bleb` to +actually produce the information. -If there will be more revisions, that we'll need to report, then we call -`++duce`, adding the duct to our subscribers. We modify the rave to start at -the next revision since we've already handled all the revisions up to the -present. +If we already have the last requested revision, then we also tell the +subscriber with `++blub` that the subscription will receive no further updates. -We glossed over the calls to `++gack` and `++bleb`, so we'll get back to those -right now. `++bleb` is simple, so we'll start with that. +If there will be more revisions in the subscription, then we call `++duce`, +adding the duct to our subscribers. We modify the rove to start at the next +revision since we've already handled all the revisions up to the present. + +We glossed over the calls to `++lobes-at-path`, `++make-nako`, and `++bleb`, so +we'll get back to those right now. `++bleb` is simple, so we'll start with +that. ``` ++ bleb :: ship sequence @@ -1449,51 +1486,78 @@ the updates since that revision. We use `++blab` to produce this result to the subscriber. The case is `%w` with a revision number of the beginning of the subscription, and the data is the nako itself. -Finally, we will describe `++gack:ze`. +We call `++lobes-at-path:ze` to get the data at the particular path. ``` - ++ gack :: gack a through b - |= [a=@ud b=@ud] - ^- [(map ,@ud tako) @ud (set yaki) (set blob)] + ++ lobes-at-path :: lobes-at-path:ze + |= [yon=aeon pax=path] :: data at path + ^- (map path lobe) + ?: =(0 yon) ~ + %- mo + %+ skim + %. ~ + %~ tap by + =< q + %- tako-to-yaki + %- aeon-to-tako + yon + |= [p=path q=lobe] + ?| ?=(~ pax) + ?& !?=(~ p) + =(-.pax -.p) + $(p +.p, pax +.pax) + == == +``` + +At revision zero, the theoretical common revision between all repositories, +there is no data, so we produce null. + +We get the list of paths (paired with their lobe) in the revision referred to +by the given number and we keep only those paths which begin with `pax`. +Converting to a map, we now have a map from the subpaths at the given path to +the hash of their data. This is simple and efficient to calculate and compare +to later revisions. This allows us to easily tell if a node or its children +have changed. + +Finally, we will describe `++make-nako:ze`. + +``` + ++ make-nako :: gack a through b + |= [a=aeon b=aeon] + ^- [(map aeon tako) aeon (set yaki) (set blob)] :_ :- b - %- hack - %+ pack - (~(get by hit) a) :: if a not found, a=0 - %- need (~(get by hit) b) - ^- (map ,@ud tako) + =- [(takos-to-yakis -<) (lobes-to-blobs ->)] + %+ reachable-between-takos + (~(get by hit) a) :: if a not found, a=0 + (aeon-to-tako b) + ^- (map aeon tako) %- mo %+ skim (~(tap by hit) ~) - |= [p=@ud *] + |= [p=aeon *] &((gth p a) (lte p b)) ``` +We need to produce four things -- the numbers of the new commits, the number of +the latest commit, the new commits themselves, and the new data itself. +The first is fairly easy to produce. We simply go over our map of numbered +commits and produce all those numbered greater than `a` and not greater than +`b`. + +The second is even easier to produce -- `b` is clearly our most recent commit. + +The third and fourth are slightly more interesting, though not too terribly +difficult. First, we call `++reachable-between-takos`. ``` - ++ hack :: trivial - |= [a=(set tako) b=(set lobe)] - ^- [(set yaki) (set blob)] - :- %- sa %+ turn (~(tap by a) ~) - |= tak=tako - (need (~(get by hut) tak)) - %- sa %+ turn (~(tap by b) ~) - |= lob=lobe - (need (~(get by lat) lob)) -``` - -The type signature says everything you need to know about this. We take a set -of hashes of commits and data and convert them into the actual commits and data -in the most straightforward way possible. - -``` - ++ pack - |= [a=(unit tako) b=tako] :: pack a through b + ++ reachable-between-takos + |= [a=(unit tako) b=tako] :: pack a through b ^- [(set tako) (set lobe)] =+ ^= sar ?~ a ~ - (zule r:(need (~(get by hut) u.a))) - =+ yak=`yaki`(need (~(get by hut) b)) - %+ garf (garg ~ sar) :: get lobes - |- ^- (set tako) :: walk onto sar + (reachable-takos r:(tako-to-yaki u.a)) + =+ yak=`yaki`(tako-to-yaki b) + %+ new-lobes-takos (new-lobes ~ sar) :: get lobes + |- ^- (set tako) :: walk onto sar ?: (~(has in sar) r.yak) ~ =+ ber=`(set tako)`(~(put in `(set tako)`~) `tako`r.yak) @@ -1502,39 +1566,57 @@ in the most straightforward way possible. %+ roll p.yak |= [yek=tako bar=(set tako)] ^- (set tako) - ?: (~(has in bar) yek) :: save some time + ?: (~(has in bar) yek) :: save some time bar %- ~(uni in bar) - ^$(yak (need (~(get by hut) yek))) + ^$(yak (tako-to-yaki yek)) ``` +We take a possible starting commit and a definite ending commit, and we produce +the set of commits and the set of data between them. + +We let `sar` be the set of commits reachable from `a`. If `a` is null, then +obviously no commits are reachable. Otherwise, we call `++reachable-takos` to +calculate this. + ``` - ++ zule :: reachable - |= p=tako :: XX slow + ++ reachable-takos :: reachable + |= p=tako :: XX slow ^- (set tako) - =+ y=(~(got by hut) p) + =+ y=(tako-to-yaki p) =+ t=(~(put in _(set tako)) p) %+ roll p.y |= [q=tako s=_t] - ?: (~(has in s) q) :: already done - s :: hence skip - (~(uni in s) ^$(p q)) :: otherwise traverse + ?: (~(has in s) q) :: already done + s :: hence skip + (~(uni in s) ^$(p q)) :: otherwise traverse ``` +We very simply produce the set of the given tako plus its parents, recursively. + +Back in `++reachable-between-takos`, we let `yak` be the yaki of `b`, the +ending commit. With this, we create a set that is the union of `sar` and all +takos reachable from `b`. + +We pass `sar` into `++new-lobes` to get all the lobes referenced by any tako +referenced by `a`. The result is passed into `++new-lobes-takos` to do the +same, but not recomputing those in already calculated last sentence. This +produces the sets of takos and lobes we need. + ``` - ++ garg :: object hash set - |= [b=(set lobe) a=(set tako)] :: that aren't in b + ++ new-lobes :: object hash set + |= [b=(set lobe) a=(set tako)] :: that aren't in b ^- (set lobe) %+ roll (~(tap in a) ~) |= [tak=tako bar=(set lobe)] ^- (set lobe) - =+ yak=(need (~(get by hut) tak)) + =+ yak=(tako-to-yaki tak) %+ roll (~(tap by q.yak) ~) |= [[path lob=lobe] far=_bar] ^- (set lobe) - ?~ (~(has in b) lob) :: don't need + ?~ (~(has in b) lob) :: don't need far - =+ gar=(need (~(get by lat) lob)) + =+ gar=(lobe-to-blob lob) ?- -.gar %direct (~(put in far) lob) %delta (~(put in $(lob q.gar)) lob) @@ -1542,9 +1624,414 @@ in the most straightforward way possible. == ``` +Here, we're creating a set of lobes referenced in a commit in `a`. We start +out with `b` as the initial set of lobes, so we don't need to recompute any of +the lobes referenced in there. + +The algorithm is pretty simple, so we won't bore you with the details. We +simply traverse every commit in `a`, looking at every blob referenced there, +and, if it's not already in `b`, we add it to `b`. In the case of a direct +blob, we're done. For a delta or an indirect blob, we recursively add every +blob referenced within the blob. + ``` - ++ garf :: garg & repack + ++ new-lobes-takos :: garg & repack |= [b=(set lobe) a=(set tako)] ^- [(set tako) (set lobe)] - [a (garg b a)] + [a (new-lobes b a)] ``` + +Here, we just update the set of lobes we're given with the commits we're given +and produce both sets. + +This concludes our discussion of a local subscription. + +Lifecycle of a Foreign Read or Subscription +------------------------------------------- + +Foreign reads and subscriptions are handled in much the same way as local ones. +The interface is the same -- a vane or app sends a `%warp` kiss with the +request. The difference is simply that the `sock` refers to the foreign ship. + +Thus, we start in the same place -- in `++call`, handling `%warp`. However, +since the two side of the `sock` are different, we follow a different path. + +``` + =+ wex=(do now p.q.hic p.q.q.hic ruf) + =+ ^= woo + ?~ q.q.q.hic + abet:(ease:wex hen) + abet:(eave:wex hen u.q.q.q.hic) + [-.woo (posh q.p.q.hic p.q.q.hic +.woo ruf)] +``` + +If we compare this to how the local case was handled, we see that it's not all +that different. We use `++do` rather than `++un` and `++de` to set up the core +for the foreign ship. This gives us a `++de` core, so we either cancel or +begin the request by calling `++ease` or `++eave`, exactly as in the local +case. In either case, we call `++abet:de` to resolve our various types of +output into actual moves, as described in the local case. Finally, we call +`++posh` to update our raft, putting the modified rung into the raft. + +We'll first trace through `++do`. + +``` + ++ do + |= [now=@da [who=ship him=ship] syd=@tas ruf=raft] + =+ ^= rug ^- rung + =+ rug=(~(get by hoy.ruf) him) + ?^(rug u.rug *rung) + =+ ^= red ^- rede + =+ yit=(~(get by rus.rug) syd) + ?^(yit u.yit `rede`[~2000.1.1 ~ [~ *rind] *dome]) + ((de now ~ ~) [who him] syd red ran.ruf) +``` + +If we already have a rung for this foreign ship, then we use that. Otherwise, +we create a new blank one. If we already have a rede in this rung, then we use +that, otherwise we create a blank one. An important point to note here is that +we let `ref` in the rede be `[~ *rind]`. Recall, for domestic desks `ref` is +null. We use this to distinguish between foreign and domestic desks in `++de`. + +With this information, we create a `++de` core as usual. + +Although we've already covered `++ease` and `++eave`, we'll go through them +quickly again, highlighting the case of foreign request. + +``` + ++ ease :: release request + |= hen=duct + ^+ +> + =. qyx (~(del by qyx) hen) + ?~ ref +> + |- ^+ +>+.$ + =+ nux=(~(get by fod.u.ref) hen) + ?~ nux +>+.$ + %= +>+.$ + say [[hen [(scot %ud u.nux) ~] for [u.nux syd ~]] say] + fod.u.ref (~(del by fod.u.ref) hen) + bom.u.ref (~(del by bom.u.ref) u.nux) + == +``` + +Here, we still remove the duct from our cult (we maintain a cult even for +foreign desks), but we also need to tell the foreign desk to cancel our +subscription. We do this by sending a request (by appending to `say`, which +gets resolved in `++abet:de` to a `%want` kiss to ames) to the foreign ship to +cancel the subscription. Since we don't anymore expect a response on this +duct, we remove it from `fod` and `bom`, which are the maps between ducts, +raves, and request sequence numbers. Basically, we remove every trace of the +subscription from our request manager. + +In the case of `++eave`, where we're creating a new request, everything is +exactly identical to the case of the local request except `++duce`. We said +that `++duce` simply puts the request into our cult. This is true for a +domestic request, but distinctly untrue for foreign requests. + +``` + ++ duce :: produce request + |= [hen=duct rov=rove] + ^+ +> + =. qyx (~(put by qyx) hen rov) + ?~ ref +>.$ + |- ^+ +>+.$ :: XX why? + =+ rav=(reve rov) + =+ ^= vaw ^- rave + ?. ?=([%& %v *] rav) rav + [%| [%ud let.dom] `case`q.p.rav r.p.rav] + =+ inx=nix.u.ref + %= +>+.$ + say [[hen [(scot %ud inx) ~] for [inx syd ~ vaw]] say] + nix.u.ref +(nix.u.ref) + bom.u.ref (~(put by bom.u.ref) inx [hen vaw]) + fod.u.ref (~(put by fod.u.ref) hen inx) + == +``` + +If we have a request manager (i.e. this is a foreign desk), then we do the +approximate inverse of `++ease`. We create a rave out of the given request and +send it off to the foreign desk by putting it in `say`. Note that the rave is +created to request the information starting at the next revision number. Since +this is a new request, we put it into `fod` and `bom` to associate the request +with its duct and its sequence number. Since we're using another sequence +number, we must increment `nix`, which represents the next available sequence +number. + +And that's really it for this side of the request. Requesting foreign +information isn't that hard. Let's see what it looks like on the other side. +When we get a request from another ship for information on our ship, that comes +to us in the form of a `%wart` from ames. + +We handle a `%wart` in `++call`, right next to where we handle the `%warp` case. + +``` + %wart + ?> ?=(%re q.q.hic) + =+ ryf=((hard riff) s.q.hic) + :_ ..^$ + :~ :- hen + :^ %pass [(scot %p p.p.q.hic) (scot %p q.p.q.hic) r.q.hic] + %c + [%warp [p.p.q.hic p.p.q.hic] ryf] + == +``` + +Every request we receive should be of type `riff`, so we coerce it into that +type. We just convert this into a new `%warp` kiss that we pass to ourself. +This gets handled like normal, as a local request. When the request produces +a value, it does so like normal as a `%writ`, which is returned to `++take` +along the path we just sent it on. + +``` + %writ + ?> ?=([@ @ *] tea) + =+ our=(need (slaw %p i.tea)) + =+ him=(need (slaw %p i.t.tea)) + :_ ..^$ + :~ :- hen + [%pass ~ %a [%want [our him] [%r %re %c t.t.tea] p.+.q.hin]] + == +``` + +Since we encoded the ship we need to respond to in the path, we can just pass +our `%want` back to ames, so that we tell the requesting ship about the new +data. + +This comes back to the original ship as a `%waft` from ames, which comes into +`++take`, right next to where we handled `%writ`. + +``` + %waft + ?> ?=([@ @ ~] tea) + =+ syd=(need (slaw %tas i.tea)) + =+ inx=(need (slaw %ud i.t.tea)) + =+ ^= zat + =< wake + (knit:(do now p.+.q.hin syd ruf) [inx ((hard riot) q.+.q.hin)]) + =^ mos ruf + =+ zot=abet.zat + [-.zot (posh q.p.+.q.hin syd +.zot ruf)] + [mos ..^$(ran.ruf ran.zat)] :: merge in new obj +``` + +This gets the desk and sequence number from the path the request was sent over. +This determines exactly which request is being responded to. We call +`++knit:de` to apply the changes to our local desk, and we call `++wake` to +update our subscribers. Then we call `++abet:de` and `++posh` as normal (like +in `++eave`). + +We'll examine `++knit` and `++wake`, in that order. + +``` + ++ knit :: external change + |= [inx=@ud rot=riot] + ^+ +> + ?> ?=(^ ref) + |- ^+ +>+.$ + =+ ruv=(~(get by bom.u.ref) inx) + ?~ ruv +>+.$ + => ?. |(?=(~ rot) ?=(& -.q.u.ruv)) . + %_ . + bom.u.ref (~(del by bom.u.ref) inx) + fod.u.ref (~(del by fod.u.ref) p.u.ruv) + == + ?~ rot + =+ rav=`rave`q.u.ruv + %= +>+.$ + lim + ?.(&(?=(| -.rav) ?=(%da -.q.p.rav)) lim `@da`p.q.p.rav) + :: + haw.u.ref + ?. ?=(& -.rav) haw.u.ref + (~(put by haw.u.ref) p.rav ~) + == + ?< ?=(%v p.p.u.rot) + =. haw.u.ref + (~(put by haw.u.ref) [p.p.u.rot q.p.u.rot q.u.rot] ~ r.u.rot) + ?. ?=(%w p.p.u.rot) +>+.$ + |- ^+ +>+.^$ + =+ nez=[%w [%ud let.dom] ~] + =+ nex=(~(get by haw.u.ref) nez) + ?~ nex +>+.^$ + ?~ u.nex +>+.^$ :: should never happen + =. +>+.^$ =+ roo=(edis ((hard nako) u.u.nex)) + ?>(?=(^ ref.roo) roo) + %= $ + haw.u.ref (~(del by haw.u.ref) nez) + == +``` + +This is kind of a long gate, but don't worry, it's not bad at all. + +First, we assert that we're not a domestic desk. That wouldn't make any sense +at all. + +Since we have the sequence number of the request, we can get the duct and rave +from `bom` in our request manager. If we didn't actually request this data (or +the request was canceled before we got it), then we do nothing. + +Else, we remove the request from `bom` and `fod` unless this was a subscription +request and we didn't receive a null riot (which would indicate the last +message on the subscription). + +Now, if we received a null riot, then if this was a subscription request by +date, then we update `lim` in our request manager (representing the latest time +at which we have complete information for this desk) to the date that was +requested. If this was a single read request, then we put the result in our +simple cache `haw` to make future requests faster. Then we're done. + +If we received actual data, then we put it into our cache `haw`. Unless it's a +`%w` request, we're done. + +If it is a `%w` request, then we try to get the `%w` at our current head from +the cache. In general, that should be the thing we just put in a moment ago, +but that is not guaranteed. The most common case where this is different is +when we receive desk updates out of order. At any rate, since we now have new +information, we need to apply it to our local copy of the desk. We do so in +`++edis`, and then we remove the stuff we just applied from the cache, since +it's not really a true "single read", like what should really be in the cache. + +``` + ++ edis :: apply subscription + |= nak=nako + ^+ +> + %= +> + hit.dom (~(uni by hit.dom) gar.nak) + let.dom let.nak + lat.ran %+ roll (~(tap in bar.nak) ~) + =< .(yeb lat.ran) + |= [sar=blob yeb=(map lobe blob)] + =+ zax=(blob-to-lobe sar) + %+ ~(put by yeb) zax sar + hut.ran %+ roll (~(tap in lar.nak) ~) + =< .(yeb hut.ran) + |= [sar=yaki yeb=(map tako yaki)] + %+ ~(put by yeb) r.sar sar + == +``` + +This shows, of course, exactly why nako is defined the way it is. To become +completely up to date with the foreign desk, we need to merge `hit` with the +foreign one so that we have all the revision numbers. We update `let` so that +we know which revision is the head. + +We merge the new blobs in `lat`, keying them by their hash, which we get from a +call to `++blob-to-lobe`. Recall that the hash is stored in the actual blob +itself. We do the same thing to the new yakis, putting them in `hut`, keyed by +their hash. + +Now, our local dome should be exactly the same as the foreign one. + +This concludes our discussion of `++knit`. Now the changes have been applied to +our local copy of the desk, and we just need to update our subscribers. We do +so in `++wake:de`. + +``` + ++ wake :: update subscribers + ^+ . + =+ xiq=(~(tap by qyx) ~) + =| xaq=(list ,[p=duct q=rove]) + |- ^+ ..wake + ?~ xiq + ..wake(qyx (~(gas by *cult) xaq)) + ?- -.q.i.xiq + & + =+ cas=?~(ref ~ (~(get by haw.u.ref) `mood`p.q.i.xiq)) + ?^ cas + %= $ + xiq t.xiq + ..wake ?~ u.cas (blub p.i.xiq) + (blab p.i.xiq p.q.i.xiq u.u.cas) + == + =+ nao=(~(case-to-aeon ze lim dom ran) q.p.q.i.xiq) + ?~ nao $(xiq t.xiq, xaq [i.xiq xaq]) + $(xiq t.xiq, ..wake (balk p.i.xiq u.nao p.q.i.xiq)) + :: + | + =+ mot=`moot`p.q.i.xiq + =+ nab=(~(case-to-aeon ze lim dom ran) p.mot) + ?~ nab + $(xiq t.xiq, xaq [i.xiq xaq]) + =+ huy=(~(case-to-aeon ze lim dom ran) q.mot) + ?~ huy + =+ ptr=[%ud +(let.dom)] + %= $ + xiq t.xiq + xaq [[p.i.xiq [%| ptr q.mot r.mot s.mot]] xaq] + ..wake =+ ^= ear + (~(lobes-at-path ze lim dom ran) let.dom r.p.q.i.xiq) + ?: =(s.p.q.i.xiq ear) ..wake + =+ fud=(~(make-nako ze lim dom ran) u.nab let.dom) + (bleb p.i.xiq let.dom fud) + == + %= $ + xiq t.xiq + ..wake =- (blub:- p.i.xiq) + =+ ^= ear + (~(lobes-at-path ze lim dom ran) u.huy r.p.q.i.xiq) + ?: =(s.p.q.i.xiq ear) (blub p.i.xiq) + =+ fud=(~(make-nako ze lim dom ran) u.nab u.huy) + (bleb p.i.xiq +(u.nab) fud) + == + == + -- +``` + +This is even longer than `++knit`, but it's pretty similar to `++eave`. We loop +through each of our subscribers `xiq`, processing each in turn. When we're done, +we just put the remaining subscribers back in our subscriber list. + +If the subscriber is a single read, then, if this is a foreign desk (note that +`++wake` is called from other arms, and not only on foreign desks). Obviously, +if we find an identical request there, then we can produce the result +immediately. Referential transparency for the win. We produce the result with +a call to `++blab`. If this is a foreign desk but the result is not in the +cache, then we produce `++blub` (canceled subscription with no data) for +reasons entirely opaque to me. Seriously, it seems like we should wait until +we get an actual response to the request. If someone figures out why this is, +let me know. At any rate, it seems to work. + +If this is a domestic desk, then we check to see if the case exists yet. If +it doesn't, then we simply move on to the next subscriber, consing this one +onto `xaq` so that we can check again the next time around. If it does exist, +then we call `++balk` to fulfill the request and produce it. + +`++balk` is very simple, so we'll describe it here before we get to the +subscription case. + +``` + ++ balk :: read and send + |= [hen=duct yon=@ud mun=mood] + ^+ +> + =+ vid=(~(read-at-aeon ze lim dom ran) yon mun) + ?~ vid (blub hen) (blab hen mun u.vid) +``` + +We call `++read-at-aeon` on the given request and aeon. If you recall, this +processes a `mood` at a particular aeon and produces the result, if there is +one. If there is data at the requested location, then we produce it with +`++blab`. Else, we call `++blub` to notify the subscriber that no data can +ever come over this subscriptioin since it is now impossible for there to ever +be data for the given request. Because referential transparency. + +At any rate, back to `++wake`. If the given rave is a subscription request, +then we proceed similarly to how we do in `++eave`. We first try to get the +aeon referred to by the starting case. If it doesn't exist yet, then we can't +do anything interesting with this subscription, so we move on to the next one. + +Otherwise, we try to get the aeon referrred to by the ending case. If it +doesn't exist yet, then we produce all the information we can. We call +`++lobes-at-path` at the given aeon and path to see if the requested path has +actually changed. If it hasn't, then we don't produce anything; else, we +produce the correct nako by calling `++bleb` on the result of `++make-nako`, as +in `++eave`. At any rate, we move on to the next subscription, putting back +into our cult the current subscription with a new start case of the next aeon +after the present. + +If the aeon referred to by the ending case does exist, then we drop this +subscriber from our cult and satisfy its request immediately. This is the same +as before -- we check to see if the data at the path has actually changed, +producing it if it has; else, we call `++blub` since no more data can be +produced over this subscription. + +This concludes our discussion of foreign requests. diff --git a/try/bin/merge.hoon b/try/bin/merge.hoon index 824ed4c15..f49bed92a 100644 --- a/try/bin/merge.hoon +++ b/try/bin/merge.hoon @@ -25,7 +25,7 @@ vsr == =+ ^= lum - %- ~(auld ze est ves ran) + %- ~(construct-merge ze est ves ran) [?~(gem %fine -.gem) (need (slaw 'p' sen.pen)) den.pen sab est] ?~ lum ^- gift From 193d3b0feb88035f00cca413e6aa7a0252f18338 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 18 Sep 2014 12:19:18 -0700 Subject: [PATCH 20/63] Update urbit.pill with !: on crua for u3 jet error. --- arvo/zuse.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 6ada5eaf2..22367a3d3 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -41,7 +41,7 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 3bB, cryptosuites :: :: -++ crua :: cryptosuite A (RSA) +++ crua !: :: cryptosuite A (RSA) ^- acru =| [mos=@ pon=(unit ,[p=@ q=@ r=[p=@ q=@] s=_*fu])] => |% From 8e3c922b0235d1e93964b9e5f3bb3173fbd6cf0b Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 18 Sep 2014 12:42:28 -0700 Subject: [PATCH 21/63] More !: for u3 bug. --- arvo/hoon.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 87fa1d0a3..fc7889a66 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1154,7 +1154,7 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cF, signed and modular ints :: :: -++ si :: signed integer +++ si !: :: signed integer |% ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value ++ dif |= [a=@s b=@s] :: subtraction @@ -4722,7 +4722,7 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2eW, lite number theory :: :: -++ egcd :: schneier's egcd +++ egcd !: :: schneier's egcd |= [a=@ b=@] =+ si =+ [c=(sun a) d=(sun b)] From a4bec784194dd74eb268f8c65c635aff4d09ed46 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 23 Sep 2014 10:11:59 -0700 Subject: [PATCH 22/63] Various fixes and improvements. --- arvo/jael.hoon | 66 +++++++++++++++++++++++++ arvo/kahn.hoon | 127 +++++++++++++++++++++++++++++++++++++++++++++++++ arvo/lunt.hoon | 102 +++++++++++++++++++++++++++++++++++++++ arvo/musk.hoon | 94 ++++++++++++++++++++++++++++++++++++ 4 files changed, 389 insertions(+) create mode 100644 arvo/jael.hoon create mode 100644 arvo/kahn.hoon create mode 100644 arvo/lunt.hoon create mode 100644 arvo/musk.hoon diff --git a/arvo/jael.hoon b/arvo/jael.hoon new file mode 100644 index 000000000..158e0969c --- /dev/null +++ b/arvo/jael.hoon @@ -0,0 +1,66 @@ +:: %jael, secret storage +:: +:::: /hoon/jael + :: +!? 164 +:::: +|= pit=vase +=> =~ +:: structures +|% +++ axle :: %jael state + $: %0 :: + all=(map ship ,[p=@ q=safe]) :: entropy, secrets + == :: +++ mort ,[p=@da q=duct r=@] :: a mortal secret +++ gift :: out result <-$ + $% [%done p=path q=@] :: key expired + == :: +++ kiss :: in request ->$ + $% [%drop p=@p q=path r=@] :: discard key + [%junk p=@] :: add entropy + [%show p=@p q=path] :: read subtree + [%tell p=@ q=path r=@da s=@] :: save key + == :: +++ safe ,[p=(unit ,@) q=(map ,@ta safe)] :: secret tree +++ move ,[p=duct q=[%give p=gift]] :: local move +-- :: +. == +=| axle +=* lex - +|= [now=@da eny=@ ski=sled] :: activate +^? :: opaque core +|% :: +++ call :: request + |= [hen=duct hic=(hypo (hobo kiss))] + ^- [p=(list move) q=_..^$] + => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) + !! +:: +++ doze + |= [now=@da hen=duct] + ^- (unit ,@da) + ~ +:: +++ load :: highly forgiving + |= old=* + =+ lox=((soft axle) old) + ^+ ..^$ + ?~ lox + ~& %jael-reset + ..^$ + ..^$(+>- u.lox) +:: +++ scry + |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] + ^- (unit (unit (pair mark ,*))) + :: actually scry + ~ +:: +++ stay :: save w/o cache + `axle`+>-.$(pol (~(run by pol) |=(a=baby [tad.a dym.a ~]))) +:: +++ take :: response + |= [tea=wire hen=duct hin=(hypo noun)] + !! +-- diff --git a/arvo/kahn.hoon b/arvo/kahn.hoon new file mode 100644 index 000000000..e0ca2e02a --- /dev/null +++ b/arvo/kahn.hoon @@ -0,0 +1,127 @@ +:: %kahn, social state +:: +:::: /hoon/kahn + :: +!? 164 +:::: +|= pit=vase +=> =~ +:: structures +|% +++ axle :: %kahn state + $: %0 :: + all=(map ship axel) :: state by owner + == :: +++ axel :: all social state + $: rod=(list ship) :: ancestry upward + myn=(map ship girl) :: daughters + == +++ axon :: all descendants + $: [%a p=hulk q=hulk r=hulk] :: carrier + [%b p=hulk q=hulk] :: cruiser + [%c p=hulk] :: destroyer + [%d p=hulk] :: yacht + [%e p=ship] :: submarine + == :: +++ clan :: ranked group + $: pec=rank :: membership bar + who=(set ship) :: members + == :: +++ gift :: out result <-$ + $: [%notice p=ship q=action] + == +++ girl :: daughter record + $: hop=pony :: status + tip=rank :: rank + fig=(set narc) :: other identities + gor=(set ,@tas) :: memberships + out=(unit ship) :: stepmother + res=(unit ,@da) :: reserved until + == :: +++ hulk :: social state + $: rod=(list ship) :: ancestry upward + myn=(map ship girl) :: daughter status + cir=(map ,@tas clan) :: daughter groups + == :: +++ kiss :: change + $: [%reserve p=@ud q=@ud] :: reserve class/num + [%renew ~] :: self-renew + [%modify p=ship q=action] :: + [%await p=(unit trigger)] :: subscribe actions + == +++ trigger + $: (set ship) + (set clan) + (set rank) + (set pony) + == +++ action + $: %warm -> %cold + %cold -> %here + %cold -> %fake + %cold -> %free + * -> %dead + * -> %left + *: tip + *: add, subtract fig + *: add, subtract gor + adopt: external to free + == +++ narc path :: contact path +++ pony :: daughter status + $? %cold :: virginal + %dead :: inoperative + %fake :: virtual + %free :: exported + %here :: hosted + %left :: divorced + %warm :: reserved + == :: +++ rank :: privilege + $? %0 :: enemy + %1 :: guest + %2 :: customer/vendor + %3 :: member/employee + %4 :: admin/officer + %5 :: self/god + == :: +-- :: +. == +=| axle +=* lex - +|= [now=@da eny=@ ski=sled] :: activate +^? :: opaque core +|% :: +++ call :: request + |= [hen=duct hic=(hypo (hobo kiss))] + ^- [p=(list move) q=_..^$] + => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) + !! +:: +++ doze + |= [now=@da hen=duct] + ^- (unit ,@da) + ~ +:: +++ load :: highly forgiving + |= old=* + =+ lox=((soft axle) old) + ^+ ..^$ + ?~ lox + ~& %lunt-reset + ..^$ + ..^$(+>- u.lox) +:: +++ scry + |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] + ^- (unit (unit (pair mark ,*))) + ~ +:: +++ stay :: save w/o cache + `axle`+>-.$ +:: +++ take :: response + |= [tea=wire hen=duct hin=(hypo noun)] + !! +-- + diff --git a/arvo/lunt.hoon b/arvo/lunt.hoon new file mode 100644 index 000000000..7244bf44d --- /dev/null +++ b/arvo/lunt.hoon @@ -0,0 +1,102 @@ +:: %lunt, fleet job control +:: +:::: /hoon/lunt + :: +!? 164 +:::: +|= pit=vase +=> =~ +:: structures +|% +++ axle :: %lunt state + $: %0 :: + all=(map ship axil) :: state by owner + == :: +++ born ,[p=brat q=(unit ship)] :: task identity +++ brat ,@ud :: task number +++ bulb :: + $: p=@p :: ship identity + q=home :: server data + == :: +++ home :: storage access + $: pad=@uvH :: passcode + huc=husk :: log server + + == :: +++ hulk :: checkpoint service + $% [%astr p= +++ husk :: log server + $: pro=@tas :: protocol + cap=@uvH :: access code + srv=(list (pair ,@ud clip)) :: server cluster + == :: +++ gift :: result + $: [%die p=brat] :: kill + [%int p=brat] :: interrupt + [%run p=brat q=@p r=home] :: load + [%say p=brat q=(list ovum)] :: send events + [%new p=brat q=@p r=home s=(list ovum)] :: create + == :: +++ kiss :: request + $: [%com p=@p] :: toggle computer + [%end p=brat] :: local end + [%fan p=@ud] :: set local fanout + [%kil ~] :: terminate ship + [%int ~] :: interrupt ship + [%new p=@p q=(set ,@p) q=home r=@uvI] :: create ship + [%run p=@p q=home] :: run existing ship + [%say p=(list ovum)] :: remote events + [%sto p=husk] :: toggle logger + == :: +++ axil :: + $: bus=(unit ,@p) :: master + loc=@ud :: local resources + hen=(unit duct) :: effect duct + ent=@ :: entropy + seq=@ :: brat sequence + why=(map duct born) :: hosted ships + how=(map born duct) :: reverse why + hut=(map born home) :: storage control + sto=(set husk) :: storage resources + com=(set ship) :: compute resources + == :: +-- :: +. == +=| axle +=* lex - +|= [now=@da eny=@ ski=sled] :: activate +^? :: opaque core +|% :: +++ call :: request + |= [hen=duct hic=(hypo (hobo kiss))] + ^- [p=(list move) q=_..^$] + => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) + !! +:: +++ doze + |= [now=@da hen=duct] + ^- (unit ,@da) + ~ +:: +++ load :: highly forgiving + |= old=* + =+ lox=((soft axle) old) + ^+ ..^$ + ?~ lox + ~& %lunt-reset + ..^$ + ..^$(+>- u.lox) +:: +++ scry + |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] + ^- (unit (unit (pair mark ,*))) + ~ +:: +++ stay :: save w/o cache + `axle`+>-.$ +:: +++ take :: response + |= [tea=wire hen=duct hin=(hypo noun)] + !! +-- + diff --git a/arvo/musk.hoon b/arvo/musk.hoon new file mode 100644 index 000000000..03dfda150 --- /dev/null +++ b/arvo/musk.hoon @@ -0,0 +1,94 @@ +:: %musk, realm management +:: +:::: /hoon/musk + :: +!? 164 +:::: +|= pit=vase +=> =~ +:: structures +|% +++ axle :: %musk state + $: %0 :: + all=(map ship axil) :: state by owner + == :: +++ axil :: + $: kid=(map ship girl) :: daughters + deq=(map narc ship) :: reverse address + siq=(map ship (list clan)) :: ship to clans + kes=(map clan (list ship)) :: clan to ships + == :: +++ clan ,@tas :: group identity +++ narc :: contact address + $: [%$ p=ship] :: urbit + [%m p=@t q=@t] :: email p@q + [%f p=@t] :: facebook + [%g p=@t] :: google + [%p p=@t] :: phone message + [%t p=@t] :: twitter + == :: +++ pony :: daughter status + $% [%cold ~] :: virginal + [%dead ~] :: written off + [%fake ~] :: virtual + [%free ~] :: downloaded + [%here ~] :: hosted + [%left p=(unit ship)] :: run away to + == :: +++ rank :: relative privilege + $? %0 :: enemy + %1 :: neighbor + %2 :: guest/customer + %3 :: friend/employee + %4 :: officer/family + %5 :: self/admin + == :: +++ girl :: + $: hop=pony :: status + tag=(unit ,@tas) :: petname + tip=rank :: rank + fig=(set narc) :: identities + loc=(unit ,[p=@da q=@ud r=clip]) :: last position + sym=(set ,[p=@ q=@uvH]) :: symmetric keys? + wyl=will :: crypto will + == :: +-- :: +. == +=| axle +=* lex - +|= [now=@da eny=@ ski=sled] :: activate +^? :: opaque core +|% :: +++ call :: request + |= [hen=duct hic=(hypo (hobo kiss))] + ^- [p=(list move) q=_..^$] + => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) + !! +:: +++ doze + |= [now=@da hen=duct] + ^- (unit ,@da) + ~ +:: +++ load :: highly forgiving + |= old=* + =+ lox=((soft axle) old) + ^+ ..^$ + ?~ lox + ~& %lunt-reset + ..^$ + ..^$(+>- u.lox) +:: +++ scry + |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] + ^- (unit (unit (pair mark ,*))) + ~ +:: +++ stay :: save w/o cache + `axle`+>-.$ +:: +++ take :: response + |= [tea=wire hen=duct hin=(hypo noun)] + !! +-- + From 8868cafbb7f67deb32816f84122683faf2fcfebd Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 24 Sep 2014 12:59:09 -0700 Subject: [PATCH 23/63] Fixed ^:tyl/pax irregular form --- arvo/hoon.hoon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 87fa1d0a3..dda70f702 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -3438,6 +3438,7 @@ %t ?: =('a' hay) ?: =('s' (cut 3 [2 1] p.p.lot)) + (weld (rip 3 q.p.lot) rex) ['~' '.' (weld (rip 3 q.p.lot) rex)] ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)] @@ -8907,11 +8908,13 @@ ;~ pfix ket ;~ pose ;~ pfix col - %+ cook + %+ sear |= [a=tile b=twig] :: XX shd be static =+ rev=(plex b) + ?~ rev ~ + %- some :+ %smsm ~(clam al a) - [%dtkt %dtzz %$ %cx rev] + [%dtkt %dtzz %$ %cx u.rev] ;~(plug hill rood) == (sear prey (most ket rood)) From 55e1f24999f2c82da772e4494246b447ff5ee13a Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 24 Sep 2014 14:29:19 -0700 Subject: [PATCH 24/63] Stashing. --- arvo/hoon.hoon | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index ccc7865b3..457f58bee 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -28,8 +28,7 @@ ++ axis ,@ :: tree address ++ also ,[p=term q=wing r=type] :: alias ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~ -++ bean ,? :: default to yes -++ bane $?(%| %&) :: default to no +++ bean ,? :: 0=&=yes, 1=|=no ++ beer $|(@ [~ p=twig]) :: simple embed ++ beet $| @ :: advanced embed $% [%a p=twig] :: @@ -2503,7 +2502,9 @@ [zac [~ i.q.tub [zac t.q.tub]]] :: ++ sear :: conditional cook + ~/ %sear |* [pyq=_|=(* *(unit)) sef=_rule] + ~/ %fun |= tub=nail =+ vex=(sef tub) ?~ q.vex @@ -2600,7 +2601,9 @@ [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]] :: ++ stun :: parse several times + ~/ %stun |* [[les=@ mos=@] fel=_rule] + ~/ %fun |= tub=nail ^- (like (list ,_(wonk (fel)))) ?: =(0 mos) @@ -2943,7 +2946,8 @@ ?: =(inx len) & =+ cur=(cut 3 [inx 1] b) ?& ?| &((gte cur 'a') (lte cur 'z')) - &((gte cur '0') (lte cur '9')) + &((gte cur 'A') (lte cur 'Z')) + &(&((gte cur '0') (lte cur '9')) !=(0 inx)) |(=('-' cur) =('~' cur) =('_' cur) =('.' cur)) == $(inx +(inx)) @@ -8464,36 +8468,28 @@ ;~(plug (star low) (star hig)) :: ++ plex - |= gen=twig ^- (unit path) + |= gen=twig ~| [%plex gen] ^- path ?: ?=([%zpcb *] gen) $(gen q.gen) - ?. ?=([%clsg *] gen) ~ - %+ reel p.gen - |= [a=twig b=_`(unit path)`[~ u=/]] - ?~ b ~ - ?. ?=(%dtzy -.a) ~ - `[q.a u.b] + ?> ?=([%clsg *] gen) + (turn p.gen |=(a=twig ?>(?=(%dtzy -.a) q.a))) :: ++ pray - |= gen=twig ~| %pray ^- (unit twig) + |= gen=twig ~| %pray ^- twig =+ rev=(plex gen) - ?~ rev ~ - :- ~ - ?: (~(has in was) u.rev) + ?: (~(has in was) rev) ~|(%pray-loop !!) - =+ ruv=`path`(weld u.rev `path`[%hoon ~]) + =+ ruv=`path`(weld rev `path`[%hoon ~]) =+ txt=(,@ta .^(%cx ruv)) ~| ruv %+ rash txt - (ifix [gay gay] tall(was (~(put in was) u.rev), wer u.rev)) + (ifix [gay gay] tall(was (~(put in was) rev), wer rev)) :: ++ prey - |= gun=(list twig) ^- (unit twig) - ?~ gun `[~ 1] - =+ gup=(pray i.gun) - ?~ gup ~ - ?~ t.gun gup - (bind $(gun t.gun) |=(a=twig [%tsgr u.gup a])) + |= gun=(list twig) ^- twig + ?~ gun [~ 1] + ?~ t.gun (pray i.gun) + [%tsgr (pray i.gun) $(gun t.gun)] :: ++ phax |= ruw=(list (list beer)) @@ -8915,7 +8911,7 @@ [%dtkt %dtzz %$ %cx rev] ;~(plug hill rood) == - (sear prey (most ket rood)) + (cook prey (most ket rood)) == == (stag %cnzz rope) @@ -9207,7 +9203,7 @@ :~ [':' ;~(pfix col (toad expz))] [',' (rune com %zpcm expb)] [';' (rune sem %zpsm expb)] - ['^' ;~(pfix ket (sear prey (toad exps)))] + ['^' ;~(pfix ket (cook prey (toad exps)))] ['>' (rune gar %zpgr expa)] ['=' (rune tis %zpts expa)] ['?' (rune wut %zpwt hinh)] From 68ea2917ae50c2f87dc99f583f4bd7ce5d845a4b Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 24 Sep 2014 16:21:18 -0700 Subject: [PATCH 25/63] Various fixes and improvements. --- arvo/hoon.hoon | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 457f58bee..fc7889a66 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1154,7 +1154,7 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cF, signed and modular ints :: :: -++ si :: signed integer +++ si !: :: signed integer |% ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value ++ dif |= [a=@s b=@s] :: subtraction @@ -2502,9 +2502,7 @@ [zac [~ i.q.tub [zac t.q.tub]]] :: ++ sear :: conditional cook - ~/ %sear |* [pyq=_|=(* *(unit)) sef=_rule] - ~/ %fun |= tub=nail =+ vex=(sef tub) ?~ q.vex @@ -2601,9 +2599,7 @@ [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]] :: ++ stun :: parse several times - ~/ %stun |* [[les=@ mos=@] fel=_rule] - ~/ %fun |= tub=nail ^- (like (list ,_(wonk (fel)))) ?: =(0 mos) @@ -2946,8 +2942,7 @@ ?: =(inx len) & =+ cur=(cut 3 [inx 1] b) ?& ?| &((gte cur 'a') (lte cur 'z')) - &((gte cur 'A') (lte cur 'Z')) - &(&((gte cur '0') (lte cur '9')) !=(0 inx)) + &((gte cur '0') (lte cur '9')) |(=('-' cur) =('~' cur) =('_' cur) =('.' cur)) == $(inx +(inx)) @@ -4727,7 +4722,7 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2eW, lite number theory :: :: -++ egcd :: schneier's egcd +++ egcd !: :: schneier's egcd |= [a=@ b=@] =+ si =+ [c=(sun a) d=(sun b)] @@ -8468,28 +8463,36 @@ ;~(plug (star low) (star hig)) :: ++ plex - |= gen=twig ~| [%plex gen] ^- path + |= gen=twig ^- (unit path) ?: ?=([%zpcb *] gen) $(gen q.gen) - ?> ?=([%clsg *] gen) - (turn p.gen |=(a=twig ?>(?=(%dtzy -.a) q.a))) + ?. ?=([%clsg *] gen) ~ + %+ reel p.gen + |= [a=twig b=_`(unit path)`[~ u=/]] + ?~ b ~ + ?. ?=(%dtzy -.a) ~ + `[q.a u.b] :: ++ pray - |= gen=twig ~| %pray ^- twig + |= gen=twig ~| %pray ^- (unit twig) =+ rev=(plex gen) - ?: (~(has in was) rev) + ?~ rev ~ + :- ~ + ?: (~(has in was) u.rev) ~|(%pray-loop !!) - =+ ruv=`path`(weld rev `path`[%hoon ~]) + =+ ruv=`path`(weld u.rev `path`[%hoon ~]) =+ txt=(,@ta .^(%cx ruv)) ~| ruv %+ rash txt - (ifix [gay gay] tall(was (~(put in was) rev), wer rev)) + (ifix [gay gay] tall(was (~(put in was) u.rev), wer u.rev)) :: ++ prey - |= gun=(list twig) ^- twig - ?~ gun [~ 1] - ?~ t.gun (pray i.gun) - [%tsgr (pray i.gun) $(gun t.gun)] + |= gun=(list twig) ^- (unit twig) + ?~ gun `[~ 1] + =+ gup=(pray i.gun) + ?~ gup ~ + ?~ t.gun gup + (bind $(gun t.gun) |=(a=twig [%tsgr u.gup a])) :: ++ phax |= ruw=(list (list beer)) @@ -8911,7 +8914,7 @@ [%dtkt %dtzz %$ %cx rev] ;~(plug hill rood) == - (cook prey (most ket rood)) + (sear prey (most ket rood)) == == (stag %cnzz rope) @@ -9203,7 +9206,7 @@ :~ [':' ;~(pfix col (toad expz))] [',' (rune com %zpcm expb)] [';' (rune sem %zpsm expb)] - ['^' ;~(pfix ket (cook prey (toad exps)))] + ['^' ;~(pfix ket (sear prey (toad exps)))] ['>' (rune gar %zpgr expa)] ['=' (rune tis %zpts expa)] ['?' (rune wut %zpwt hinh)] From 082d8424b8b0efff62e1a6ba109c9b3fb08cb434 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 24 Sep 2014 22:44:14 -0700 Subject: [PATCH 26/63] Various fixes. --- arvo/dill.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/dill.hoon b/arvo/dill.hoon index cd7c1031f..c6c0a2a95 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -1,4 +1,4 @@ -:: +!: :: dill (4d), terminal handling :: |= pit=vase From d5b3bc82224aae406f69dc6951e51dfc7f4366cb Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 24 Sep 2014 23:08:22 -0700 Subject: [PATCH 27/63] Debug. --- arvo/dill.hoon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arvo/dill.hoon b/arvo/dill.hoon index cd7c1031f..0b9ef3778 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -523,6 +523,8 @@ bus (add let bus.u.q.q.yar) bul (add let bul.u.q.q.yar) but + ~> %slog.[%bus bus.u.q.q.yar] + ~> %slog.[%but but.u.q.q.yar] ;: weld (scag bus.u.q.q.yar but.u.q.q.yar) p.p.kyz From a1645bdc60b53b28cecd04f85e9d261c6145c590 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 24 Sep 2014 23:41:09 -0700 Subject: [PATCH 28/63] Remove bad jets etc. --- arvo/dill.hoon | 2 -- arvo/hoon.hoon | 5 ----- 2 files changed, 7 deletions(-) diff --git a/arvo/dill.hoon b/arvo/dill.hoon index 0b9ef3778..cd7c1031f 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -523,8 +523,6 @@ bus (add let bus.u.q.q.yar) bul (add let bul.u.q.q.yar) but - ~> %slog.[%bus bus.u.q.q.yar] - ~> %slog.[%but but.u.q.q.yar] ;: weld (scag bus.u.q.q.yar but.u.q.q.yar) p.p.kyz diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index fc7889a66..a0252c7a6 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -3463,7 +3463,6 @@ rex :- '.' =>(.(rex $(esc t.esc)) ((x-co 4) i.esc)) - :: ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c]))) ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c]))) @@ -3471,10 +3470,8 @@ ++ y-co |=(dat=@ ((d-co 2) dat)) ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)]) -- - ~% %co +> ~ |% ++ em-co - ~/ %emco |= [[bas=@ min=@] [par=$+([? @ tape] tape)]] |= hol=@ ^- tape @@ -3488,7 +3485,6 @@ == :: ++ ox-co - ~/ %oxco |= [[bas=@ gop=@] dug=$+(@ @)] %+ em-co [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0] @@ -3501,7 +3497,6 @@ |=([? b=@ c=tape] [(dug b) c]) :: ++ ro-co - ~/ %roco |= [[buz=@ bas=@ dop=@] dug=$+(@ @)] |= hol=@ ^- tape From 76be589e15f4a3396652449b6f0ee4fd9e0260cb Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 26 Sep 2014 12:07:35 -0700 Subject: [PATCH 29/63] Stuff and nonsense. --- try/bin/profile.hoon | 71 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 try/bin/profile.hoon diff --git a/try/bin/profile.hoon b/try/bin/profile.hoon new file mode 100644 index 000000000..ac452dd61 --- /dev/null +++ b/try/bin/profile.hoon @@ -0,0 +1,71 @@ +|% +++ doss + $: sap=,@ud :: sample count + hit=(map term ,@ud) :: hit points + cut=(map span hump) :: cut points + == +:: +++ hump + $: sap=,@ud :: sample count + inn=(map span ,@ud) :: calls into + out=(map span ,@ud) :: calls out of + == +:: +++ pi + |_ day=doss + ++ heck :: report event + |= [nam=@tas day=doss] + ^- day + =+ lam=(~(get by hit.day) nam) + day(hit (~(put by hit.day) ?~(lam 1 +(u.lam)))) + :: + ++ noon :: sample trace + |= pax=path + =| lax=(unit span) + |- ^- day + ?~ pax day(sap +(sap.day)) + %= $ + pax t.pax + lax `i.pax + cut.day + %+ ~(put by cut.day) i.pax + ^- hump + =+ nax=`(unit span)`?~(t.pax ~ `i.t.pax) + =+ hup=`hump`=+(hup=(~(get by cut) i.pax) ?^(hup u.hup [0 ~ ~])) + :+ +(sap.hup) + ?~ lax inn.hup + =+(hag=(~(get by inn.hup) u.lax) ?~(hag 1 +(u.hag))) + ?~ nax out.hup + =+(hag=(~(get by out.hup) u.nax) ?~(hag 1 +(u.hag))) + == + :: + ++ tell + ^- (list tape) + ;: welp + ^- (list tape) + [(welp "events: " (scow %ud sap.day)) ~] + :: + ^- (list tape) + %+ turn + (~(tap by hit.day) ~) + |= [nam=term num=@ud] + :(welp (trip nam) ": " (scow %ud num)) + :: + ^- (list tape) + %+ turn + (~(tap by cut.day) ~) + |= [nam=term hup=hump] + ;: welp + + == + events: num + coverage: num + hits: + hit point ,@uder + humps: + name rating + fanouts rating + + + -- +-- From 941a7c9f3fc0735ef25dadd5aaabb9588de9898c Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 26 Sep 2014 12:34:06 -0700 Subject: [PATCH 30/63] Moar profile. --- try/bin/profile.hoon | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/try/bin/profile.hoon b/try/bin/profile.hoon index ac452dd61..d10644c96 100644 --- a/try/bin/profile.hoon +++ b/try/bin/profile.hoon @@ -39,7 +39,7 @@ =+(hag=(~(get by out.hup) u.nax) ?~(hag 1 +(u.hag))) == :: - ++ tell + ++ tell :: produce dump ^- (list tape) ;: welp ^- (list tape) @@ -50,22 +50,35 @@ (~(tap by hit.day) ~) |= [nam=term num=@ud] :(welp (trip nam) ": " (scow %ud num)) + ["" ~] :: ^- (list tape) + %- welp %+ turn (~(tap by cut.day) ~) |= [nam=term hup=hump] + ^- (list tape) ;: welp - + [(welp "sector: " (trip nam)) ~] + :: + [(welp "weight: " (div (mul 1.000 sap.hup) sap.day)) ~] + :: + ["inn:" ~] + :: + %+ turn + (~(tap by inn.hup) ~) + |= [nam=term num=@ud] + ^- tape + :(welp " " (trip nam) ": " (scow %ud num)) + :: + ["out:" ~] + :: + %+ turn + (~(tap by out.hup) ~) + |= [nam=term num=@ud] + ^- tape + :(welp " " (trip nam) ": " (scow %ud num)) + == == - events: num - coverage: num - hits: - hit point ,@uder - humps: - name rating - fanouts rating - - -- -- From cffc2a545cdd923fdb481a3cb52297b146325a01 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 26 Sep 2014 13:23:27 -0700 Subject: [PATCH 31/63] Add simple profiling state. --- arvo/hoon.hoon | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 1527569c2..1dc10c471 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -9542,6 +9542,86 @@ |= txt=@ta ^- twig (rash txt wide:vast) +:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::: :::::: profiling support; move me :::::: +:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: +++ doss + $: sap=@ud :: sample count + hit=(map term ,@ud) :: hit points + cut=(map span hump) :: cut points + == +:: +++ hump + $: sap=@ud :: sample count + inn=(map span ,@ud) :: calls into + out=(map span ,@ud) :: calls out of + == +:: +++ pi-heck + |= [nam=@tas day=doss] + ^- doss + =+ lam=(~(get by hit.day) nam) + day(hit (~(put by hit.day) nam ?~(lam 1 +(u.lam)))) +:: +++ pi-noon :: sample trace + |= [pax=path day=doss] + =| lax=(unit span) + |- ^- doss + ?~ pax day(sap +(sap.day)) + %= $ + pax t.pax + lax `i.pax + cut.day + %+ ~(put by cut.day) i.pax + ^- hump + =+ nax=`(unit span)`?~(t.pax ~ `i.t.pax) + =+ hup=`hump`=+(hup=(~(get by cut.day) i.pax) ?^(hup u.hup [0 ~ ~])) + :+ +(sap.hup) + ?~ lax inn.hup + =+ hag=(~(get by inn.hup) u.lax) + (~(put by inn.hup) u.lax ?~(hag 1 +(u.hag))) + ?~ nax out.hup + =+ hag=(~(get by out.hup) u.nax) + (~(put by out.hup) u.nax ?~(hag 1 +(u.hag))) + == +:: +++ pi-tell :: produce dump + |= day=doss + ^- (list tape) + ;: welp + [(welp "events: " (scow %ud sap.day)) ~] + :: + %+ turn + (~(tap by hit.day) ~) + |= [nam=term num=@ud] + :(welp (trip nam) ": " (scow %ud num)) + ["" ~] + :: + %- zing + ^- (list (list tape)) + %+ turn + (~(tap by cut.day) ~) + |= [nam=term hup=hump] + ;: welp + [(welp "sector: " (trip nam)) ~] + [(welp "weight: " (scow %ud (div (mul 1.000 sap.hup) sap.day))) ~] + ["inn:" ~] + :: + %+ turn + (~(tap by inn.hup) ~) + |= [nam=term num=@ud] + ^- tape + :(welp " " (trip nam) ": " (scow %ud num)) + :: + ["out:" ~] + :: + %+ turn + (~(tap by out.hup) ~) + |= [nam=term num=@ud] + ^- tape + :(welp " " (trip nam) ": " (scow %ud num)) + == + == -- :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: :::::: volume 3, Arvo models and skeleton :::::: From 615cb19c21f4d9cc6c7767c4bb0f4417fc82005e Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 26 Sep 2014 19:17:43 -0700 Subject: [PATCH 32/63] Profiling, sorta. --- arvo/hoon.hoon | 92 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 7 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index fc7889a66..61e83a441 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -3438,6 +3438,7 @@ %t ?: =('a' hay) ?: =('s' (cut 3 [2 1] p.p.lot)) + (weld (rip 3 q.p.lot) rex) ['~' '.' (weld (rip 3 q.p.lot) rex)] ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)] @@ -3463,7 +3464,6 @@ rex :- '.' =>(.(rex $(esc t.esc)) ((x-co 4) i.esc)) - :: ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c]))) ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c]))) @@ -3471,10 +3471,8 @@ ++ y-co |=(dat=@ ((d-co 2) dat)) ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)]) -- - ~% %co +> ~ |% ++ em-co - ~/ %emco |= [[bas=@ min=@] [par=$+([? @ tape] tape)]] |= hol=@ ^- tape @@ -3488,7 +3486,6 @@ == :: ++ ox-co - ~/ %oxco |= [[bas=@ gop=@] dug=$+(@ @)] %+ em-co [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0] @@ -3501,7 +3498,6 @@ |=([? b=@ c=tape] [(dug b) c]) :: ++ ro-co - ~/ %roco |= [[buz=@ bas=@ dop=@] dug=$+(@ @)] |= hol=@ ^- tape @@ -8907,11 +8903,13 @@ ;~ pfix ket ;~ pose ;~ pfix col - %+ cook + %+ sear |= [a=tile b=twig] :: XX shd be static =+ rev=(plex b) + ?~ rev ~ + %- some :+ %smsm ~(clam al a) - [%dtkt %dtzz %$ %cx rev] + [%dtkt %dtzz %$ %cx u.rev] ;~(plug hill rood) == (sear prey (most ket rood)) @@ -9544,6 +9542,86 @@ |= txt=@ta ^- twig (rash txt wide:vast) +:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::: :::::: profiling support; move me :::::: +:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: +++ doss + $: sap=@ud :: sample count + hit=(map term ,@ud) :: hit points + cut=(map span hump) :: cut points + == +:: +++ hump + $: sap=@ud :: sample count + inn=(map span ,@ud) :: calls into + out=(map span ,@ud) :: calls out of + == +:: +++ pi-heck !: + |= [nam=@tas day=doss] + ^- doss + =+ lam=(~(get by hit.day) nam) + day(hit (~(put by hit.day) nam ?~(lam 1 +(u.lam)))) +:: +++ pi-noon !: :: sample trace + |= [pax=path day=doss] + =| lax=(unit span) + |- ^- doss + ?~ pax day(sap +(sap.day)) + %= $ + pax t.pax + lax `i.pax + cut.day + %+ ~(put by cut.day) i.pax + ^- hump + =+ nax=`(unit span)`?~(t.pax ~ `i.t.pax) + =+ hup=`hump`=+(hup=(~(get by cut.day) i.pax) ?^(hup u.hup [0 ~ ~])) + :+ +(sap.hup) + ?~ lax inn.hup + =+ hag=(~(get by inn.hup) u.lax) + (~(put by inn.hup) u.lax ?~(hag 1 +(u.hag))) + ?~ nax out.hup + =+ hag=(~(get by out.hup) u.nax) + (~(put by out.hup) u.nax ?~(hag 1 +(u.hag))) + == +:: +++ pi-tell !: :: produce dump + |= day=doss + ^- (list tape) + ;: welp + [(welp "events: " (scow %ud sap.day)) ~] + :: + %+ turn + (~(tap by hit.day) ~) + |= [nam=term num=@ud] + :(welp (trip nam) ": " (scow %ud num)) + ["" ~] + :: + %- zing + ^- (list (list tape)) + %+ turn + (~(tap by cut.day) ~) + |= [nam=term hup=hump] + ;: welp + [(welp "sector: " (trip nam)) ~] + [(welp "weight: " (scow %ud (div (mul 1.000 sap.hup) sap.day))) ~] + ["inn:" ~] + :: + %+ turn + (~(tap by inn.hup) ~) + |= [nam=term num=@ud] + ^- tape + :(welp " " (trip nam) ": " (scow %ud num)) + :: + ["out:" ~] + :: + %+ turn + (~(tap by out.hup) ~) + |= [nam=term num=@ud] + ^- tape + :(welp " " (trip nam) ": " (scow %ud num)) + == + == -- :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: :::::: volume 3, Arvo models and skeleton :::::: From 81b5ab0c496e7a1e4900f68d4ef7629db8dbb22e Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 27 Sep 2014 16:17:09 -0700 Subject: [PATCH 33/63] Moar sane. --- arvo/lunt.hoon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arvo/lunt.hoon b/arvo/lunt.hoon index 7244bf44d..fa0bee89c 100644 --- a/arvo/lunt.hoon +++ b/arvo/lunt.hoon @@ -21,10 +21,11 @@ ++ home :: storage access $: pad=@uvH :: passcode huc=husk :: log server - + sog=hulk :: == :: ++ hulk :: checkpoint service - $% [%astr p= + $% [%astr p=@ud q=@ud] :: S3 + == :: ++ husk :: log server $: pro=@tas :: protocol cap=@uvH :: access code From b348147a4ddf28f2fb82daee01ea157406b3ec8d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 29 Sep 2014 14:56:09 -0700 Subject: [PATCH 34/63] Fixed headless hook transform --- main/mar/hook/door.hook | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/mar/hook/door.hook b/main/mar/hook/door.hook index 22f2998a0..6e235b49a 100644 --- a/main/mar/hook/door.hook +++ b/main/mar/hook/door.hook @@ -6,7 +6,8 @@ :: ++ grow :: convert to |% - ++ mime [/text/html (taco own)] :: convert to %mime - ++ hymn ;div:(pre:"{(trip own)}") :: convert to %html + ++ mime [/text/hoon (taco own)] :: convert to %mime + ++ psal ;div:(pre:"{(trip own)}") :: convert to %html + ++ hymn ;html:(head:title:"Source" "+{psal}") -- -- From 56abfcfdbd062ef9a77d4fde6b0bc8cdcd6addfe Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 29 Sep 2014 19:50:50 -0700 Subject: [PATCH 35/63] Backported h.h comment refinements --- arvo/hoon.hoon | 30 +- main/pub/src/doc/ref/vol/1.md | 4401 +++++++++++---------------------- 2 files changed, 1497 insertions(+), 2934 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 1dc10c471..acb1a7681 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -31,11 +31,11 @@ ++ bean ,? :: 0=&=yes, 1=|=no ++ beer $|(@ [~ p=twig]) :: simple embed ++ beet $| @ :: advanced embed - $% [%a p=twig] :: - [%b p=twig] :: - [%c p=twig] :: - [%d p=twig] :: - [%e p=twig q=(list tuna)] :: + $% [%a p=twig] :: take tape + [%b p=twig] :: take manx + [%c p=twig] :: take marl + [%d p=twig] :: take $+(marl marl) + [%e p=twig q=(list tuna)] :: element literal == :: ++ bloq ,@ :: blockclass ++ calf ,[p=(map ,@ud wine) q=wine] :: @@ -155,8 +155,8 @@ p=[p=tape q=tape r=tape s=tape] :: q=(list tank) :: == :: - $: %rose :: - p=[p=tape q=tape r=tape] :: + $: %rose :: delimeted list + p=[p=tape q=tape r=tape] :: mid open close q=(list tank) :: == :: == @@ -327,9 +327,9 @@ ++ tyre (list ,[p=term q=twig]) :: ++ tyke (list (unit twig)) :: ++ tram (list ,[p=wing q=twig]) :: -++ tone $% [%0 p=*] :: - [%1 p=(list)] :: - [%2 p=(list ,[@ta *])] :: +++ tone $% [%0 p=*] :: success + [%1 p=(list)] :: blocks + [%2 p=(list ,[@ta *])] :: error ~_s == :: :: :::::: virtual nock ++ nock $& [p=nock q=nock] :: autocons @@ -346,15 +346,15 @@ [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint [%11 p=nock] :: grab data from sky == :: -++ toon $% [%0 p=*] :: - [%1 p=(list)] :: - [%2 p=(list tank)] :: +++ toon $% [%0 p=*] :: success + [%1 p=(list)] :: blocks + [%2 p=(list tank)] :: stack trace == :: ++ tune $% [%0 p=vase] :: [%1 p=(list)] :: [%2 p=(list ,[@ta *])] :: == :: -++ twin ,[p=term q=wing r=axis s=type] :: +++ twin ,[p=term q=wing r=axis s=type] :: alias info ++ type $| ?(%noun %void) :: set all or set none $% [%atom p=term] :: number and format [%bull p=twin q=type] :: wing synonym @@ -419,7 +419,7 @@ ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) :: :: :: :: :: -++ map |* [a=_,* b=_,*] :: associative array +++ map |* [a=_,* b=_,*] :: associative tree $|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) :: ++ qeu |* a=_,* :: queue $|(~ [n=a l=(qeu a) r=(qeu a)]) :: diff --git a/main/pub/src/doc/ref/vol/1.md b/main/pub/src/doc/ref/vol/1.md index ab08366e3..3465e5502 100644 --- a/main/pub/src/doc/ref/vol/1.md +++ b/main/pub/src/doc/ref/vol/1.md @@ -5,612 +5,1064 @@ XX Introduction/overview of structures goes here. --- -###abel +###++abel - ++ abel typo :: original sin: type +``` +++ abel typo :: original sin: type +``` -Aliases ++typo. [#typo] -Used for changing ++type, which contains twigs and consequently all rune structures +Biblical names in hoon are primarily aliases for the compiler. + +See also: `++typo` + + ~zod/try=> *abel + %void --- -###axis +###++axis - ++ axis ,@ :: tree address +``` +++ axis ,@ :: tree address +``` -A Nock axis, an address inside a Nock noun. -Clammed atom [#axil]. +A Nock axis inside a noun. After the leading 1, in binary, a 1 signfies right +and 0 left. + +See also: `++clue`, `++limb`, `++slot`, `++peg`, and Section 2fC + + ~zod/try=> *axis + 0 + + ~zod/try=> :: 0 is not actually a valid axis + ~zod/try=> [[4 5] 6 7] + [[4 5] 6 7] + ~zod/try=> `axis`0b110 + 6 --- -###also +###++also + +``` +++ also ,[p=term q=wing r=type] :: alias +``` - ++ also ,[p=term q=wing r=type] :: alias XX unused? --- -###base +###++base - ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~ +``` +++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~ +``` -The cases of an %axil tile [#tile]. -See %axil in ++tile. +A base type that nouns are built from. Either a noun, a cell, loobean or null +labelled with an odor. + +See also: `++tile`, `++twig` + + ~zod/try=> *base + %null + + ~zod/try=> (ream '=|(^ !!)') + [%tsbr p=[%axil p=%cell] q=[%zpzp ~]] + ~zod/try=> :: p.p is a ++base + ~zod/try=> (ream '=|(@t !!)') + [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]] + ~zod/try=> (ream '=|(? !!)') + [%tsbr p=[%axil p=%bean] q=[%zpzp ~]] --- -###beer +###++bean - ++ beer $|(@ [~ p=twig]) :: simple embed +``` +++ bean ,? :: 0=&=yes, 1=|=no +``` -A literal cord, or a twig producing a tape. -Used in ++phax and ++scat to build tapes, section 2fD +The Urbit version of a boolean, which we call a loobean. 0 or & is "yes", 1 or +| is "no". + + ~zod/try=> *bean + %.y + + ~zod/try=> `bean`& + %.y + ~zod/try=> `bean`| + %.n --- -###beet +###++beer - ++ beet $| @ :: advanced embed - $% [%a p=twig] :: - [%b p=twig] :: - [%c p=twig] :: - [%d p=twig] :: - [%e p=twig q=(list tuna)] :: - == :: +``` +++ beer $|(@ [~ p=twig]) :: simple embed +``` -A literal cord, or a twig producing xml of some form. -Used in ++sail xml interpolation, section 2fD +Used to build tapes internally. + +See also: `++phax`, `++scat`, section 2fD + + ~zod/try=> `beer`'as' + 29.537 + ~zod/try=> `beer`[~ (ream 'lan')] + [~ p=[%cnzz p=~[%lan]]] + --- -###bloq +###++beet - ++ bloq ,@ :: blockclass +``` +++ beet $| @ :: advanced embed + $% [%a p=twig] :: take tape + [%b p=twig] :: take manx + [%c p=twig] :: take marl + [%d p=twig] :: take $+(marl marl) + [%e p=twig q=(list tuna)] :: element literal + == :: +``` -An atom representing a blocksize, by convention expressed as a power of 2. -Used throughout section 2cA: bit surgery. +Cases for XML interpolation. Used internally. -Clammed atom [#axil]. +See also: `++sail`, section 2fD -++met measures how many bloqs long an atom is. It takes a bloq -and an atom. In the below example, the 256 is 2 bloqs of 2^3 long. That -is, it takes two bytes to represent the atom 256 +--- - ~zod/try=> (met 3 256) +###++bloq + +``` +++ bloq ,@ :: blockclass +``` + + +Atom representing a blocksize, by convention expressed as a power of 2. + +See also: section 2cA + + ~zod/try=> :: ++met measures how many bloqs long an atom is + ~zod/try=> (met 3 256) 2 + ~zod/try=> :: 256 is 2 bloqs of 2^3 --- -###calf +###++calf - ++ calf ,[p=(map ,@ud wine) q=wine] :: +``` +++ calf ,[p=(map ,@ud wine) q=wine] :: +``` -Type encoding cyclical backreferences -Produced by ++dole, consumed by ++doge and ++dish, section 2fC +Encodes cyclical backreferences in types. Used in pretty printing. -See [#wine] +See also: `++wine`, `++dole`, `++doge`, `++dish`, section 2fC + + ~zod/try=> `calf`[~ %atom %ta] + [p={} q=[%atom p=%ta]] + + ~zod/try=> `calf`~(dole ut p:!>(*^)) + [p={} q=[%plot p=~[%noun %noun]]] + + ~zod/try=> `calf`~(dole ut p:!>($:|-(?(~ [* $])))) + [ p={[p=1 q=[%pick p=~[[%pear p=%n q=0] [%plot p=~[%noun [%stop p=1]]]]]]} + q=[%stop p=1] + ] --- -###char +###++char - ++ char ,@tD :: UTF-8 byte +``` +++ char ,@tD :: UTF-8 byte +``` -A single character. -Used in ++tape string type, its parsing in chapter 2f: -++lust, ++just, ++mask, ++next, and ++hit +A single character. Odor `@tD` designates a single Unicode byte. All parsers +consume `++tape` (a list of `++char`). -Atom with odor [#type]. A @tD is a single Unicode byte. +See also: `++tape`, `++lust`, `++just`, `++mask`, chapter 2f -++tape [#tape], which is a string type, is a list of chars. + ~zod/try=> *char + ~~ + + ~zod/try=> (char 97) + ~~a --- -###chub +###++chub - ++ chub :: registered battery - $: p=(pair chum tyre) :: definition - q=* :: battery - r=(unit (pair axis chub)) :: parent - == +``` +++ chub :: registered battery + $: p=(pair chum tyre) :: definition + q=* :: battery + r=(unit (pair axis chub)) :: parent + == :: +``` -Used (implicitly?) by compiler to attach jets, section 2fB. -Also used in :haus to make chat messages fly faster(???) + +Used by the compiler (implicitly by `%sgcn`) to attach jets. + +See also: Section 2fB. --- -###chum +###++chum - ++ chum $? lef=term :: jet name - [std=term kel=@] :: kelvin version - [ven=term pro=term kel=@] :: vendor and product - [ven=term pro=term ver=@ kel=@] :: all of the above - == :: +``` +++ chum $? lef=term :: jet name + [std=term kel=@] :: kelvin version + [ven=term pro=term kel=@] :: vendor and product + [ven=term pro=term ver=@ kel=@] :: all of the above + == :: +``` -The jet hint information that must be present in the body of a ~/ -or ~% rune. -Appears in ++twig and ++clue +Jet hint information that must be present in the body of a ~/ or ~% rune. +A `++chum` can optionally contain a kelvin version, jet vendor, and +major.minor version number. -A %fern of the following cases: +XX there's a ++chum in zuse that's politely causing this not to work -- the jet's name -- the jet's name and the kelvin number -- the jet's vendor, name and kelvin number -- the jet's vendor, name, legacy major.minor version and kelvin number +See also: `++twig`, `++clue` + + ~zod/try=> `chum`'hi' + lef=%hi + + ~zod/try=> (ream '~/(%lob.314 !!)') + [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]] + --- -###claw +###++clue - ++ claw - XX unused? +``` +++ clue ,[p=axis q=chum r=tyre] :: battery definition +``` + + +Used by compiler to attach jets. + +XX implementation does not currenlty match docs + +See also: section 2fB --- -###clue +###++coil - ++ clue ,[p=axis q=chum r=tyre] :: battery definition +``` +++ coil $: p=?(%gold %iron %lead %zinc) :: core type + q=type :: + r=[p=?(~ ^) q=(map term foot)] :: + == :: +``` -Used by compiler to attach jets, section 2fB XX implementation does not currenlty match docs + +Core information tuple: variance, subject type, optional compiled nock, and +arms. Used as an intermediate step within Section 2fB. Converted by `++core` to +%core type. + +See also: `++core`, Section 2fB --- -###coat +###++coin - ++ coat ,[p=path q=vase] :: +``` +++ coin $% [%$ p=dime] :: + [%blob p=*] :: + [%many p=(list coin)] :: + == :: +``` -Used nowhere, shadowed in 4aG XX ---- +Noun literal syntax cases: atoms, jammed nouns, and nestable tuples. Parsed and +printed using `++so` and `++co` cores in Section 2eL respectively. -###coil +See also: `++so`, `++co`, Section 2eL, `++dime` - ++ coil $: p=?(%gold %iron %lead %zinc) :: - q=type :: - r=[p=?(~ ^) q=(map term foot)] :: - == :: + ~zod/try=> `coin`(need (slay '~s1')) + [%$ p=[p=~.dr q=18.446.744.073.709.551.616]] + ~zod/try=> `coin`(need (slay '0x2b59')) + [%$ p=[p=~.ux q=11.097]] + + ~zod/try=> ~(rend co [%many ~[[%$ %ud 1] [%$ %tas 'a'] [%$ %s -2]]]) + "._1_a_-2__" + ~zod/try=> ._1_a_-2__ + [1 %a -2] -Core. XX - -Variance, type, and arms XX - -Generated somehwere in ++vast XX -Converted by ++core to %core twig - ---- - -###coin - - ++ coin $% [%$ p=dime] :: - [%blob p=*] :: - [%many p=(list coin)] :: - == :: - -Literal syntax primitive XX - -Used to parse and print e.g. `0x2b59` or `~s1`, ++so and ++co -in section 2eL respectively + ~zod/try=> `@uv`(jam [3 4]) + 0v2cd1 + ~zod/try=> (slay '~02cd1') + [~ [%blob p=[3 4]]] + ~zod/try=> ~02cd1 + [3 4] --- -###cord +###++cord - ++ cord ,@t :: text atom (UTF-8) +``` +++ cord ,@t :: text atom (UTF-8) +``` -One of Hoon's two string types (the other being ++tape). A cord is an -atom of UTF-8 text. -Used everywhere XX -Notably, ++trip and ++crip convert between cord and ++tape +One of Hoon's two string types (the other being `++tape`). A cord is an +atom of UTF-8 text. `++trip` and `++crip` convert between cord and `++tape` -Atom with odor. @t is a Unicode atom. The order of bytes in a @t are -little-endian, i.e. the first character in the text is the low byte of -the atom. +Odor `@t` designates a Unicode atom, little-endian: the first character in the +text is the low byte. + +See also: `++trip`, `++crip`, Section 2eJ ~zod/try=> `@ux`'foobar' 0x7261.626f.6f66 ---- - -###date - - ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date - -A point in time. - -Converted to/from @d using ++year/++yore in section 2cH, -Parsed/printed as UTC by ++stud/++dust in section 3bc - -A loobean designating AD or BC, a year atom, a month atom, and a ++tarp, which -is a day atom and a time. - -++yell produces a ++date from a @da (a date atom) - - ~zod/try=> (yell ~2014.6.6..21.09.15..0a16) - [d=106.751.991.820.172 h=21 m=9 s=15 f=~[0xa16]] + ~zod/try=> `@`'urbit' + 499.984.265.845 + ~zod/try=> (cord 499.984.265.845) + 'urbit' --- -###dime +###++date - ++ dime ,[p=@ta q=@] :: +``` +++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date +``` -Odor-atom pair, used in ++so/++co, section 2eL + +A point in time. A loobean designating AD or BC, a year atom, a month atom, +and a `++tarp`, which is a day atom and a time. + +See also: `++year`, `++yore`, Section 2cH, `++stud`, `++dust`, Section 3bc + + ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16) + [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]] --- -### dram +###++dime - ++ dram $% [| p=(map ,@tas dram)] :: simple unix dir - [& p=@ud q=@] :: +``` +++ dime ,[p=@ta q=@] :: +``` -The structure of a unix filesystem tree. -One of two cases: +Odor-atom pair, used in `++coin`. -- `|` a directory - a map of names to deeper tree structures. -- `&` a file - a numbered atom of data. +Convenience methods `++scot` and `++scow` (in Section 2eL) print dimes as +cords/tapes, `++slat`, `++slav`, and `++slaw` are used to parse atoms of +specific odor. -Cards %dire and %pour in zuse require a ++dram argument to target. +See also: `++so`, `++co`, Section 2eL, `++coin` + + ~zod/try=> +>:(slay '0x123') + p=[p=~.ux q=291] --- -###each +###++dram - ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: +``` +++ dram $% [| p=(map ,@tas dram)] :: simple unix dir + [& p=@ud q=@] :: + == :: +``` -Dicriminated fork between two types XX -Used everywhere XX +The structure of a unix filesystem tree. A `++dram` is one of two cases: `|` a directory - a map of names to deeper tree structures, `&` a file - a numbered atom of data. + +XX Unused --- -###edge +###++each + +``` +++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b +``` + + +Tile generator: produces a dicriminated fork between two types. + + ~zod/try=> :type; *(each cord time) + [%.y p=''] + {[%.y p=@t] [%.n p=@da]} + +--- + +###++edge + +``` +++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output +``` - ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output -Half-parsed tape with location metadata XX +Parsing location metadata: optional result and parsing continuation. -Used in all section 2eD: combinators, and implicitly everywhere a ++rule is used. +See also: Section 2eD, `++rule` + + ~zod/try=> *edge + [p=[p=0 q=0] q=~] + ~zod/try=> (tall:vast [1 1] "a b") + [p=[p=1 q=2] q=[~ [p=[%cnzz p=~[%a]] q=[p=[p=1 q=2] q=" b"]]]] --- -###foot +###++foot - ++ foot $% [%ash p=twig] :: dry arm, geometric - [%elm p=twig] :: wet arm, generic - [%oak ~] :: XX not used - [%yew p=(map term foot)] :: XX not used - == :: +``` +++ foot $% [%ash p=twig] :: dry arm, geometric + [%elm p=twig] :: wet arm, generic + [%oak ~] :: XX not used + [%yew p=(map term foot)] :: XX not used + == :: +``` -Arm with wetness XX -Used in ++ap to compile cores and ++ut to type-check them, sections 2fB and 2fC +Cases of arms by variance model. + +See also: `++ap`, `++ut`, Section 2fB, Section 2fC + + ~zod/try=> *foot + [%yew p={}] + + ~zod/try=> (ream '|% ++ $ foo --') + [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}] + ~zod/try=> +<+:(ream '|% ++ $ foo --') + t=~[%ash %cnzz %foo] + ~zod/try=> (foot +<+:(ream '|% ++ $ foo --')) + [%ash p=[%cnzz p=~[%foo]]] + ~zod/try=> (foot +<+:(ream '|% +- $ foo --')) + [%elm p=[%cnzz p=~[%foo]]] --- -###gate +###++gate - ++ gate $+(* *) :: general gate +``` +++ gate $+(* *) :: general gate +``` -Used everywhere XX + +An core with one arm, `$`, which transforms a sample noun into a product noun. If used dryly as a type, subject must have a sample type of `*`. + +See also: `++lift`, `++cork`, Core Language Doc + + ~zod/try=> *gate + <1|mws [* <101.jzo 1.ypj %164>]> + ~zod/try=> `gate`|=(* 0) + <1|mws [* <101.jzo 1.ypj %164>]> + + ~zod/try=> (|=(a=* [a 'b']) 'c') + [99 'b'] + ~zod/try=> (`gate`|=(a=* [a 'b']) 'c') + [99 98] --- -### gear +###++hair - ++ gear |* a=_,* :: XX list generator - $_ :: - =| b=* :: - |? :: - ?@ b :: - ~ :: - [i=(a -.b) t=^?(..$(b +.b))] :: +``` +++ hair ,[p=@ud q=@ud] :: parsing trace +``` -Unused. - 1 ---- -###hair +A pair of two `@ud` used in parsing indicating line and column number. - ++ hair ,[p=@ud q=@ud] :: parsing trace +See also: `++last`, Section 2eB -Line and column number. + ~zod/try=> *hair + [p=0 q=0] -Used to track position in parsing, ++last in section 2eB + ~zod/try=> `hair`[1 1] :: parsing starts at [1 1] as a convention. + [p=1 q=1] + ~zod/try=> ((plus ace) [1 1] " --") + [p=[p=1 q=4] q=[~ u=[p=[~~. " "] q=[p=[p=1 q=4] q="--"]]]] + ~zod/try=> `hair`p:((plus ace) [1 1] " --") + [p=1 q=4] --- -###hapt +###++like - ++ hapt (list ,@ta) :: XX not used +``` +++ like |* a=_,* :: generic edge + |= b=_`*`[(hair) ~] :: + :- p=(hair -.b) :: + ^= q :: + ?@ +.b ~ :: + :- ~ :: + u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] :: +``` ---- - -###like - - ++ like |* a=_,* :: generic edge - |= b=_`*`[(hair) ~] :: - :- p=(hair -.b) :: - ^= q :: - ?@ +.b ~ :: - :- ~ :: - u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] :: -Type to "parser to that type" type XX +Tile generator for an `++edge`. `++like` generates an `++edge` with a parsed result set to a specific type. -Used for funky vulcan stuff: primitives ++easy, ++just/++jest, ++knee, ++mask, -++shim, ++stir, ++stun in section 2eC +See also: `++easy`, `++just`/`++jest`, `++knee`, `++mask`, `++shim`, `++stir`, `++stun`, Section 2eC + + ~zod/try=> *(like char) + [p=[p=0 q=0] q=~] + + ~zod/try=> (ace [1 1] " a") + [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]] + ~zod/try=> `(like char)`(ace [1 1] " a") + [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]] + ~zod/try=> `(like ,@)`(ace [1 1] " a") + [p=[p=1 q=2] q=[~ [p=32 q=[p=[p=1 q=2] q="a"]]]] + --- -###limb +###++limb + +``` +++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) :: +``` + +XX move to `++ut` ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) :: Reference into subject by name/axis -Used in compilation and grammar, section 2fC-2fD +See also: section 2fC-2fD + + ~zod/try=> (ream '^^$') + [%cnzz p=~[[%.n p=2 q=%$]]] + ~zod/try=> (limb &2:(ream '^^$')) + [%.n p=2 q=%$] + ~zod/try=> (limb &2:(ream '^^^$')) + [%.n p=3 q=%$] --- -###line +###++line + +``` +++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case +``` + +XX move to `++ut` ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case Dicriminated union unionee XX Used in compilation and grammar, section 2fC-2fD + + ~zod/try=> (ream '$%([1 a] [%2 b])') + [ %bccm + p + [ %kelp + p + [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]] + t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]] + ] + ] + ] + ~zod/try=> &3:(ream '$%([1 a] [%2 b])') + p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]] + ~zod/try=> (line &3:(ream '$%([1 a] [%2 b])')) + [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]] --- -###list +###++list - ++ list |* a=_,* :: null-term list - $|(~ [i=a t=(list a)]) :: +``` +++ list |* a=_,* :: null-term list + $|(~ [i=a t=(list a)]) :: +``` -Used everywhere XX -Frequently through the helper gates in section 2bB + +Tile generator. `++list` generates a tile of a null-termanated list of homogenous type. + +See also: `++turn`, `++snag`, section 2bB. + + ~zod/try=> *(list) + ~ + ~zod/try=> `(list ,@)`"abc" + ~[97 98 99] + ~zod/try=> (snag 0 "abc") + ~~a --- -###lone +###++lone + +``` +++ lone |*(a=$+(* *) ,p=a) :: just one thing +``` + +XX unused ++ lone |*(a=$+(* *) ,p=a) :: just one thing -Used nowhere XX +Tile generator. `++lone` puts face of `p` on something. --- -###mane +###++mane - ++ mane $|(@tas [@tas @tas]) :: XML name/space +``` +++ mane $|(@tas [@tas @tas]) :: XML name/space +``` -Parsed by ++name:xmlp, rendered by ++xmln, section 3bD + +An XML name (tag name or attribute name) with an optional namespace. Parsed by `++name`:xmlp, rendered by `++xmln`. + +See also: `++sail` doc, Section 3bD + + ~zod/try=> *mane + %$ + + ~zod/try=> `mane`n.g:`manx`;div:namespace; + %div + ~zod/try=> `mane`n.g:`manx`;div_namespace; + [%div %namespace] --- -###manx +###++manx - ++ manx ,[g=marx c=marl] :: XML node +``` +++ manx ,[g=marx c=marl] :: XML node +``` -Top level xml node. -Parsed by ++apex:xmlp, rendered by ++xmlt, section 3bD +XML node. + +Parsed by `++apex`:xmlp, rendered by `++xmlt`, section 3bD + +See also: `++sail` doc, Section 3bD --- -###marl +###++marl - ++ marl (list manx) :: XML node list +``` +++ marl (list manx) :: XML node list +``` -Parsed within ++apex:xmlp, rendered by ++xmll, section 3bD + +List of XML nodes. + +Parsed within `++apex`:xmlp, rendered by `++xmll`, section 3bD + +See also: `++sail` doc --- -###mars +###++mars - ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata +``` +++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata +``` -,_:/(tape), used nowhere XX should be in ++chrd:xmlp -Is a valid ++manx +XML CDATA. Implicitly produced by `++chrd`:xmlp + +See also: `++sail` doc --- -###mart +###++mart - ++ mart (list ,[n=mane v=tape]) :: XML attributes +``` +++ mart (list ,[n=mane v=tape]) :: XML attributes +``` -Parsed by ++attr:xmlp, rendered by ++xmla, section 3bD + +List of XML attributes. Each `++mart` is a list of pairs of `++mane` and `++tape`. + +Parsed by `++attr`:xmlp, rendered by `++xmla`, section 3bD + +See also: `++sail` doc --- -###marx +###++marx - ++ marx ,[n=mane a=mart] :: XML tag +``` +++ marx ,[n=mane a=mart] :: XML tag +``` -Parsed by ++head:xmlp, rendered within ++xmlt, section 3bD + +XML tag. A `++marx` is a pair of a tag name, `++mane` and a list of attributes, `++mart`. + +Parsed by `++head`:xmlp, rendered within `++xmlt`, section 3bD + +See also: `++sail` doc --- -###metl +###++metl + +``` +++ metl ?(%gold %iron %zinc %lead) :: core variance +``` + +XX move to ++ut ++ metl ?(%gold %iron %zinc %lead) :: core variance -Used implicitly in ++coil +See also: `++coil` --- -###noun +###++noun + +``` +++ noun ,* :: any noun +``` + + +Used nowhere XX + + ~zod/try=> `noun`~[1 2 3] + [1 2 3 0] + +--- + +###++null + +``` +++ null ,~ :: null, nil, etc +``` + + +Used nowhere XX + + ~zod/try=> :type; *null + ~ + %~ + +--- + +###++odor + +``` +++ odor ,@ta :: atom format +``` + + +By convetion, a short name for a category of atom. `++odor` is circularly defined, `@ta` being the `++odor` of the ASCII subset commonly used in urbit. + +See also: `++base`, odor reference + + ~zod/try=> `odor`%ux + ~.ux + +--- + +###++tarp + +``` +++ tarp ,[d=@ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time +``` + + +The remaining part of a `++date`: day, hour, minute, second and a list of `@ux` for precision. + +See also: `++date`, `++yell`/`++yule`, Section 2cH + + ~zod/try=> -<- + ~2014.9.20..00.43.33..b52a + ~zod/try=> :: the time is always in your context at -<- + ~zod/try=> (yell -<-) + [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]] + + ~zod/try=> (yell ~d20) + [d=20 h=0 m=0 s=0 f=~] + +--- + +###++time + +``` +++ time ,@da :: galactic time +``` + + +The `@da` odor designates an absolute date atom. + +See also: `++date`, odor reference + + ~zod/try=> `time`-<- + ~2014.9.25..20.01.47..eeac + ~zod/try=> :: the time is always in your context at -<- + ~zod/try=> `time`~2014.1.1 + ~2014.1.1 + +--- + +###++tree + +``` +++ tree |* a=_,* :: binary tree + $|(~ [n=a l=(tree a) r=(tree a)]) :: +``` + + +Tile generator. A `++tree` can be empty, or contain a node of a type and left/right +sub `++tree`s of the same type. Pretty-printed with `{}`. + + ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~] + {[2 "bye"] [1 "hi"]} + + +--- + +###++nail + +``` +++ nail ,[p=hair q=tape] :: parsing input +``` + + +Location in parsed text, and remainder of it. Indicates parsing position and remaining text to be parsed. + +See also: `++roll` + + ~zod/try=> +<:;~(plug cab cab) + c=tub=[p=[p=0 q=0] q=""] + ~zod/try=> :: tub is a ++nail + +--- + +###++numb + +``` +++ numb ,@ :: just a number +``` - ++ noun ,* :: any noun Used nowhere XX --- -###null +###++pair - ++ null ,~ :: null, nil, etc +``` +++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair +``` -Used nowhere XX + +Tile generator. Produces a tuple of two nouns of the types passed in. + + ~zod/try=> *(pair bean cord) + [p=%.y q=''] --- -###odor +###++pass - ++ odor ,@ta :: atom format +``` +++ pass ,@ :: public key +``` -Used in ++base + +Atom alias. Used primarily in crypto. + +See also: `++acru`, `++crua`, `++crub` --- -###tarp +###++path - ++ tarp ,[d=@ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time +``` +++ path (list span) :: filesys location +``` -Used in ++date, converted from and to @d by ++yell/++yule in section 2cH + +A filesystem path. A `++path` is a list of `++span`, `@ta`. Used in `%clay` and `%eyre` extensively. + + ~zod/try=> `path`"abc" + /a/b/c --- -###time +###++pint - ++ time ,@da :: galactic time +``` +++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range +``` + + +A parsing range, mostly used for stacktraces. A `++pint` is a pair of hairs indicating from - to. + + ~zod/try=> !:(!!) + ! /~zod/try/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]> + ~zod/try=> :: !! always produces a crash + ~zod/try=> `pint`[[1 4] [1 6]] + [p=[p=1 q=4] q=[p=1 q=6]] --- -###tree +###++pole - ++ tree |* a=_,* :: binary tree - $|(~ [n=a l=(tree a) r=(tree a)]) :: ---- +``` +++ pole |* a=_,* :: nameless list + $|(~ [a (pole a)]) :: +``` -###nail - - ++ nail ,[p=hair q=tape] :: parsing input + +Sometimes list faces aren't available + + ~zod/try=> `(pole char)`"asdf" + [~~a [~~s [~~d [~~f ~]]]] --- -###numb +###++port - ++ numb ,@ :: just a number +``` +++ port $: p=axis :: + $= q :: + $% [%& p=type] :: + [%| p=axis q=(list ,[p=type q=foot])] :: + == :: + == :: +``` + + +Type and location of core-shaped thing? XX Compiler Internals + + ~zod/try=> *port + [p=0 q=[%.y p=%void]] --- -###pair - ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair + +###++post + +``` +++ post $: p=axis :: + $= q :: + $% [0 p=type] :: + [1 p=axis q=(list ,[p=type q=foot])] :: + [2 p=twin q=type] :: + == :: + == :: +``` + + +Type and location of possibly core-shaped thing? XX Compiler Internals + + ~zod/try=> *post + [p=0 q=[%0 p=%void]] --- -###pass +###++prop - ++ pass ,@ :: public key +``` +++ prop $: p=axis :: + $= q :: + [p=?(~ axis) q=(list ,[p=type q=foot])] :: + == :: +``` + + +Verified core-shaped thing? XX Compiler Internals + + ~zod/try=> *prop + [p=0 q=[p=~ q=~]] --- -###path +###++qual - ++ path (list span) :: filesys location +``` +++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple + ,[p=a q=b r=c s=d] :: + :: XX move to zuse +``` + + +Tile constructor: tuple of 4 + + ~zod/try=> *(qual date time tape cord) + [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s=''] --- -###pint +###++rege - ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range +``` +++ rege $| ?(%dote %ende %sart %empt %boun %bout) :: parsed regex + $% [%lite p=char] :: literal + [%pair p=rege q=rege] :: ordering + [%capt p=rege q=@u] :: capture group + [%brac p=@] :: p is 256 bitmask + [%eith p=rege q=rege] :: either + [%mant p=rege] :: greedy 0 or more + [%plls p=rege] :: greedy 1 or more + [%betw p=rege q=@u r=@u] :: between q and r + [%bint p=rege q=@u] :: min q + [%bant p=rege q=@u] :: exactly q + [%manl p=rege] :: lazy 0 or more + [%plll p=rege] :: lazy 1 or more + [%betl p=rege q=@u r=@u] :: between q and r lazy + [%binl p=rege q=@u] :: min q lazy + == :: +``` + + +Regex, names need restructuring XX --- -###pole +###++ring - ++ pole |* a=_,* :: nameless list - $|(~ [a (pole a)]) :: ---- +``` +++ ring ,@ :: private key +``` + + +Atom alias, used in `++acru` cryptosuite type, and its implementations +`crua` and `crub`. -###port - ++ port $: p=axis :: - $= q :: - $% [%& p=type] :: - [%| p=axis q=(list ,[p=type q=foot])] :: - == :: - == :: --- -###post +###++rule - ++ post $: p=axis :: - $= q :: - $% [0 p=type] :: - [1 p=axis q=(list ,[p=type q=foot])] :: - [2 p=twin q=type] :: - == :: - == :: ---- +``` +++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule +``` -###prop + +Parser typeclass. - ++ prop $: p=axis :: - $= q :: - [p=?(~ axis) q=(list ,[p=type q=foot])] :: - == :: ---- - -###qual - - ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple - ,[p=a q=b r=c s=d] :: ---- - -###rege - - ++ rege $| ?(%dote %ende %sart %empt %boun %bout) :: parsed regex - $% [%lite p=char] :: literal - [%pair p=rege q=rege] :: ordering - [%capt p=rege q=@u] :: capture group - [%brac p=@] :: p is 256 bitmask - [%eith p=rege q=rege] :: either - [%mant p=rege] :: greedy 0 or more - [%plls p=rege] :: greedy 1 or more - [%betw p=rege q=@u r=@u] :: between q and r - [%bint p=rege q=@u] :: min q - [%bant p=rege q=@u] :: exactly q - [%manl p=rege] :: lazy 0 or more - [%plll p=rege] :: lazy 1 or more - [%betl p=rege q=@u r=@u] :: between q and r lazy - [%binl p=rege q=@u] :: min q lazy - == + ~zod/try=> ^+(rule [|=(a=nail [p.a ~])]:|6) :: wet gate needs same context + <1.dww [tub=[p=[p=@ud q=@ud] q=""] <101.jzo 1.ypj %164>]> --- -###ring +###++span - ++ ring ,@ :: private key +``` +++ span ,@ta :: text-atom (ASCII) +``` ---- - -###rule - - ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule - ---- - -###span - - ++ span ,@ta :: text-atom (ASCII) A restricted text atom for canonical atom syntaxes. The prefix is `~.`. There are no escape sequences except `~~`, which means `~`, and `~-`, @@ -630,31 +1082,76 @@ besides numbers and lowercase letters are permitted. --- -###spot +###++spot + +``` +++ spot ,[p=path q=pint] :: range in file +``` + + +Stack trace line. + + ~zod/try=> :into /=main=/bin/fail/hoon '!: !!' + + /~zod/main/359/bin/fail/hoon + ~zod/try=> :fail + ! /~zod/main/~2014.9.22..18.40.56..ef04/bin/fail/:<[1 5].[1 7]> + ! exit - ++ spot ,[p=path q=pint] :: range in file --- -###tang +###++tang - ++ tang (list tank) :: general error +``` +++ tang (list tank) :: general error +``` + + +Unused XX --- -###tank +###++tank + +``` +++ tank $% [%leaf p=tape] :: printing formats + $: %palm :: + p=[p=tape q=tape r=tape s=tape] :: + q=(list tank) :: + == :: + $: %rose :: delimeted list + p=[p=tape q=tape r=tape] :: mid open close + q=(list tank) :: + == :: + == +``` + + +Pretty-printing structure: leaf nodes, XX, and surrounded-and-delimited tanks + + ~zod/try=> >(bex 20) (bex 19)< + [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]] + ~zod/try=> (wash [0 80] >(bex 20) (bex 19)<) + <<"[1.048.576 524.288]">> + ~zod/try=> (wash [0 15] >(bex 20) (bex 19)<) + <<"[ 1.048.576" " 524.288" "]">> + + ~zod/try=> [(bex 150) (bex 151)] + [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624 + 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248 + ] + - ++ 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)] - == :: --- -###tape +###++tape - ++ tape (list char) :: like a string +``` +++ tape (list char) :: like a string +``` -One of Hoon's two string types (the other being ++cord). A tape is a + +One of Hoon's two string types (the other being `++cord`). A tape is a list of chars. ~zod/try=> `(list ,char)`"foobar" @@ -664,14 +1161,18 @@ list of chars. --- -###term +###++term + +``` +++ term ,@tas :: Hoon ASCII subset +``` A restricted text atom for Hoon constants. The only characters permitted are lowercase ASCII, - except as the first or last character, and 0-9 except as the first character. -The syntax for @tas is the text itself, always preceded by %. This -means a term is always cubical. You can cast it to @tas if you like, +The syntax for `@tas` is the text itself, always preceded by `%`. This +means a term is always cubical. You can cast it to `@tas` if you like, but we just about always want the cube: ~zod/try=> %dead-fish9 @@ -679,12 +1180,12 @@ but we just about always want the cube: ~zod/try=> -:!>(%dead-fish9) [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]] -The empty @tas has a special syntax, $: +The empty `@tas` has a special syntax, `$`: ~zod/try=> %$ %$ -A term without % is not a constant, but a name: +A term without `%` is not a constant, but a name: ~zod/try=> dead-fish9 ! -find-limb.dead-fish9 @@ -693,195 +1194,137 @@ A term without % is not a constant, but a name: --- -###tiki +###++tiki + +``` +++ tiki :: test case + $% [& p=(unit term) q=wing] :: simple wing + [| p=(unit term) q=twig] :: named wing + == :: +``` + + +A `wing` or `twig` + + ~zod/try=> (ream '=+ a=4 ?-(a @ ~)') + [ %tsls + p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]] + q + [ %wthz + p=[%.y p=~ q=~[%a]] + q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]] + ] + ] + ~zod/try=> (ream '=+ a=4 ?-(4 @ ~)') + [ %tsls + p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]] + q + [ %wthz + p=[%.n p=~ q=[%dtzy p=%ud q=4]] + q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]] + ] + ] - ++ tiki --- -###tile +###++tile - ++ tile +``` +++ tile $& [p=tile q=tile] :: ordered pair + $% [%axil p=base] :: base type + [%bark p=term q=tile] :: name + [%bush p=tile q=tile] :: pair/tag + [%fern p=[i=tile t=(list tile)]] :: plain selection + [%herb p=twig] :: gate + [%kelp p=[i=line t=(list line)]] :: tag selection + [%leaf p=term q=@] :: constant atom + [%reed p=tile q=tile] :: atom/cell + [%weed p=twig] :: example + == :: +``` -A tile is a convenient way of making a well-typed noun. It can be -reduced in four ways - cryptically called bunt, clam, -fish, and whip. each tile corresponds to a well-defined -type, called its icon. A tile is converted statically into a twig, -which in turn may (depending on the conversion) produce the icon, test -for it, etc. And always, the icon is some function of the tile and its -subject. -There are nine cases within ++tile: - - [p=tile q=tile] - -Tiles autocons, just like twigs - a cell of tiles is a tile of a -cell. - -`(,[@ @] [4 5])` is `[4 5]`, which is the same as [(,@ 4) (,@ 5)], -producing [4 5]. Clearly, (,[@ @] [4 5]) should not be the same as -[(,@ [4 5]) (,@ [4 5])] - which would produce merely [0 0].) - -The irregular wide syntax for tile autocons is the same as the -syntax for twig autocons - eg, [@ @], a cell of atoms. But there is -also a regular tall/wide tuple syntax, with $: (buccol, %bccl). -Thus instead of [@ @] we could write: - - $: @ - @ - == - - [%axil p=base] - -An %axil is a simple built-in mechanism for a few basic icons: an -atom of any odor (@odor, or just @ for the odorless base atom); a -noun (*); a cell of nouns (^); a loobean ?; and null ~. - - [%bark p=term q=tile] - -Wrap a name round a tile. a=* parses as [%bark %a %noun]. - -This is another case where the tile syntax matches the twig syntax, -but only in the irregular form. The twig equivalent of %bark is of -course ^= (kettis, %ktts). But the tile is $= (buctis): - - $= a - * - -Obviously a silly syntactic arrangement. But you can need it if q -is really big. - - [%bush p=tile q=tile] - -A %bush is a tile in which there are two kinds of nouns: cells -whose head is a cell (tile p) and cells whose head is an atom (tile -q). Its default value is the value of q. - -We don't have to look very far to find a %bush - ++tile is one, as -is ++twig and ++nock. The rune is $& (bucpam). See ++tile above - p -is [p=tile q=tile], q is the $%. There is no irregular form. - -What's the use of a %bush? Often in a variety of data structures we -have something like autocons, in which forming a cell of two -instances has an obvious default semantics. - -Sure, we could attach these semantics to an atom, and just use a -%kelp. In twigs, tiles, or nock formulas, we could have an explicit -cons stem of some sort. But it would be a bulky as compared to -autocons. - - [%fern p=[i=tile t=(list tile)]] - -A %fern is a non-empty list of cases; its icon is naturally a -%fork. The programmer is responsible for ensuring that the cases -are actually orthogonal (unlike with the structured forks, %bush, -%kelp and %reed). A good general practice is to use %ferns only -with %leafs. - -For example, a fern that could be %foo or %bar has the irregular -form ?(%foo %bar), or the regular form - - $? %foo - %bar - == - -The default value is the first - in this case, %foo. - - [%kelp p=[i=line t=(list line)]] - -A kelp is the workhorse of tiles - it provides the most common data -structure in any language, the discriminated union. - -In Hoon, the head (which must be a leaf) is called the stem. The -tail (which can be anything) is the bulb. Cases of a kelp are known -inevitably as fronds. - -(Yes. We're aware that "kelp" is not properly a singular noun. In -Hoon - it is properly a singular noun. And that's that. And oddly, -it's not that hard to run out of four-letter plants.) - -$%, buccen, is a tile rune that produces a %kelp. $% takes a list -of lines, which are labelled cases, closed by ==. - - $% p - q - == - [%leaf p=term q=@] - -A %leaf is an atomic constant of value q and odor p. Obviously its -icon is a %cube. - -The syntax for a leaf is the same as the twig syntax, except that % -is never required to generate a cube. For instance, as a twig, 7 -has a type of [%atom %ud]; %7 has a type of [%cube 7 [%atom %ud]]. -But the icon of the leaf 7 is, again, [%cube 7 [%atom %ud]]. - - [%reed p=tile q=tile] - -A %reed is a tile whose icon contains two kinds of nouns: atoms of -tile p and cells of tile q. - -There is no irregular form of %reed. The regular form is: - - $| ~ [@ @] == - -or in wide mode $|(~ [@ @]) - - [%herb p=twig] - -You can write your own tile which is just a gate, accepting a -sample of * and normalizing it as you choose. If you use a twig as -a tile, it's treated as an herb. - -For example, when we define a gate like ++base, as defined above -(remember that when we use a tile as a twig, we get the clam, ie, -the normalizing gate) base is just an arm which produces a gate. -Nothing has any idea that this gate is built from a tile of its -own. - -So when we parse [p=base q=base] as a tile, the parser builds the -noun: - -[[%bark %p %herb %cnzy %base] [%bark %q %herb %cnzy %base]] In -other words, base in p=base is actually a twig, but this twig -happens to produce a normalizing gate generated by clamming a tile. -In time this will come to seem totally straightforward, but don't -be surprised if it confuses you now. - -The important thing to remember about %herb is that the actual twig -we provide will be applied when we whip or clam. Hence, arbitrary -normalization and/or verification procedures may be part of the -herbaceous custom tile. +See the Tile section of the Hoon Reference. --- -###toga +###++toga - ++ toga :: face control - $| p=term :: two togas - $% [0 ~] :: no toga - [1 p=term q=toga] :: deep toga - [2 p=toga q=toga] :: cell toga - == :: +``` +++ toga :: face control + $| p=term :: two togas + $% [0 ~] :: no toga + [1 p=term q=toga] :: deep toga + [2 p=toga q=toga] :: cell toga + == :: +``` + + +A face, or tree of faces + + ~zod/try=> [a b]=[1 2 3] + [a=1 b=[2 3]] + ~zod/try=> (ream '[a b]=[1 2 3]') + [ %ktts + p=[%2 p=p=%a q=p=%b] + q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]] + ] + + ~zod/try=> [a ~]=[1 2 3] + [a=1 2 3] + ~zod/try=> (ream '[a ~]=[1 2 3]') + [ %ktts + p=[%2 p=p=%a q=[%0 ~]] + q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]] + ] --- -###trap +###++trap - ++ trap ,_|.(_*) :: makes perfect sense +``` +++ trap ,_|.(_*) :: makes perfect sense +``` + + +A trap is a core with one arm `++$` + + ~zod/try=> *trap + <1.mws 101.jzo 1.ypj %164> + ~zod/try=> (*trap) + 0 --- -###trel +###++trel - ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple - ,[p=a q=b r=c] :: +``` +++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple + ,[p=a q=b r=c] :: +``` + +Tile constructor: three items. + + ~zod/try=> *(trel ,@ud ,@t ,@s) + [p=0 q='' r=--0] + --- -###tuna +###++tuna + +``` +++ tuna :: tagflow + $% [%a p=twig] :: plain text + [%b p=twig] :: single tag + [%c p=twig] :: simple list + [%d p=twig] :: dynamic list + [%e p=twig q=(list tuna)] :: element + [%f p=(list tuna)] :: subflow + == :: +``` -++ tuna An XML template tree. @@ -891,2556 +1334,676 @@ tuna, and %f is a empty node. --- -###twig +###++twig -++ twig TODO: delete Form, normalize indentation +See Twig section of Hoon reference -A twig is an abstract syntax tree or AST, which we produce when we -parse a Hoon expression, file, etc. A twig is a noun that's converted -into a Nock formula, with the assistance of a type which describes the -subject of the formula: +--- - [subject-type twig] => formula +###++tine -But actually this isn't quite right, because Hoon does something called -"type inference." When we have a type that describes the subject for -the formula we're trying to generate, as we generate that formula we -want to also generate a type for the product of that formula on that -subject. So our compiler computes: +``` +++ tine (list ,[p=tile q=twig]) :: +``` - [subject-type twig] => [product-type formula] -As long as subject-type is a correct description of some subject, you -can take any twig and compile it against subject-type, producing a -formula such that *(subject formula) is a product correctly described -by product-type. +Switch statement cases -Actually, this works well enough that in Hoon there is no direct syntax -for defining or declaring a type. There is only a syntax for -constructing twigs. Types are always produced by inference. + ~zod/try=> (ream '?-(!! @ |, ^ &)') + [ %wthz + p=[%.n p=~ q=[%zpzp ~]] + q + ~[ + [p=[%axil p=[%atom p=~.]] q=[%dtzy p=%f q=1]] + [p=[%axil p=%cell] q=[%dtzy p=%f q=0]] + ] + ] + ~zod/try=> (tine |2:(ream '?-(!! @ |, ^ &)')) + ~[ + [p=[%axil p=[%atom p=~.]] q=[%dtzy p=%f q=1]] + [p=[%axil p=%cell] q=[%dtzy p=%f q=0]] + ] -There are 112 cases of ++twig +--- - [p=twig q=twig] +###++tusk -A twig can be a pair of twigs. +``` +++ tusk (list twig) :: +``` - [%$ p=axis] + +Variable-arity expression list. -Refers to a nock axis. + ~zod/try=> (ream '[1 2 3]') + [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]] + ~zod/try=> (tusk +:(ream '[1 2 3]')) + ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]] - [%bccb p=tile] +--- -$_ ("buccab") is a synthetic hoon that produces the bunt (default -value) for p. +###++tyre - Tall - $_ p +``` +++ tyre (list ,[p=term q=twig]) :: +``` - Wide - $_(p) + +Assciative list of term to twig, used in jet hint processing. - Irregular - _p - - Reduction - See ++open - [%bccm p=tile] -$, ("buccom") is a synthetic rune that produces a normalizing gate -(clam) for p. +--- - Talln - $, p +###++tyke - Wide - none +``` +++ tyke (list (unit twig)) :: +``` - Irregular - ,p - Reduction - ~(clam al p) - - See ++clam in ++al. +List of twigs or gaps left to be inferred, in path parsing. - [%bcpt p=wing q=tile] + ~zod/try=> (scan "/==as=" porc:vast) + [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]] + ~zod/try=> `tyke`+:(scan "/==as=" porc:vast) + ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~] -$@ ("bucpat") is a (just barely) natural hoon that whips wing p -into tile q. +--- - Tall - $@ p - q +###++tram - Wide - $@(p q) +``` +++ tram (list ,[p=wing q=twig]) :: +``` - Irregular - p@q + +List of changes by location in context - Reduction - none, natural + ~zod/try=> (ream '$(a 1, b 2)') + [ %cnts + p=~[%$] + q=~[[p=~[%a] q=[%dtzy p=%ud q=1]] [p=~[%b] q=[%dtzy p=%ud q=2]]] + ] + ~zod/try=> (tram +:(ream '$(a 1, b 2)')) + ~[[p=~ q=[% p=0]] [p=~[%a] q=[%dtzy p=%ud q=1]] [p=~[%b] q=[%dtzy p=%ud q=2]]] - [%bctr p=tile] -$* ("buctar") is a synthetic rune that produces the bunt (default -value) for p as a compile-time constant. +--- - Tall - $* p +###++nock - Wide - $*(p) +``` +++ nock $& [p=nock q=nock] :: autocons + $% [%0 p=@] :: axis select + [%1 p=*] :: constant + [%2 p=nock q=nock] :: compose + [%3 p=nock] :: cell test + [%4 p=nock] :: increment + [%5 p=nock q=nock] :: equality test + [%6 p=nock q=nock r=nock] :: if, then, else + [%7 p=nock q=nock] :: serial compose + [%8 p=nock q=nock] :: push onto subject + [%9 p=@ q=nock] :: select arm and fire + [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint + [%11 p=nock] :: grab data from sky + == :: +``` - Reduction - ^~ ~(bunt al p) - - See ++bunt in al. - [%bczp p=base] +See [**Nock**] doc -$! ("buczap") is a synthetic internal rune that produces the bunt -(default value) for [%axil p]. + ~zod/try=> !=([+(.) 20 -<]) + [[4 0 1] [1 20] 0 4] + ~zod/try=> (nock !=([+(.) 20])) + [p=[%4 p=[%0 p=1]] q=[%1 p=20]] - Reduction - See ++open +--- - [%brcb p=tile q=(map term foot)] +###++tone -|_ ("barcab") is a synthetic rune that produces a %gold tray with -sample p, arms q. q is an associative array of names and -expressions, each pair of which is called an arm. After any number -of dry (%ash, ++) and/or wet (%elm, +-) arms, the array is -terminated with -- +``` +++ tone $% [%0 p=*] :: success + [%1 p=(list)] :: blocks + [%2 p=(list ,[@ta *])] :: error ~_s +:: :::::: virtual nock +``` - Tall - |_ p - ++ p.n.q - q.n.q - -- - Wide - none - - Irregular - none +Intermediate computation result: like `toon`, but stack trace +has not been rendered - Reduction - See ++open + ~zod/try=> (mink [[20 21] 0 3] ,~) + [%0 p=21] + + ~zod/try=> (mink [[0] !=(.^(cy//=main/1))] ,~) + [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]] + ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0]) + /cy/~zod/main/1 + + ~zod/try=> (mink [[1 2] !=(~|(%hi +(.)))] ,~) + [%2 p=~[[~.yelp 26.984]]] + ~zod/try=> (mink [[1 2] !=(!:(+(.)))] ,~) + [ %2 + p + ~[ + [ ~.spot + [ [ 1.685.027.454 + 7.959.156 + \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/ + 8.112.403.878.526 + \/ \/ + 0 + ] + [1 20] + 1 + 24 + ] + ] + ] + ] - [%brcn p=(map term foot)] -|% ("barcen") is a natural rune that produces a %gold core from an -associative array of names and expressions, each pair of which is -called an arm. After any number of dry (%ash, ++) and/or wet (%elm, -+-) arms, the array is terminated with -- +--- - Tall - |% - ++ p.n.q - q.n.q - +- p.n.l.q - q.n.l.q - -- +###++toon - Wide - none +``` +++ toon $% [%0 p=*] :: success + [%1 p=(list)] :: blocks + [%2 p=(list tank)] :: stack trace + == :: +``` + + +Nock computation result: success, block with list of requests blocked on, +or failure with stack trace. + + ~zod/try=> (mock [[20 21] 0 3] ,~) + [%0 p=21] + + ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~) + [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]] + ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0]) + /cy/~zod/main/1 + + ~zod/try=> (mock [[1 2] !=(!:(+(.)))] ,~) + [%2 p=~[[%leaf p="/~zod/try/~2014.9.23..18.34.32..d3c5/:<[1 20].[1 24]>"]]] + +--- + +###++tune + +``` +++ tune $% [%0 p=vase] :: + [%1 p=(list)] :: + [%2 p=(list ,[@ta *])] :: + == :: +``` - Irregular - none - Reduction - none, natural +XX Unused - [%brdt p=twig] +Probably typed `tone`? -|. ("bardot") is a synthetic rune that produces a dry %gold trap -from twig p. +--- - Tall - |. p +###++twin - Wide - |.(p) +``` +++ twin ,[p=term q=wing r=axis s=type] :: alias info +``` - Irregular - none - Reduction - See ++open +Used in `%bull` `++type` + + ~zod/try=> (~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~) + [ %bull + p=[p=%fal q=~[[%.y p=3]] r=3 s=[%atom p=%ud]] + q=[%cell p=%noun q=[%atom p=%ud]] + ] + ~zod/try=> &2:(~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~) + p=[p=%fal q=~[[%.y p=3]] r=3 s=[%atom p=%ud]] + ~zod/try=> (twin &2:(~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~)) + [p=%fal q=~[[%.y p=3]] r=3 s=[%atom p=%ud]] - [%brfs p=tile q=(map term foot)] +--- -|/ ("barfas") is a synthetic rune that produces a vulcanized %gold -tray with arms q, sample p. +###++type + +See Type section of Hoon reference - Tall - |/ p - +- p.n.q - q.n.q - -- +--- + +###++typo - Wide - none +``` +++ typo type :: old type +``` - Irregular - none + +Pointer for `++type`. `++typo` preserves the previous `++type` in +your context when upating. - Reduction - See ++open +See also: `++seem`, `++vise`, `++type` - [%brkt p=twig q=(map term foot)] +--- -|^ ("barket") is a synthetic rune that produces a %gold book with -arms q, with p as %$, and kicks it. +###++udal - Tall - |^ p - ++ p.n.q - q.n.q - -- - - Wide - none +``` +++ udal :: atomic change (%b) + $: p=@ud :: blockwidth + q=(list ,[p=@ud q=(unit ,[p=@ q=@])]) :: indels + == :: +``` - Irregular - none - Reduction - See ++open +XX Unused - [%brhp p=twig] +--- -|- ("barhep") is a synthetic rune that produces a dry %gold trap -from twig p, and kicks it. +###++udon - Tall - |- - p +``` +++ udon :: abstract delta + $: p=umph :: preprocessor + $= q :: patch + $% [%a p=* q=*] :: trivial replace + [%b p=udal] :: atomic indel + [%c p=(urge)] :: list indel + [%d p=upas q=upas] :: tree edit + == :: + == :: +``` - Wide - |-(p) - Irregular - none +See `%clay` doc - Reduction - See ++open +--- - [%brls p=tile q=twig] +###++umph -|+ ("barlus") is a synthetic rune that produces a dry %iron gate -with arm q, sample p. +``` +++ umph :: change filter + $| $? %a :: no filter + %b :: jamfile + %c :: LF text + == :: + $% [%d p=@ud] :: blocklist + == :: +``` - Tall - |+ p - q - - Wide - |+(p q) - - Irregular - none - - Reduction - See ++open - - [%brpt p=tile q=tile r=twig] - - XX not used - - [%brtr p=tile q=twig] - -|* ("bartar") is a synthetic rune that produces a vulcanized wet -gate with arm q, sample p. - - Tall - |* p - q - - Wide - |*(p q) - - Irregular - none - - Reduction - See ++open - - [%brts p=tile q=twig] - -|= ("bartis") is a synthetic hoon that produces a dry %gold gate -with arm q, sample p. - - Tall - |= p - q - - Wide - |=(p q) - - Irregular - none - - Reduction - See ++open - - [%brwt p=twig] - -|? ("barwut") is a synthetic rune that produces a dry %lead trap. - - Tall - |? p - - Wide - |?(p) - - Irregular - none - - Reduction - See ++open - - [%clcb p=twig q=twig] - -:_ ("colcab") is a synthetic rune that produces the cell [q p]. - - Tall - :_ p - q - - Wide - :_(p q) - - Irregular - none - - Reduction - See ++open - - [%clcn p=tusk] - -:% ("colcen") is a synthetic rune that produces a cell [[p ~] ~] -from a list of twigs p, terminated by a == - - Tall - :% i.p - i.t.p - i.t.t.p - == - - Wide - :%(i.p i.t.p i.t.t.p) - - Irregular - %[i.p i.t.p i.t.t.p] - - Reduction - See ++open - - [%clfs p=twig] - -:/ ("colfas") is a synthetic rune that, given a twig p, produces -[%$ [%$ p ~] ~], i.e., [0 [0 p 0] 0]. Used in practice only in -string interpolation. - - Tall - :/ p - - Wide - :/(p) - - Irregular - none - - Reduction - See ++open - - [%clkt p=twig q=twig r=twig s=twig] - -:^ ("colket") is a synthetic rune that produces a cell [p q r s] -from twigs p, q, r, and s. - - Tall - :^ p - q - r - s - - Wide - :^(p q r s) - - Irregular - none - - Reduction - See ++open - - [%clhp p=twig q=twig] - -:- ("colhep") is a synthetic rune that produces the cell [p q] from -twigs p and q. - - Tall - :- p - q - - Wide - :-(p q) - - Irregular - [p q] - - Reduction - See ++open - - [%clls p=twig q=twig r=twig] - -:+ ("collus") is a synthetic rune that produces a cell [p q r] from -twigs p, q, and r. - - Tall - :+ p - q - r - - Wide - :+(p q r) - - Irregular - none - - Reduction - See ++open - - [%clsg p=tusk] - -:~ ("colsig") is a synthetic rune that produces a null-terminated -tuple of a list of twigs p. - - Tall - :~ i.p - i.t.p - i.t.t.p - == - - Wide - :~(i.p i.t.p i.t.t.p) - - Irregular - ~[i.p i.t.p i.t.t.p] - - Reduction - See ++open - - [%cltr p=tusk] - -:* ("coltar") is a synthetic hoon that produces a tuple from p, a -list of twigs. - - Tall - :* i.p - i.t.p - i.t.t.p - == - - Wide - :*(i.p i.t.p i.t.t.p) - - Irregular - [i.p i.t.p i.t.t.p] - - Reduction - See ++open - - [%clzz p=tusk] - -"colzaz" is a synthetic internal rune that promotes its tusk p -within a %clsg or %cltr tusk. - - Not used at present. - - [%cncb p=wing q=tram] - -%_ ("cencab") is a synthetic rune that evaluates the wing p with -the changes specified in tram q, then casts the product back to p. - - Tall - %_ p - p.i.q q.i.q - p.i.t.q q.i.t.q - == - - Wide - %_(p p.i.q q.i.q, p.i.t.q q.i.t.q) - - Irregular - none - - Reduction - See ++open - - [%cncl p=twig q=twig] - -%: ("cencol") is a synthetic rune that pulls %$ from the twig p -with the with its sample set to q. - - Tall - %: p - q - - Wide - %:(p q) - - Irregular - none - - Reduction - See ++open - - [%cndt p=twig q=twig] - -%. ("cendot") is a synthetic rune that slams the gate q with -[%cltr p]. The dual of %cnhp. - - Tall - %. p - q - - Wide - %.(p q) - - Irregular - none - - Reduction - %- q - p - - See ++open - - [%cnhp p=twig q=tusk] - -%- ("cenhep") is a synthetic rune that slams the gate p with -[%cltr q]. - - Tall - %- p - q - - Wide - %-(p q) - - Irregular - (p q) - - Reduction - See ++open - - [%cntr p=wing q=twig r=tram] - -%* is a synthetic rune that pulls the wing p from tray q with changes r. - - Tall - %* p q - p.i.r q.i.r - p.i.t.r q.i.t.r - == - - Wide - %*(p q p.i.r q.i.r, p.i.t.r q.i.t.r) - - Irregular - none - - Reduction - See ++open - - [%cnkt p=twig q=twig r=twig s=twig] - -%^ ("cenket") is a synthetic rune that slams gate p with [%cntr q r s]. - - Tall - %^ p - q - r - s - - Wide - %^(p q r s) - - Irregular - none - - Reduction - See ++open - - [%cnls p=twig q=twig r=twig] - -%+ ("cenlus") is a synthetic rune that slams gate p with [%cntr q r]. - - Tall - %+ p - r - s - - Wide - %+(p q r) - - Irregular - none - - Reduction - See ++open - - [%cnsg p=wing q=twig r=twig] - -%~ ("censig") is a synthetic rune that pulls p from the tray q with its -sample set to r. - - Tall - %~ p - q - r - - Wide - %~(p q r) - - Irregular - ~(p q r) - - Reduction - See ++open - - [%cnts p=wing q=tram] - -%= ("centis") is a natural rune that evaluates p with the changes -specified in q. - - Tall - %= p - p.i.q q.i.q - p.i.t.q q.i.t.q - == - - Wide - %=(p p.i.q q.i.q, p.i.t.q q.i.t.q) - - Irregular - p(p.i.q q.i.q, p.i.t.q q.i.t.q) - - Reduction - See ++open - - [%cnzy p=term] - -"cenzey" is a synthetic internal rune that pulls limb p from the subject. - - Tall/Wide/Irregular - none, internal - - Reduction - See ++open - - [%cnzz p=wing] - -"cenzaz" is a synthetic internal rune that pulls wing p from the subject. - - Form - none, internal - - Reduction - See ++open - - [%dtkt p=twig] - -.^ ("dotket") is a natural rune that generates Nock operator 11, which in -virtual userspace Nock (++mock) loads a file from the global namespace. - - Tall - .^ p - - Wide - .^(p) - - Irregular - ^:type/path - - ^/path - - Reduction - none, natural - - [%dtls p=twig] - -.+ ("dotlus") is a natural rune that generates Nock operator 4, which -increments an atomic operand. - - Tall - .+ p - - Wide - .+(p) - - Irregular - +(p) - - Reduction - none, natural - - [%dtzy p=term q=@] - -"dotzey" is a natural internal rune that produces a non-cubed atomic -constant of odor p and value q. - - Tall/Wide/Irregular - none, internal - - Reduction - none, natural - - [%dtzz p=term q=*] - -"dotzaz" is a natural internal rune that produces a cubed noun constant of -value q and odor p, if q is an atom. - - Tall/Wide/Irregular - none, internal - - Reduction - none, natural - - [%dttr p=twig q=twig] - -.* ("dottar") is a natural rune that calculates the Nock of subject p, -formula q. - - Tall - .* p - q - - Wide - .*(p q) - - Irregular - none - - Reduction - none, natural - - [%dtts p=twig q=twig] - -.= ("dottis") is a natural rune that applies Nock 5 (equals) to determine -if the products of p and q are equivalent. - - Tall - .= p - q - - Wide - .=(p q) - - Irregular - =(p q) - - Reduction - none, natural - - [%dtwt p=twig] - -.? ("dotwut") is a natural hoon that applies Nock 3 to a noun: if the -noun is a cell, it returns the loobean & (true); if the noun is an atom, -it returns the loobean | (false). - - Tall - .? p - - Wide - .?(p) - - Irregular - none - - Reduction - none, natural - - [%hxgl p=tusk] - -#< ("haxgal") is a synthetic rune that slams the assumed gate noah on -[%zpgr %cntr p]. See the Biblical names. - - Tall/Wide - none - - Irregular - >i.p i.t.p i.t.t.p< - - Reduction - See ++open - - [%hxgr p=tusk] - -#> ("haxgar") is a synthetic rune that slams the assumed gate cain on -[%zpgr %cntr p]. See the Biblical names. - - Tall/Wide - none - - Irregular - - - Reduction - See ++open - - [%ktbr p=twig] - -^| ("ketbar") is a natural rune that converts a %gold core into an %iron -core. See geometric polymorphism. - - Tall - ^| p - - Wide - ^|(p) - - Irregular - none - - Reduction - none, natural - - [%ktdt p=twig q=twig] - -^. ("ketdot") is a synthetic rune that casts q to the type of (p q). - - Tall - ^. p - q - - Wide - none - - Irregular - none - - Reduction - See ++open - - [%ktls p=twig q=twig] - -^+ ("ketlus") is a natural rune that casts the product of q to the -type of p, verifying that it contains the type of q. - - Tall - +^ p - q - - Wide - ^+(p q) - - Irregular - none - - Reduction - none, natural - - [%kthp p=tile q=twig] - -^- ("kethep") is a synthetic rune that casts q to ~(bunt al p), -i.e., the icon of p. - - Tall - ^- p - q - - Wide - ^-(p q) - - Irregular - `p`q - - Reduction - See ++open - - [%ktpm p=twig] - -^& ("ketpam") is a natural rune that converts a %gold core to %zinc core. -See geometric polymorphism. - - Tall - ^& p - - Wide - ^&(p) - - Irregular - none - - Reduction - none, natural - - [%ktsg p=twig] - -^~ ("ketsig") is a natural rune that tries to execute p statically at -compile time; if this fails, p remains dynamic. - - Tall - ^~ p - - Wide - ^~(a) - - Irregular - none - - Reduction - none, natural - - [%ktts p=toga q=twig] - -^= ("kettis") is a natural rune that wraps q in the toga p. The -toga is a powerful naming device that can assign an entire name -tree to a properly typed result. For instance, if foo produces -an unlabeled tuple [x y z], [a b=[c d]]=foo produces -[a=x b=[c=y d=z]]. - - Tall - ^= p - q - - Wide - ^=(p q) - - Irregular - none - - Reduction - none, natural - - [%ktwt p=twig] - -^? ("ketwut") is a natural hoon that converts a %gold core into a -%lead core. See geometric polymorphism. - - Tall - ^? p - - Wide - ^?(p) - - Irregular - none - - Reduction - none, natural - - [%sgbr p=twig q=twig] - -~| ("sigbar") is a synthetic rune that presents the product of p -in the stack trace if q crashes. Only performed as needed. -Generates %cain - see the Biblical names. - - Tall - ~| p - q - - Wide - ~|(p q) - - Irregular - none - - Reduction - See ++open, ++feck - - [%sgcb p=twig q=twig] - -~_ ("sigcab") is a synthetic rune that inserts p, a trap producing a tank, -into the trace of q. - - Tall - ~_ p - q - - Wide - ~_(p q) - - Irregular - none - - Reduction - See ++open - - [%sgcn p=chum q=twig r=tyre s=twig] - -~% ("sigcen") is a synthetic rune that identifies a core for specific -optimization. See jet propulsion. - - Tall - ~% p - q - == - p.i.r q.i.r - p.i.t.r q.i.t.r - == - s - - ~% p - q - ~ - s - - Wide - none - - Irregular - none - - Reduction - See ++open - - [%sgfs p=chum q=twig] - -~/ ("sigfas") is a synthetic rune that identifies an arm for specific -optimization. See jet propulsion. - - Tall - ~/ p - q - - Wide - ~/(p q) - - Irregular - none - - Reduction - See ++open - - [%sggl p=$|(term [p=term q=twig]) q=twig] - -~< ("siggal") is a synthetic rune that applies arbitrary hint p to -the product of q. Does not wake the hint engine until the -computation is finished. - - Tall - ~< p - q - - Wide - ~<(p q) - - Irregular - none - - Reduction - See ++open - - [%sggr p=$|(term [p=term q=twig]) q=twig] - -~> ("siggar") is a natural rune that applies arbitrary hint p to q. - - Tall - ~> p - q - - Wide - ~>(p q) - - Irregular - none - - Reduction - See ++open - - [%sgbc p=term q=twig] -~$ ("sigbuc") is a synthetic rune that labels computation q as p -for profiling (not currently enabled). +See `%clay` doc - Tall - ~$ p - q - - Wide - ~$(p q) - - Irregular - none - - Reduction - See ++open - - [%sgls p=@ q=twig] - -XX Solve ~+ ("siglus") is a synthetic rune that memoizes computation q - Tall +--- - Wide +###++unce - Irregular +``` +++ unce |* a=_,* :: change part + $% [%& p=@ud] :: skip[copy] + [%| p=(list a) q=(list a)] :: p -> q[chunk] + == :: +``` - Reduction - See ++open - [%sgpm p=@ud q=twig r=twig] +See `%clay` doc -~& ("sigpam") is a synthetic rune that prints q on the console -before computing r. p is the log priority 0-3, defaulting to 0. +--- - Tall - 0, debug - ~& q - r +###++unit - 1, notice - ~& > q - r +``` +++ unit |* a=_,* :: maybe + $|(~ [~ u=a]) :: +``` - 2, warning - ~& >> q - r - 3, alarm - ~& >>> q - r +Tile constructor: option. - Wide - ~&(>>> q r) + ~zod/try=> :type; *(unit time) + ~ + u(@da) + ~zod/try=> `(unit time)`[~ -<-] + [~ ~2014.9.24..19.25.10..7dd5] - Irregular - none +--- - Reduction - See ++open +###++upas - [%sgts p=twig q=twig] +``` +++ upas :: tree change (%d) + $& [p=upas q=upas] :: cell + $% [%0 p=axis] :: copy old + [%1 p=*] :: insert new + [%2 p=axis q=udon] :: mutate! + == :: +``` -~= ("sigtis") is a synthetic rune that hints to the interpreter -that q may produce a noun equal to the already existing p, -avoiding duplication. - Tall - ~= p - q +See `%clay` doc - Wide - ~=(p q) - - Irregular - none +--- - Reduction - See ++open +###++urge - [%sgwt p=@ud q=twig r=twig s=twig] +``` +++ urge |*(a=_,* (list (unce a))) :: list change +``` -~? ("sigwut") is a synthetic rune that prints r to the console -before computing s, iff q produces yes. p is the log priority, -0-3, 0 by default + +See `%clay` doc - Tall - 0, debug - ~? q - r - s +--- - 1, notice - ~? > q - r - s +###++vase - 2, warning - ~? >> q - r - s +``` +++ vase ,[p=type q=*] :: type-value pair +``` - 3, alarm - ~? >>> q - r - s - - Wide - ~?(>>> q r s) + +Used by compiler, and wherever typed date is worked with explicitly - Irregular - none + ~zod/try=> `vase`!>(~) + [p=[%cube p=0 q=[%atom p=%n]] q=0] - Reduction - See ++open +--- - [%sgzp p=twig q=twig] +###++vise -~! ("sigzap") is a natural rune for debugging uses only, -semantically equivalent to its own twig q. Should compilation -fail within q, ~! will show the type of p on the stacktrace. +``` +++ vise ,[p=typo q=*] :: old vase +``` - Tall - ~! p - q + +Used to convert from previously-typed data during reboot. - Wide - ~!(p q) +See `++typo`, `++seer` - Irregular - none +--- - Reduction - none, natural +###++wall - [%smcl p=twig q=tusk] +``` +++ wall (list tape) :: text lines (no \n) +``` -;: ("semcol") is a synthetic gate that applies p, a binary gate, -to the n-ary tuple q. + +Used where lists are convenient - Tall - ;: p - i.q - i.t.q - i.t.t.q - == + ~zod/try=> `wall`(wash [0 20] leaf/<(bex 256)>) + << + "\/115.792.089.237.\/" + " 316.195.423.570." + " 985.008.687.907." + " 853.269.984.665." + " 640.564.039.457." + " 584.007.913.129." + " 639.936" + "\/ \/" + >> - Wide - ;:(p i.q i.t.q i.t.t.q) - Irregular - :(p i.q i.t.q i.t.t.q) +--- - Reduction - See ++open +###++wain - [%smdt p=twig q=tusk] -XX determine function - - Tall - - Wide - - Irregular - - Reduction - See ++open - - [%smdq p=(list beer)] -XX determine if internal/external - -;" ("semdoq") is a synthetic rune used to make strings, -interpolated or not. - - Tall - - Wide - - Irregular - - Reduction - See ++open - - [%smsg p=twig q=tusk] - -XX to do - - Tall - - Wide - - Irregular - - Reduction - See ++open - - [%smsm p=twig q=twig] - -;; ("semsem") is a synthetic rune that types q as a fixpoint of p. -Semantically identical to ((hard p) q). - - Tall - ;; p - q - - Wide - ;;(p q) - - Irregular - none - - Reduction - See ++open - - [%tsbr p=tile q=twig] - -=| ("tisbar") is a synthetic rune that pushes ~(bunt al p) on the -subject and sends it to q. - - Tall - =| p - q - - Wide - =|(p q) - - Irregular - none - - Reduction - =+(_p q) - See ++open, ++bunt in ++al - - [%tscl p=tram q=twig] - -=: ("tiscol") is a synthetic rune that produces q with the subject -by p. Uses %cncb, and so cannot change the subject type. - - Tall - =: p.i.p q.i.p - p.i.t.p q.i.t.p - p.i.t.t.p q.i.t.t.p - == - q - - Wide - none - - Irregular - noen - - Reduction - See ++open - - [%tscn p=twig q=twig] -XX to do - Tall - - Wide - - Irregular - - Reduction - See ++open - - [%tsdt p=wing q=twig r=twig] - -=. ("tisdot") is a synthetic rune that produces r with p in the -subject set to q. Uses %cncb, and so cannot change the subject - p. - - Tall - =. p +``` +++ wain (list cord) :: text lines (no \n) +``` + + +Line list, instead of control characrters + + ~zod/try=> `wain`/som/del/rok + <|som del rok|> + ~zod/try=> `wain`(lore ^:@t/=main=/bin/tree/hoon) + <| + !: + :: /===/bin/tree/hoon + |= ^ + |= [pax=path fla=$|(~ [%full ~])] + =- ~[te/-]~ + =+ len=(lent pax) + =+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud) + |- ^- wain + =+ ark=;;(arch .^(cy/pax)) + =- ?~ q.ark - + [(crip (rend pax)) -] + %- zing + %- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a]))) + %- sort :_ aor + %- turn :_ |=([a=@t ~] a) + (~(tap by r.ark)) + |> + +--- + +###++wing + +``` +++ wing (list limb) :: +``` + + +Adress in subject + + ~zod/try=> `wain`/som/del/rok + <|som del rok|> + ~zod/try=> `wain`(lore (,@ .^(cx//=main=/bin/tree/hoon))) + <| + !: + :: /===/bin/tree/hoon + |= ^ + |= [pax=path fla=$|(~ [%full ~])] + =- ~[te/-]~ + =+ len=(lent pax) + =+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud) + |- ^- wain + =+ ark=;;(arch .^(cy/pax)) + =- ?~ q.ark - + [(crip (rend pax)) -] + %- zing + %- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a]))) + %- sort :_ aor + %- turn :_ |=([a=@t ~] a) + (~(tap by r.ark)) + |> + +--- + +###++wine + +``` +++ wine $| ?(%noun %path %tank %void %wall %wool %yarn) + $% [%atom p=term] :: + [%core p=(list ,@ta) q=wine] :: + [%face p=term q=wine] :: + [%list p=term q=wine] :: + [%pear p=term q=@] :: + [%pick p=(list wine)] :: + [%plot p=(list wine)] :: + [%stop p=@ud] :: + [%tree p=term q=wine] :: + [%unit p=term q=wine] :: + == :: +``` + + +Printable type. + + + ~zod/try=> ~(dole ut p:!>(*@tas)) + [p={} q=[%atom p=%tas]] + ~zod/try=> `wine`q:~(dole ut p:!>(*@tas)) + [%atom p=%tas] + + ~zod/try=> ~(dole ut p:!>(*path)) + [ p + { [ p=1 q - r - - =. p q - r - - Wide - =.(p q r) - - Irregular - none - - Reduction - See ++open - - [%tsfs p=twig q=twig] - XX not used - - [%tsgl p=twig q=twig] - -=< ("tisgal") is a synthetic rune that uses the product of q as -the subject of p. - - Tall - =< p - q - - Wide - =<(p q) - - Irregular - - Reduction - See ++open - - [%tshp p=twig q=twig] - -=- ("tishep") is a synthetic rune that pushes q on the subject -and sends it to p. Dual of =+ ("tislup") - - - Tall - =- p - q - - Wide - =- - - Irregular - none - - Reduction - See ++open - - [%tsgr p=twig q=twig] - -=> ("tisgar") is a natural rune that uses the product of p as the -subject of q. - - Tall - => p - q - - Wide - =>(p q) - - Irregular - none - - Reduction - none, natural - - [%tskt p=twig q=twig r=twig s=twig] - -=^ ("tisket") is a synthetic rune that handles a product which is -a cell of the new result, and a mutation to the subject. - - Tall - Kingside - =^ p - q - r - s - - Queenside - =^ p q - r - s - - Wide - =^(p q r s) - - Irregular - none - - Reduction - See ++open - - [%tsls p=twig q=twig] - -=+ ("tislus") is a synthetic rune that pushes p on the subject -and sends it to q. Semantically equavlent to Nock 8.Dual of =- ("tishep") - - Tall - =+ p - q - - Wide - =+(p q) - - Irregular - none - - Reduction - See ++open - - [%tspm p=tile q=twig] - - XX not used - - [%tspt p=tile q=twig] - - XX not used - - [%tstr p=term q=wing r=twig] - -=* ("tistar") is a natural rune that creates a %bull, or alias, -type. - - Tall - =* p q - r - - Wide - =*(p q r) - - Irregular - none - - Reduction - none, natural - - [%tssg p=tusk] - -=~ ("tissig") is a synthetic rune that composes a list of twigs. - - Tall - Kingside - =~ i.p - i.t.p - i.t.t.p - == - - Queenside - =~ i.p - i.t.p - i.t.t.p - == - - Wide - none - - Irregular - none - - Reduction - See ++open - - [%wtbr p=tusk] - -?| ("wutbar") is a synthetic rune that computes the "or" of the -loobeans in p. - - Tall - ?| i.p - i.t.p - i.t.t.p - == - - Wide - ?|(i.p i.t.p i.t.t.p) - - Irregular - |(i.p i.t.p i.t.t.p) - - Reduction - See ++open - - [%wthp p=wing q=tine] - -?- ("wuthep") is a synthetic rune that selects a case in q for -the actual type of p. - - Tall - Kingside - ?- p - p.i.q q.i.q - p.i.t.q q.i.t.q - p.i.t.t.q q.i.t.t.q - == - - Queenside - ?- p - p.i.q - q.i.q - p.i.t.q - q.i.t.q - p.i.t.t.q - q.i.t.t.q - == - - Wide - ?-(p p.i.q q.i.q, p.i.t.q q.i.t.q, p.i.t.t.q q.i.t.t.q) - - Irregular - none - - Reduction - See ++open - - [%wthz p=tiki q=tine] - -"wuthaz" is a synthetic internal rune that selects a case in q -for the actual type of p. - - Tall/Wide/Irregular - none, internal - - Reduction - See ++open - - [%wtcl p=twig q=twig r=twig] - -?: ("wutcol") is a natural rune that produces q if p is yes (&, 0), -or r if p is no (|, 1). - - Tall - ?: p - q - r - - Wide - ?:(p q r) - - Irregular - none - - Reduction - none, natural - - [%wtdt p=twig q=twig r=twig] - -?. ("wutdot") is a synthetic rune that prduces r if p is yes -(&, 0), of q if p is no (|, 1). - - Tall - ?. p + [ %pick + p + ~[ + [%pear p=%n q=0] + [%plot p=~[[%face p=%i q=[%atom p=%ta]] [%face p=%t q=[%stop p=1]]]] + ] + ] + ] + } + q=%path + ] + ~zod/try=> `wine`q:~(dole ut p:!>(*path)) + %path + + ~zod/try=> ~(dole ut p:!>(*(map time cord))) + [ p + { [ p=1 q - r + [ %pick + p + ~[ + [%pear p=%n q=0] + [ %plot + p + ~[ + [ %face + p=%n + q + [ %plot + p=~[[%face p=%p q=[%atom p=%da]] [%face p=%q q=[%atom p=%t]]] + ] + ] + [%face p=%l q=[%stop p=1]] + [%face p=%r q=[%stop p=1]] + ] + ] + ] + ] + ] + } + q + [ %tree + p=%nlr + q=[%plot p=~[[%face p=%p q=[%atom p=%da]] [%face p=%q q=[%atom p=%t]]]] + ] + ] + ~zod/try=> `wine`q:~(dole ut p:!>(*(map time cord))) + [ %tree + p=%nlr + q=[%plot p=~[[%face p=%p q=[%atom p=%da]] [%face p=%q q=[%atom p=%t]]]] + ] + +--- + +###++wonk + +``` +++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) :: +:: :: +:: :: +``` + + +Forcibly pull result out of edge + +XX Not a model? + + ~zod/try=> (wide:vast [1 1] "(add 2 2)") + [ p=[p=1 q=10] + q + [ ~ + [ p=[%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]] + q=[p=[p=1 q=10] q=""] + ] + ] + ] + ~zod/try=> (wonk (wide:vast [1 1] "(add 2 2)")) + [%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]] + +--- + +###++map + +``` +++ map |* [a=_,* b=_,*] :: associative array + $|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) :: +``` + + +Tile constructor: treap of pairs + +Used with `++by` engine. + + ~zod/try=> :type; *(map ,@t ,@u) + {} + nlr([p=@t q=@u]) + ~zod/try=> `(map ,@ta ,@ud)`(mo (limo a/1 b/2 ~)) + {[p=~.a q=1] [p=~.b q=2]} + +--- + +###++qeu + +``` +++ qeu |* a=_,* :: queue + $|(~ [n=a l=(qeu a) r=(qeu a)]) :: +``` - Wide - ?:(p q r) - - Irregular - none - - Reduction - none, natural - - [%wtkt p=wing q=twig r=twig] - -?^ ("wutkey") is a synthetic rune that evaluates r if p is -equivalent to the bunt for its tile, otherwise q is evaluted. - - Tall - ?^ p - q - r - - Wide - ?^(p q r) - - Irregular - none - - Reduction - See ++open - - [%wtkz p=tiki q=twig r=twig] - -"wutkaz" is a synthetic, internal rune that evaluates r if p is -equivalent to the bunt for its tile, otherwise q is evaluated. -See tikis. - - Tall - ?^ p - q - r - - Wide - ?^(p q r) - - Irregular - none - - Reduction - See ++open - - [%wtgl p=twig q=twig] - -?< ("wutgal") is a synthetic hoon that produces q, asserting that -p is no (|, 1). - - Tall - ?< p - q - - Wide - ?<(p q) - - Irregular - none - - Reduction - See ++open - - [%wtgr p=twig q=twig] - -?> ("wutgar") is a synthetic hoon that produces q, asserting that -p is yes (&, 0). - - Tall - ?> p - q - - Wide - ?>(p q) - - Irregular - none - - Reduction - See ++open - - [%wtls p=wing q=twig r=tine] - -?+ ("wutlus") is a synthetic rune that selects a case in q for -the actual type of p. - - Tall - Kingside - ?+ p - q - p.i.r q.i.r - p.i.t.r q.i.t.r - p.i.t.t.r q.i.t.t.r - == - - Queenside - ?+ p - q - p.i.r - q.i.r - p.i.t.r - q.i.t.r - p.i.t.t.r - q.i.t.t.r - == - - Wide - ?+(p p.i.r q.i.r, p.i.t.r q.i.t.r, p.i.t.t.r q.i.t.t.r) - - Irregular - none - - Reduction - See ++open - - [%wtlz p=tiki q=twig r=tine] - -"wutlaz" is a synthetic, internal rune that selects a case in q for -the actual type of p. - - Tall/Wide/Irregular - none, internal - - Reduction - See ++open - - [%wtpm p=tusk] - -?& ("wutpam") is a synthetic hoon that computes the "and" of the -loobeans in p. - - Tall - ?& i.p - i.t.p - i.t.t.p - == - - Wide - ?&(i.p i.t.p i.t.t.p) - - Irregular - none - - Reduction - See ++open - - [%wtpt p=wing q=twig r=twig] - -?@ ("wutpat") is a synthetic hoon that produces q if p is an -atom, r otherwise. - - Tall - Kingside - ?@ p - q - r - - Queenside - ?@ p - q - r - - Wide - ?@(p q r) - - Irregular - none - - Reduction - See ++open - - [%wtpz p=tiki q=twig r=twig] - -"wutpaz" is a synthetic hoon that produces q if p is an atom, r -otherwise. - - Tall - ?@ p - q - r - - Wide - ?@(p q r) - - Irregular - none - - Reduction - See ++open - - [%wtsg p=wing q=twig r=twig] - -?~ ("wutsig") is a synthetic rune that produces q if p is ~, r -otherwise. - - Tall - ?~ p - q - r - - Wide - ?~(p q r) - - Irregular - none - - Reduction - See ++open - - [%wtsz p=tiki q=twig r=twig] - -"wutsaz" is a synthetic internal rune that produces q if p is ~, -r otherwise. - - Tall/Wide/Irregular - none, internal - - Reduction - See ++open - - [%wtts p=tile q=wing] - -?= ("wuttis") is a natural rune that produces true if the leg at -wing q is in tile p. - - Tall - ?= p - q - - Wide - ?=(p q) - - Irregular - none - - Reduction - none, natural - - [%wtzp p=twig] - -?! ("wutzap") is a synthetic rune that produces the logical "not" -of p. - - Tall - ?! p - - Wide - ?!(p) - - Irregular - !p - - Reduction - See ++open - - [%zpcb p=spot q=twig] -XX tall/wide form -!_ ("zapcab") is a natural rune that puts debugging information -in the stack trace. - - Tall - Wide +Tile consturctor: treap of type, ordered - Irregular - none - - Reduction - none, natural - - [%zpcm p=twig q=twig] - -!, ("zapcom") is a natural rune that inserts twig q as a -constant, typed with the type of twig p. - - Tall - !, p - q - - Wide - !,(p q) - - Irregular - none - - Reduction - none, natural - - [%zpcn ~] -XX determine function -!% ("zapcen") - - Tall - - Wide - - Irregular - - Reduction - See ++open - - [%zpfs p=twig] -XX tall/wide -!/ ("zapfas") is a natural rune that should never be compiled. -When compiled with error checking turned on, it reports its -subject as an error. - - Tall - - Wide - - Irregular - - Reduction - See ++open - - [%zpgr p=twig] - -!> ("zapgar") is a synthetic rune that produces a vase (a -[type noun] cell) with the value p. - - Tall - !> p - - Wide - !>(p) - - Irregular - none - - Reduction - See ++open - - [%zpsm p=twig q=twig] - -!; ("zapsem") is a natural rune that produces the product of twig -q as a [type noun] pair, with twig p defining the type of the type. - - Tall - !; p - q - - Wide - !;(p q) - - Irregular - none - - Reduction - none, natural - - [%zpts p=twig] - -!= ("zaptis") is a natural rune that produces the formula of twig -p as a noun. - - Tall - != p - - Wide - !=(p) - - Irregular - none - - Reduction - none, natural - - [%zpwt p=$|(p=@ [p=@ q=@]) q=twig] - -!? ("zapwut") is a synthetic rune that enforces a Hoon version -restriction. - - Tall - !? p - q - - Wide - none - - Irregular - none - - Reduction - See ++open - - [%zpzp ~] - -!! ("zapzap") is a natural rune that always causes a crash when -executed. - - Tall - none - - Wide - !! - - Irregular - none - - Reduction - none, natural +Used with `++to` engine. --- -###tine +###++set + +``` +++ set |* a=_,* :: set + $|(~ [n=a l=(set a) r=(set a)]) :: +``` + + +Tile consturctor: treap of type, unique + +Used with `++in` engine. + + ~zod/try=> (sa "abc") + {~~a ~~c ~~b} + ~zod/try=> (~(put in (sa "abc")) %d) + {~~d ~~a ~~c ~~b} + ~zod/try=> (~(put in (sa "abc")) %a) + {~~a ~~c ~~b} - ++ tine (list ,[p=tile q=twig]) :: --- -###tusk +###++jar - ++ tusk (list twig) :: +``` +++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists +``` ---- - -###tyre - - ++ tyre (list ,[p=term q=twig]) :: - ---- - -###tyke - - ++ tyke (list (unit twig)) :: - ---- - -###tram - - ++ tram (list ,[p=wing q=twig]) :: - ---- - -###tone - - ++ tone $% [%0 p=*] :: - [%1 p=(list)] :: - [%2 p=(list ,[@ta *])] :: - == :: - ---- - -###nock - - ++ nock $& [p=nock q=nock] :: autocons - $% [%0 p=@] :: axis select - [%1 p=*] :: constant - [%2 p=nock q=nock] :: compose - [%3 p=nock] :: cell test - [%4 p=nock] :: increment - [%5 p=nock q=nock] :: equality test - [%6 p=nock q=nock r=nock] :: if, then, else - [%7 p=nock q=nock] :: serial compose - [%8 p=nock q=nock] :: push onto subject - [%9 p=@ q=nock] :: select arm and fire - [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint - [%11 p=nock] :: grab data from sky - == :: - ---- - -###toon - - ++ toon $% [%0 p=*] :: - [%1 p=(list)] :: - [%2 p=(list tank)] :: - == :: - ---- - -###tune - - ++ tune $% [%0 p=vase] :: - [%1 p=(list)] :: - [%2 p=(list ,[@ta *])] :: - == :: - ---- - -###twin - - ++ twin ,[p=term q=wing r=axis s=type] :: - ---- - -###type - -A type is a noun that: - -One, it defines a set of nouns. Any finite noun is either in this set, or -not in it. - -Two, it ascribes semantics to all nouns in this set. For example, a Hoon -type exports a semantic namespace. - -A lot of other languages use dynamic types, in which the type of a -value is carried along with the data as you use it. Even languages like -Lisp, which are nominally typeless, look rather typed from the Hoon -perspective. For example, a Lisp atom knows dynamically whether it's a -symbol or an integer. A Hoon atom is just a Nock atom, which is just a -number. So without a static type, Hoon doesn't even know how to print -an atom properly. -There are 9 cases of ++type: +Tile constructor. - ?(%noun %void) - -Either %noun or %void. %noun is the set of all nouns. %void is the -set of no nouns. - - ~zod/try=> :type; * - 0 - * - - ~zod/try=> -:!>(*) - %noun - - ~zod/try=> :type; `*`%noun - 1.853.189.998 - * - - ~zod/try=> -:!>(`*`%noun) - %noun - -We can't show any examples producing %void - by definition, none of -them would terminate. Because that's what %void means. All other -cases in ++type are subsets of %noun. - - [%atom p=term] - -An atom is a natural number, with a term (known as an -odor) that specificies an atomic subtype. - -An odor is an ASCII span. This span is a taxonomy which -grows more specific to the right. For instance, @t -for UTF-8 text, @ta for URL-safe ASCII text, @tas for -a Hoon symbol; or @u for an unsigned integer, @ux for -an unsigned integer formatted as hexadecimal. - -Hoon knows about the following odors, with defined meanings: - - @c UTF-32 codepoint - @d date - @da absolute date - @dr relative date (ie, timespan) - @f yes or no (inverse boolean) - @n nil - @p phonemic base - @r IEEE floating-point - @rd double precision (64 bits) - @rh half precision (16 bits) - @rq quad precision (128 bits) - @rs single precision (32 bits) - @s signed integer, sign bit low - @sb signed binary - @sd signed decimal - @sv signed base32 - @sw signed base64 - @sx signed hexadecimal - @t UTF-8 text (cord) - @ta ASCII text (span) - @tas ASCII symbol (term) - @u unsigned integer - @ub unsigned binary - @ud unsigned decimal - @uv unsigned base32 - @uw unsigned base64 - @ux unsigned hexadecimal - -Atoms change freely either up or down the taxonomy, -but not across. You can treat a @tas as -a @t, as in a strong type system; but you can also -treat a @t as a @tas, or an @ as anything. However, -passing a @t to a function that expects an @ux is a -type error. - -Each of these forms has a URL-safe syntax. Each -parses as an atomic constant in Hoon, and each is -printed by the Hoon prettyprinter. - - ~zod/try=> :type; 0x42 - 0x42 - @ux - - ~zod/try=> `@ud`0x42 - 66 - - ~zod/try=> :type; 'foo' - 'foo' - @ta - - ~zod/try=> `@ud`'foo' - 7.303.014 - - ~zod/try=> :type; ~2013.12.6 - ~2013.12.6 - @da - - ~zod/try=> `@ud`~2013.12.6 - 170.141.184.500.724.667.905.957.736.036.171.776.000 - - ~zod/try=> `@ud`.127.0.0.1 - 2.130.706.433 - - ~zod/try=> :type; .127.0.0.1 - .127.0.0.1 - @if - - ~zod/try=> :type; ~m45 - ~m45 - @dr - - ~zod/try=> `@ud`~m45 - 49.806.208.999.015.789.363.200 - - ~zod/try=> :type; `@da`(add ~2013.12.6 ~m45) - ~2013.12.6..00.45.00 - @da - -The variety of units and formats which an atom can -represent is essentially infinite. The set of -syntaxes which Hoon can parse and print is -fundamentally limited. - -For instance, Hoon has no syntax which means "number -of miles." But within your program, nothing stops you -from using the odor system to distinguish a number of -miles from, for instance, a number of kilometers: - - ~zod/try=> `@udm`25.717 - 25.717 - ~zod/try=> `@udk`25.717 - 25.717 - -The printer has no idea what a @udm is, but it knows -what a @ud is and can print accordingly. Then, if you -have a function which expects a @udm and you try to -pass it a @udk, it will fail. - -Besides these prefixes, which indicate the rendering -and/or meaning of atoms, the odor system has another -orthogonal mechanism to restrict the size of atoms. -Like the prefix, this mechanism is weak - it is not -enforced and trivially evaded. - -An odor span contains two parts, both optional: a -lowercase prefix and an uppercase suffix. The suffix, -if present, is a single character A-Z c which -indicates an atom of size less than or equal to n -bits, where n is 1 << (c - 'A'). Thus, @tD is one -UTF-8 byte (whatever that means); @tN is a kilobyte -or less of UTF-8. - -When enforcing conversions, @t has no size -information and can be used as @tD; and @tD, of -course, can be used as @t. But using @tN as @tD is an -error. There is no way to generate the smell of size -from a constant without a cast. And of course -arithmetic results have no odor at all. - -A full table for convenience: - - A 1 bit - B 2 bits - C 4 bits - D 1 byte - E 2 bytes - F 4 bytes - G 8 bytes - H 16 bytes - I 32 bytes - J 64 bytes - K 128 bytes - L 256 bytes - M 512 bytes - N 1K - O 2K - P 4K - Q 8K - R 16K - S 32K - T 64K - U 128K - V 256K - W 512K - X 1MB - Y 2MB - Z 4MB - -You of course can build an atom larger than 4MB, but -the type system cannot express a size odor above 4MB. - - - [%bull p=twin q=type] - - [%cell p=type q=type] - -A pair of types. Set: all cells of p and q. - - ~zod/try=> :type; [3 4] - [3 4] - [@ud @ud] - - ~zod/try=> -:!>([3 4]) - - ~zod/try=> :type; [3 4] - [3 4] - [@ud @ud] - - ~zod/try=> -:!>([3 4]) - [%cell p=[%atom p=%ud] q=[%atom p=%ud]] - - [%core p=type q=coil] - - [%cube p=* q=type] - -When we enter an ordinary constant, like 42, its type [%atom %ud] -is the set of all atoms (with odor @ud, but any atom can have that -or any odor). Its type is certainly not the set consisting -exclusively of the value 42. - -But here's how we produce this "cubical" constant: - - ~zod/try=> :type; %42 - %42 - %42 - - ~zod/try=> -:!>(%42) - [%cube p=42 q=[%atom p=%ud]] - -In general, a %cube type contains p, a single noun, and q, a base -type which provides semantics. - -Syntactically, any atomic constant can be preceded by % to generate -a cube. The exception is @tas, which always needs % and is always -cubical. - - [%face p=term q=type] - -A type is not just a set of nouns - it's also a meaning which makes -sense of any noun in that set. The typed noun exports a namespace - -give it a name, and it gives you another noun. - - ~zod/try=> foo=42 - foo=42 - ~zod/try=> :type; foo=42 - foo=42 - foo=@ud - ~zod/try=> -:!>(foo=42) - [%face p=%foo q=[%atom p=%ud]] - -With %face, we've simply wrapped a label around another type. Note -that this doesn't impair our ability to compute with the value. -Computationally, foo=42 is just 42: - - ~zod/try=> (add 17 foo=42) - 59 - - [%fork p=type q=type] - -A union type. [%fork p q] means "it could be a p, or maybe a q." - -Any branching computation in which different branches produce -different types will generate a fork. For example: - - ~zod/try=> :type; ?:(& %foo [13 10]) - %foo - { %foo [@ud @ud] } - - ~zod/try=> -:!>(?:(& %foo [13 10])) - [ %fork - p=[%cube p=7.303.014 q=[%atom p=%tas]] - q=[%cell p=[%atom p=%ud] q=[%atom p=%ud]] - ] - -Here we start to understand why the type renderer is useful, as -{ %foo [@ud @ud] } (which is not in any way Hoon syntax) is a -little easier to read than the actual type noun. - -(Readers of a mathematical bent may ask: since Hoon has a union -type, where is the intersection type? There is none. Hoon is not -one of these languages whose goal is to be as mathematically -powerful as possible. Since a programming language is a UI for -programmers, and programmers are not mathematicians, Hoon is -designed to be as powerful as it has to be - and no more.) - - [%hold p=(list ,[p=type q=twig])] +Used with `++ja` and `++by` engines. --- -###typo +###++jug -Deprecated type name maintained for compatability. +``` +++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets +``` - ++ typo type :: old type - ---- - -###udal - - ++ udal :: atomic change (%b) - $: p=@ud :: blockwidth - q=(list ,[p=@ud q=(unit ,[p=@ q=@])]) :: indels - == :: - ---- - -###udon - - ++ udon :: abstract delta - $: p=umph :: preprocessor - $= q :: patch - $% [%a p=* q=*] :: trivial replace - [%b p=udal] :: atomic indel - [%c p=(urge)] :: list indel - [%d p=upas q=upas] :: tree edit - == :: - == :: - ---- - -###umph - - ++ umph :: change filter - $| $? %a :: no filter - %b :: jamfile - %c :: LF text - == :: - $% [%d p=@ud] :: blocklist - == :: - ---- - -###unce - - ++ unce |* a=_,* :: change part - $% [%& p=@ud] :: skip[copy] - [%| p=(list a) q=(list a)] :: p -> q[chunk] - == :: - ---- - -###unit - - ++ unit |* a=_,* :: maybe - $|(~ [~ u=a]) :: - ---- - -###upas - - ++ upas :: tree change (%d) - $& [p=upas q=upas] :: cell - $% [%0 p=axis] :: copy old - [%1 p=*] :: insert new - [%2 p=axis q=udon] :: mutate! - == :: - ---- - -###urge - - ++ urge |*(a=_,* (list (unce a))) :: list change - ---- - -###vase - - ++ vase ,[p=type q=*] :: type-value pair - ---- - -###vise - - ++ vise ,[p=typo q=*] :: old vase - ---- - -###wall - - ++ wall (list tape) :: text lines (no \n) - ---- - -###wain - - ++ wain (list cord) :: text lines (no \n) - ---- - -###wing - - ++ wing (list limb) :: - ---- - -###wine - - ++ wine $| ?(%noun %path %tank %void %wall %wool %yarn) - $% [%atom p=term] :: - [%core p=(list ,@ta) q=wine] :: - [%face p=term q=wine] :: - [%list p=term q=wine] :: - [%pear p=term q=@] :: - [%pick p=(list wine)] :: - [%plot p=(list wine)] :: - [%stop p=@ud] :: - [%tree p=term q=wine] :: - [%unit p=term q=wine] :: - == :: - ---- - -###wonk - - ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) :: - ---- - -###map - - ++ map |* [a=_,* b=_,*] :: associative array - $|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) :: - ---- - -###qeu - - ++ qeu |* a=_,* :: queue - $|(~ [n=a l=(qeu a) r=(qeu a)]) :: - ---- - -###set - - ++ set |* a=_,* :: set - $|(~ [n=a l=(set a) r=(set a)]) :: - ---- - -###jar - - ++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists - ---- - -###jug - - ++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets + +Tile constructor. + +Used with `++ja` and `++by` engines. --- From 7341f653f9029c05d39753584ccaadce90639432 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 29 Sep 2014 23:36:25 -0700 Subject: [PATCH 36/63] really really finished clay doc --- main/pub/src/doc/ref/vol/4c.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index 571eead4c..7f1acedeb 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -2233,7 +2233,7 @@ a yaki out of the generated change information and produce both it and the new object store. In increasing order of complexity, the new arms here are `++make-yaki`, -`++update-lat`, and `++make-yaki`. +`++update-lat`, and `++apply-changes`. ``` ++ make-yaki :: make yaki From 91370e9b81473613a0c065b439538bb9ceed1300 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 30 Sep 2014 09:45:51 -0700 Subject: [PATCH 37/63] Various fixes and improvements. --- arvo/hoon.hoon | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 61e83a441..a87967ccf 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -45,11 +45,6 @@ q=* :: battery r=(unit (pair axis chub)) :: parent == :: -++ chum $? lef=term :: jet name - [std=term kel=@] :: kelvin version - [ven=term pro=term kel=@] :: vendor and product - [ven=term pro=term ver=@ kel=@] :: all of the above - == :: ++ clue ,[p=axis q=chum r=tyre] :: battery definition ++ coil $: p=?(%gold %iron %lead %zinc) :: core type q=type :: @@ -9325,7 +9320,7 @@ ++ expv |.(lobe) :: tile ++ expw |.(;~(gunk lobe rope)) :: tile and wing ++ expx |.((butt ;~(gunk teak race))) :: tiki, [tile twig]s - ++ expy |.((butt ;~(gunk teak loaf race))) :: tiki twig [tile twig]s + ++ expy |.((butt ;~(gunk teak loaf race))) :: tki twig [tile twig]s ++ expz |.(loaf(bug &)) :: twig with tracing :: Hint syntaces (nock 10) ++ hina |. :: unused From 179fa6d6c6e92ee59e628a2ab0713591339c6a78 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 3 Oct 2014 18:22:37 -0700 Subject: [PATCH 38/63] Comments --- arvo/hoon.hoon | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index acb1a7681..66540241b 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1138,18 +1138,20 @@ /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\ /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes' |% - ++ ind ~/ %ind + ++ ind ~/ %ind :: parse prefix |= a=@ =+ b=0 |- ^- (unit ,@) ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b)))) - ++ ins ~/ %ins + ++ ins ~/ %ins :: parse suffix |= a=@ =+ b=0 |- ^- (unit ,@) ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b)))) - ++ tod ~/(%tod |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))) - ++ tos ~/(%tos |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))) + ++ tod ~/ %tod :: fetch prefix + |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex))) + ++ tos ~/ %tos :: fetch suffix + |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis))) -- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cF, signed and modular ints :: @@ -1203,9 +1205,9 @@ -- ++ fe :: modulo bloq |_ a=bloq - ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c)))) - ++ inv |=(b=@ (sub (dec out) (sit b))) - ++ net |= b=@ ^- @ + ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c)))) :: difference + ++ inv |=(b=@ (sub (dec out) (sit b))) :: inverse + ++ net |= b=@ ^- @ :: flip byte endianness => .(b (sit b)) ?: (lte a 3) b @@ -1213,19 +1215,19 @@ %+ con (lsh c 1 $(a c, b (cut c [0 1] b))) $(a c, b (cut c [1 1] b)) - ++ out (bex (bex a)) - ++ rol |= [b=bloq c=@ d=@] ^- @ + ++ out (bex (bex a)) :: mod value + ++ rol |= [b=bloq c=@ d=@] ^- @ :: roll left =+ e=(sit d) =+ f=(bex (sub a b)) =+ g=(mod c f) (sit (con (lsh b g e) (rsh b (sub f g) e))) - ++ ror |= [b=bloq c=@ d=@] ^- @ + ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right =+ e=(sit d) =+ f=(bex (sub a b)) =+ g=(mod c f) (sit (con (rsh b g e) (lsh b (sub f g) e))) - ++ sum |=([b=@ c=@] (sit (add b c))) - ++ sit |=(b=@ (end a 1 b)) + ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add + ++ sit |=(b=@ (end a 1 b)) :: enforce modulo -- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cG, floating point :: @@ -1767,31 +1769,32 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cI, almost macros :: :: -++ cury +++ cury :: curry left |* [a=_|=(^ _*) b=*] |* c=_+<+.a (a b c) :: -++ curr +++ curr :: curry right |* [a=_|=(^ _*) c=*] |* b=_+<+.a (a b c) :: -++ cork |*([a=_,* b=gate] (corl b a)) +++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward :: -++ corl +++ corl :: compose backwards |* [a=gate b=_,*] - |= c=_+<.b + =< +:|.((a (b))) :: type check + |* c=_+<.b (a (b c)) :: -++ hard +++ hard :: force coerce to type |* han=$+(* *) |= fud=* ^- han ~| %hard =+ gol=(han fud) ?>(=(gol fud) gol) :: -++ soft +++ soft :: maybe coerce to type |* han=$+(* *) |= fud=* ^- (unit han) =+ gol=(han fud) From 8f738539c2a30698573a8b8eabf43a5d812408d8 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 4 Oct 2014 14:57:40 -0700 Subject: [PATCH 39/63] Improved signal handling. --- arvo/kahn.hoon | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arvo/kahn.hoon b/arvo/kahn.hoon index e0ca2e02a..2790cdbf8 100644 --- a/arvo/kahn.hoon +++ b/arvo/kahn.hoon @@ -17,11 +17,11 @@ myn=(map ship girl) :: daughters == ++ axon :: all descendants - $: [%a p=hulk q=hulk r=hulk] :: carrier - [%b p=hulk q=hulk] :: cruiser - [%c p=hulk] :: destroyer - [%d p=hulk] :: yacht - [%e p=ship] :: submarine + $: [%a p=hulk q=hulk r=hulk] :: zeppelin + [%b p=hulk q=hulk] :: blimp + [%c p=hulk] :: balloon + [%d p=hulk] :: bubble + [%e p=ship] :: ghost == :: ++ clan :: ranked group $: pec=rank :: membership bar From d21bfc80e93b84f9171921425ae2a2ac7d846bf0 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 4 Oct 2014 16:20:55 -0700 Subject: [PATCH 40/63] Update h.h from test. --- arvo/hoon.hoon | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index a87967ccf..7e6b56c2a 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -45,6 +45,11 @@ q=* :: battery r=(unit (pair axis chub)) :: parent == :: +++ chum $? lef=term :: jet name + [std=term kel=@] :: kelvin version + [ven=term pro=term kel=@] :: vendor and product + [ven=term pro=term ver=@ kel=@] :: all of the above + == :: ++ clue ,[p=axis q=chum r=tyre] :: battery definition ++ coil $: p=?(%gold %iron %lead %zinc) :: core type q=type :: @@ -9320,7 +9325,7 @@ ++ expv |.(lobe) :: tile ++ expw |.(;~(gunk lobe rope)) :: tile and wing ++ expx |.((butt ;~(gunk teak race))) :: tiki, [tile twig]s - ++ expy |.((butt ;~(gunk teak loaf race))) :: tki twig [tile twig]s + ++ expy |.((butt ;~(gunk teak loaf race))) :: tiki twig [tile twig]s ++ expz |.(loaf(bug &)) :: twig with tracing :: Hint syntaces (nock 10) ++ hina |. :: unused @@ -9862,6 +9867,7 @@ bed=beam == ^- (unit (unit cage)) + :: ~& [%arvo-scry ren bed] =+ ^= old :* fur ren From 701487936d6a0b5afb0f51571a2ebb93d32faea3 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Wed, 8 Oct 2014 15:16:24 -0700 Subject: [PATCH 41/63] Now boots and runs a clean :solid. --- arvo/ford.hoon | 2 +- arvo/hoon.hoon | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 40aaa5cf4..181a4b4a3 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -268,7 +268,7 @@ :- hen :^ %pass [(scot %p our) (scot %ud num) (scot %ud p.kig) ~] %c - [%warp [our p.bem] q.bem [~ %& %x r.bem s.bem]] + [%warp [our p.bem] q.bem [~ %& ren r.bem s.bem]] == :: ++ clef :: cache a result diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 7e6b56c2a..b9849b488 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -809,13 +809,6 @@ +<-(+ $(+<- +<->)) -- :: -++ wild :: concatenate - |* [a=(list) b=(list)] - => .(a ^.(homo a), b ^.(homo b)) - |- - ?~ a b - [i=i.a $(a t.a)] -:: ++ zing :: promote =| * |% From 886b68b55c5b506343b23b0eb5c1804b8e02b6a0 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 9 Oct 2014 12:38:55 -0700 Subject: [PATCH 42/63] Propogated %ford heels Conflicts: urb/zod/main/mar/psal/door.hook --- arvo/ford.hoon | 2 +- main/mar/psal/door.hook | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 40aaa5cf4..b29f8be56 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -1084,7 +1084,7 @@ (flaw cof [%leaf "type error: {} {}"]~) (fine cof [p.tug q.vax]) :: - %toy (cope (make cof %bake p.hon how ~) feel) + %toy (cope (make cof %bake p.hon how arg) feel) == :: ++ head :: consume structures diff --git a/main/mar/psal/door.hook b/main/mar/psal/door.hook index 8fad5222b..89900eb04 100644 --- a/main/mar/psal/door.hook +++ b/main/mar/psal/door.hook @@ -1,13 +1,15 @@ :: -:::: /hoon/core/psal/pro +:::: /hoon/core/psal/mar :: /? 314 |_ own=manx :: ++ grow :: convert to |% - ++ hymn ;html:(head:title:"Untitled" body:"+{own}") :: convert to %hymn + ++ hymn ;html:(head:title:"Untitled" body:"+{own}") :: convert to %hymn ++ html (crip (xmlt | hymn ~)) :: convert to %html ++ mime [/text/html (taco html)] :: convert to %mime -- --- +++ grab |% :: convert from + ++ noun manx :: clam from %noun +-- -- From 966ce01bc88e45bc24d3767f85f8c31c035652f5 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sun, 19 Oct 2014 16:47:49 -0700 Subject: [PATCH 43/63] New jet dashboard noun. --- arvo/hoon.hoon | 96 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 2 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index b9849b488..43548c575 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -49,8 +49,8 @@ [std=term kel=@] :: kelvin version [ven=term pro=term kel=@] :: vendor and product [ven=term pro=term ver=@ kel=@] :: all of the above - == :: -++ clue ,[p=axis q=chum r=tyre] :: battery definition + == +++ clue ,[p=chum q=nock r=(list (pair term nock))] :: battery definition ++ coil $: p=?(%gold %iron %lead %zinc) :: core type q=type :: r=[p=?(~ ^) q=(map term foot)] :: @@ -9535,6 +9535,98 @@ |= txt=@ta ^- twig (rash txt wide:vast) + +:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::: :::::: jet management; move me :::::: +:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: +++ bane ,@tas :: battery name +++ bash ,@uvH :: ctx identity hash +++ bosh ,@uvH :: local battery hash +++ batt ,* :: battery +++ dash :: jet engine + $: $: sys=(map batt bash) :: battery/identity + haw=(map bash corp) :: identity/core + == :: + top=(map bane bash) :: root core + == :: +++ corp :: core pattern + $: soh=bash :: identity + sah=(set batt) :: hashed batteries + sub=(map bane bash) :: subcores + huc=(map ,@tas nock) :: hooks + mop=(trel bane axis (each bash ,*)) :: mother + == :: +++ je !: :: dashboard door + |_ dash + ++ fill :: validated match + |= cor=* + ^- (unit bash) + %+ biff (find cor) + |= soh=bash + ^- (unit bash) + ?.((fine cor (~(got by haw) soh)) ~ `soh) + :: + ++ find :: simple match + |= cor=* + `(unit bash)`?@(cor ~ (~(get by sys) -.cor)) + :: + ++ fine :: validate context + |= [cor=* cop=corp] + ^- ? + =+ rah=.*(cor [0 q.mop.cop]) + ?- -.r.mop.cop + | =(rah p.r.mop.cop) + & $(cor rah, cop (~(got by haw) p.r.mop.cop)) + == + :: + ++ fsck :: parse classic chum + |= clu=clue + ^- [p=term q=axis r=(map term nock)] + :+ ?@ p.clu `@tas`p.clu + ?> ?=([@ @] p.clu) + (cat 3 -.p.clu (scot %ud +.p.clu)) + |- ^- axis + ?: ?=([10 *] q.clu) $(q.clu +>.q.clu) + ?: ?=([1 0] q.clu) 0 + ?> ?=([0 @] q.clu) +.q.clu + (~(gas by *(map term nock)) r.clu) + :: + ++ fuel :: attach battery + |= [cor=* cop=corp] + ^+ +> + =: sys (~(put by sys) -.cor soh.cop) + haw (~(put by haw) soh.cop cop) + == + ?- -.r.mop.cop + | +>(top (~(put by top) p.mop.cop soh.cop)) + & + =+ par=(~(got by haw) p.r.mop.cop) + %_ +>.$ + haw %+ ~(put by haw) soh.par + par(sub (~(put by sub.par) p.mop.cop soh.cop)) + == + == + :: + ++ fund :: register battery + |= [clu=clue cor=*] :: + ^+ +> + =+ cup=(find cor) + ?^ cup +>.$ + =+ cey=(fsck clu) + =+ ^= mop ^- (trel bane axis (each bash ,*)) + :- p.cey + ?: =(0 q.cey) + [3 %| +.cor] + [q.cey %& (~(got by sys) .*([0 q.cey] cor))] + =+ soh=(sham mop) + =+ cup=(~(get by haw) soh) + ?^ cup + %= +>.$ + haw + (~(put by haw) soh u.cup(sah (~(put in sah.u.cup) -.cor))) + == + (fuel cor `corp`[soh [-.cor ~ ~] ~ r.cey mop]) + -- :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: :::::: profiling support; move me :::::: :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: From 642b267072004763750d503dcd38cbe17e6cc386 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 21 Oct 2014 13:53:27 -0700 Subject: [PATCH 44/63] Add hoon jet management code. --- arvo/hoon.hoon | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 43548c575..a693408ac 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -5320,7 +5320,7 @@ |= [who=@p wud=@] (shas (mix %shak who) wud) :: -++ sham :: noun hash +++ sham :: 128bit noun hash |= yux=* ^- @uvH ^- @ ?@ yux (shaf %mash yux) @@ -9545,13 +9545,12 @@ ++ batt ,* :: battery ++ dash :: jet engine $: $: sys=(map batt bash) :: battery/identity - haw=(map bash corp) :: identity/core + haw=(map bash cope) :: identity/core == :: top=(map bane bash) :: root core == :: -++ corp :: core pattern +++ cope :: core pattern $: soh=bash :: identity - sah=(set batt) :: hashed batteries sub=(map bane bash) :: subcores huc=(map ,@tas nock) :: hooks mop=(trel bane axis (each bash ,*)) :: mother @@ -9571,15 +9570,15 @@ `(unit bash)`?@(cor ~ (~(get by sys) -.cor)) :: ++ fine :: validate context - |= [cor=* cop=corp] + |= [cor=* coe=cope] ^- ? - =+ rah=.*(cor [0 q.mop.cop]) - ?- -.r.mop.cop - | =(rah p.r.mop.cop) - & $(cor rah, cop (~(got by haw) p.r.mop.cop)) + =+ rah=.*(cor [0 q.mop.coe]) + ?- -.r.mop.coe + | =(rah p.r.mop.coe) + & $(cor rah, coe (~(got by haw) p.r.mop.coe)) == :: - ++ fsck :: parse classic chum + ++ fsck :: parse classic clue |= clu=clue ^- [p=term q=axis r=(map term nock)] :+ ?@ p.clu `@tas`p.clu @@ -9592,40 +9591,36 @@ (~(gas by *(map term nock)) r.clu) :: ++ fuel :: attach battery - |= [cor=* cop=corp] + |= [cor=* coe=cope] ^+ +> - =: sys (~(put by sys) -.cor soh.cop) - haw (~(put by haw) soh.cop cop) + =: sys (~(put by sys) -.cor soh.coe) + haw (~(put by haw) soh.coe coe) == - ?- -.r.mop.cop - | +>(top (~(put by top) p.mop.cop soh.cop)) + ?- -.r.mop.coe + | +>(top (~(put by top) p.mop.coe soh.coe)) & - =+ par=(~(got by haw) p.r.mop.cop) + =+ par=(~(got by haw) p.r.mop.coe) %_ +>.$ haw %+ ~(put by haw) soh.par - par(sub (~(put by sub.par) p.mop.cop soh.cop)) + par(sub (~(put by sub.par) p.mop.coe soh.coe)) == == :: ++ fund :: register battery |= [clu=clue cor=*] :: ^+ +> - =+ cup=(find cor) - ?^ cup +>.$ + ?. =(~ (find cor)) +>.$ =+ cey=(fsck clu) =+ ^= mop ^- (trel bane axis (each bash ,*)) :- p.cey ?: =(0 q.cey) - [3 %| +.cor] + [3 %| -.cor] [q.cey %& (~(got by sys) .*([0 q.cey] cor))] =+ soh=(sham mop) =+ cup=(~(get by haw) soh) ?^ cup - %= +>.$ - haw - (~(put by haw) soh u.cup(sah (~(put in sah.u.cup) -.cor))) - == - (fuel cor `corp`[soh [-.cor ~ ~] ~ r.cey mop]) + +>.$(sys (~(put by sys) -.cor soh)) + (fuel cor `cope`[soh ~ r.cey mop]) -- :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: :::::: profiling support; move me :::::: From a6783e6f431dc90f0b08771012b48410fe8260d3 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 23 Oct 2014 17:35:26 -0700 Subject: [PATCH 45/63] New cold jet storage. --- arvo/hoon.hoon | 87 -------------------------------------------------- 1 file changed, 87 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index a693408ac..bf091066c 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -9535,93 +9535,6 @@ |= txt=@ta ^- twig (rash txt wide:vast) - -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -:::::: :::::: jet management; move me :::::: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -++ bane ,@tas :: battery name -++ bash ,@uvH :: ctx identity hash -++ bosh ,@uvH :: local battery hash -++ batt ,* :: battery -++ dash :: jet engine - $: $: sys=(map batt bash) :: battery/identity - haw=(map bash cope) :: identity/core - == :: - top=(map bane bash) :: root core - == :: -++ cope :: core pattern - $: soh=bash :: identity - sub=(map bane bash) :: subcores - huc=(map ,@tas nock) :: hooks - mop=(trel bane axis (each bash ,*)) :: mother - == :: -++ je !: :: dashboard door - |_ dash - ++ fill :: validated match - |= cor=* - ^- (unit bash) - %+ biff (find cor) - |= soh=bash - ^- (unit bash) - ?.((fine cor (~(got by haw) soh)) ~ `soh) - :: - ++ find :: simple match - |= cor=* - `(unit bash)`?@(cor ~ (~(get by sys) -.cor)) - :: - ++ fine :: validate context - |= [cor=* coe=cope] - ^- ? - =+ rah=.*(cor [0 q.mop.coe]) - ?- -.r.mop.coe - | =(rah p.r.mop.coe) - & $(cor rah, coe (~(got by haw) p.r.mop.coe)) - == - :: - ++ fsck :: parse classic clue - |= clu=clue - ^- [p=term q=axis r=(map term nock)] - :+ ?@ p.clu `@tas`p.clu - ?> ?=([@ @] p.clu) - (cat 3 -.p.clu (scot %ud +.p.clu)) - |- ^- axis - ?: ?=([10 *] q.clu) $(q.clu +>.q.clu) - ?: ?=([1 0] q.clu) 0 - ?> ?=([0 @] q.clu) +.q.clu - (~(gas by *(map term nock)) r.clu) - :: - ++ fuel :: attach battery - |= [cor=* coe=cope] - ^+ +> - =: sys (~(put by sys) -.cor soh.coe) - haw (~(put by haw) soh.coe coe) - == - ?- -.r.mop.coe - | +>(top (~(put by top) p.mop.coe soh.coe)) - & - =+ par=(~(got by haw) p.r.mop.coe) - %_ +>.$ - haw %+ ~(put by haw) soh.par - par(sub (~(put by sub.par) p.mop.coe soh.coe)) - == - == - :: - ++ fund :: register battery - |= [clu=clue cor=*] :: - ^+ +> - ?. =(~ (find cor)) +>.$ - =+ cey=(fsck clu) - =+ ^= mop ^- (trel bane axis (each bash ,*)) - :- p.cey - ?: =(0 q.cey) - [3 %| -.cor] - [q.cey %& (~(got by sys) .*([0 q.cey] cor))] - =+ soh=(sham mop) - =+ cup=(~(get by haw) soh) - ?^ cup - +>.$(sys (~(put by sys) -.cor soh)) - (fuel cor `cope`[soh ~ r.cey mop]) - -- :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: :::::: profiling support; move me :::::: :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: From 47a6b869a8ba5de66f215f9fdcc445305fb731cb Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 25 Oct 2014 05:21:48 -0700 Subject: [PATCH 46/63] Almost there. --- arvo/hoon.hoon | 1 + main/bin/solid.hoon | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index bf091066c..f29625d8c 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -10042,6 +10042,7 @@ :::::: :::::: Postface :::::: :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: !: +~& %post-start =+ pit=`vase`!>(.) :: =+ bud=pit :: becomes tang =+ vil=(viol p.bud) :: cached reflexives diff --git a/main/bin/solid.hoon b/main/bin/solid.hoon index 699badc63..a87fdaf06 100644 --- a/main/bin/solid.hoon +++ b/main/bin/solid.hoon @@ -17,7 +17,9 @@ =+ ken=q:(~(mint ut %noun) %noun gen) ~& %solid-compiled =+ ^= all + ~& [%solid-ken (mug ken)] =+ all=.*(0 ken) + ~& %solid-loaded =+ ^= vay ^- (list ,[p=@tas q=@tas]) :~ [%$ %zuse] [%f %ford] From d5aee61ff15b949eb169558ce1650322a86a6851 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 25 Oct 2014 12:30:36 -0700 Subject: [PATCH 47/63] Performs a full :solid. --- main/bin/solid.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/bin/solid.hoon b/main/bin/solid.hoon index a87fdaf06..28bc82245 100644 --- a/main/bin/solid.hoon +++ b/main/bin/solid.hoon @@ -17,7 +17,7 @@ =+ ken=q:(~(mint ut %noun) %noun gen) ~& %solid-compiled =+ ^= all - ~& [%solid-ken (mug ken)] + ~& [%solid-ken `@ux`(mug ken)] =+ all=.*(0 ken) ~& %solid-loaded =+ ^= vay ^- (list ,[p=@tas q=@tas]) From ca945b0cbbff41a729265442ea93e25ffcbf463a Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 25 Oct 2014 14:28:14 -0700 Subject: [PATCH 48/63] Various fixes and improvements. --- arvo/batz.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/batz.hoon b/arvo/batz.hoon index 76eeef205..7dd879d07 100644 --- a/arvo/batz.hoon +++ b/arvo/batz.hoon @@ -387,7 +387,7 @@ (trip (rap 3 [hox '/' cwd ~])) ?~(loq "=" (scow u.loq)) ?~(cws "" (spud cws)) - "> " + "# " == ~ :: From b03ccf4b2c8ea2c9f0636fc7502b1ec514fe72ff Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Sun, 26 Oct 2014 21:34:40 -0700 Subject: [PATCH 49/63] Added psal:grow:/door/txt/mar Conflicts: urb/zod/main/mar/txt/door.hook --- main/mar/txt/door.hook | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 main/mar/txt/door.hook diff --git a/main/mar/txt/door.hook b/main/mar/txt/door.hook new file mode 100644 index 000000000..890247d53 --- /dev/null +++ b/main/mar/txt/door.hook @@ -0,0 +1,15 @@ +:: +:::: /hook/door/term-line/mar + :: +/? 314 +|_ txt=cord +:: +++ grab :: convert from + |% + ++ noun ,@t :: clam from %noun + -- +++ grow + |% + ++ psal ;div: {(trip txt)} + -- +-- From a05fe504988db309ecf362aae5ab40d421b17adb Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 30 Oct 2014 17:30:19 -0700 Subject: [PATCH 50/63] Fix lth bug. :-) --- arvo/batz.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/batz.hoon b/arvo/batz.hoon index 7dd879d07..76eeef205 100644 --- a/arvo/batz.hoon +++ b/arvo/batz.hoon @@ -387,7 +387,7 @@ (trip (rap 3 [hox '/' cwd ~])) ?~(loq "=" (scow u.loq)) ?~(cws "" (spud cws)) - "# " + "> " == ~ :: From 71add7cd31880a325b2ec81ee60b651ca6ba6cdf Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 31 Oct 2014 11:29:28 -0700 Subject: [PATCH 51/63] Repaired vestigal $_en --- arvo/hoon.hoon | 63 ++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 36 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 49ae7c93d..e6b1747a5 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -182,7 +182,7 @@ [1 p=term q=toga] :: deep toga [2 p=toga q=toga] :: cell toga == :: -++ trap ,_|.(_*) :: makes perfect sense +++ trap ,_|.(**) :: makes perfect sense ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple ,[p=a q=b r=c] :: ++ tuna :: tagflow @@ -659,14 +659,14 @@ ++ homo :: homogenize |* a=(list) ^+ =< $ - |% +- $ ?:(_? ~ [i=(snag 0 a) t=$]) + |% +- $ ?:(*? ~ [i=(snag 0 a) t=$]) -- a :: ++ limo :: listify |* a=* ^+ =< $ - |% +- $ ?~(a ~ ?:(_? [i=-.a t=$] $(a +.a))) + |% +- $ ?~(a ~ ?:(*? [i=-.a t=$] $(a +.a))) -- a :: @@ -1705,7 +1705,7 @@ ++ yall :: day # to day of year |= day=@ud ^- [y=@ud m=@ud d=@ud] - =+ [era=0 cet=0 lep=_?] + =+ [era=0 cet=0 lep=*?] => .(era (div day era:yo), day (mod day era:yo)) => ^+ . ?: (lth day +(cet:yo)) @@ -1771,12 +1771,12 @@ :: section 2cI, almost macros :: :: ++ cury - |* [a=_|=(^ _*) b=*] + |* [a=_|=(^ **) b=*] |* c=_+<+.a (a b c) :: ++ curr - |* [a=_|=(^ _*) c=*] + |* [a=_|=(^ **) c=*] |* b=_+<+.a (a b c) :: @@ -2892,10 +2892,10 @@ ?: =('\\' i.vib) ['\\' '\\' $(vib t.vib)] ?: ?|((gth i.vib 126) (lth i.vib 32) =(39 i.vib)) - ['\\' (weld ~(rux at i.vib) (runt [1 47] $(vib t.vib)))] + ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))] [i.vib $(vib t.vib)] :: -++ runt :: append to tape +++ runt :: prepend repeatedly |= [[a=@ b=@] c=tape] ^- tape ?: =(0 a) @@ -3050,7 +3050,7 @@ [?:(=('~' i.t.b) '~' ?>(=('-' i.t.b) '_')) $(b t.t.b)] [i.b $(b t.b)] :: -++ woad :: span format +++ woad :: cord format |= a=@ta ^- @t %+ rap 3 @@ -3083,7 +3083,7 @@ %'~' ['~' $(a c)] == :: -++ wood :: span format +++ wood :: cord format |= a=@t ^- @ta %+ rap 3 @@ -3255,8 +3255,6 @@ |=(a=tape (rap 3 ^-((list ,@) a))) (star ;~(pose nud low hep dot sig)) ++ voy ;~(pfix bas ;~(pose bas soq bix)) - ++ vym (bass 256 ;~(plug low (star ;~(pose low nud)))) - ++ vyn (bass 256 ;~(plug hep vym (easy ~))) -- ++ ag |% @@ -3276,13 +3274,6 @@ ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab))))) ++ lip =+ tod=(ape ted:ab) (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod)))) - ++ qut %+ ifix [soq soq] - %+ boss 256 - %- star ;~ pose - ;~(pfix bas ;~(pose bas soq bix:ab)) - ;~(less bas soq prn) - == - ++ sym (cook |=(a=(list ,@) (rap 3 a)) ;~(plug vym:ab (star vyn:ab))) ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab))))) ++ vum (bass 32 (plus siv:ab)) ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab))))) @@ -3942,7 +3933,7 @@ :: ++ cont |= [a=(map ,@u tape) b=(map ,@u tape)] - (~(gas by _(map ,@u tape)) (weld (~(tap by a)) (~(tap by b)))) + (~(gas by *(map ,@u tape)) (weld (~(tap by a)) (~(tap by b)))) :: ++ abor |= [a=char b=(unit ,[tape (map ,@u tape)])] @@ -3968,13 +3959,13 @@ ?~ bar bar b - ++ blak (some ["" _(map ,@u tape)]) + ++ blak (some ["" *(map ,@u tape)]) ++ word |=(a=char =((dis wordc:rags (bex a)) 0)) ++ deep |= [b=tape c=rege d=tape] ^- (unit ,[tape (map ,@u tape)]) ?- a - %dote ?~(b ~ (some [[i.b ~] _(map ,@u tape)])) + %dote ?~(b ~ (some [[i.b ~] *(map ,@u tape)])) %ende ?~(b blak ~) %sart ?:(=(b d) blak ~) %empt blak @@ -4000,11 +3991,11 @@ ?~ bar bar [~ [-.ft (~(put by +.ft) q.a -.ft)]] - [%lite *] ?~(b ~ ?:(=(i.b p.a) (some [[i.b ~] _(map ,@u tape)]) ~)) + [%lite *] ?~(b ~ ?:(=(i.b p.a) (some [[i.b ~] *(map ,@u tape)]) ~)) [%brac *] ?~ b ~ ?. =((dis (bex `@`i.b) p.a) 0) - (some [[i.b ~] _(map ,@u tape)]) + (some [[i.b ~] *(map ,@u tape)]) ~ [%eith *] =+ foo=(chet(a c) $(a p.a) b d) =+ bar=(chet(a c) $(a q.a) b d) @@ -4373,7 +4364,7 @@ :: ++ mule :: typed virtual ~/ %mule - |* taq=_|.(_*) + |* taq=_|.(**) =+ mud=(mute taq) ?- -.mud & [%& p=$:taq] @@ -4381,7 +4372,7 @@ == :: ++ mute :: untyped virtual - |= taq=_^?(|.(_*)) + |= taq=_^?(|.(**)) ^- (each ,* (list tank)) =+ ton=(mock [taq 9 2 0 1] |=(* ~)) ?- -.ton @@ -4723,7 +4714,7 @@ ++ ramp :: make r-m prime |= [a=@ b=(list ,@) c=@] ^- @ux :: [bits snags seed] => .(c (shas %ramp c)) - =+ d=_@ + =+ d=*@ |- ?: =((mul 100 a) d) ~|(%ar-ramp !!) @@ -4883,10 +4874,10 @@ => |% ++ cipa :: AES params $_ ^? |% - ++ co _[p=@ q=@ r=@ s=@] :: col coefs - ++ ix |+(a=@ _@) :: key index - ++ ro _[p=@ q=@ r=@ s=@] :: row shifts - ++ su _@ :: s-box + ++ co *[p=@ q=@ r=@ s=@] :: col coefs + ++ ix |+(a=@ *@) :: key index + ++ ro *[p=@ q=@ r=@ s=@] :: row shifts + ++ su *@ :: s-box -- -- |% @@ -4940,7 +4931,7 @@ :: ++ mcol |= [a=(list ,@) b=[p=@ q=@ r=@ s=@]] ^- (list ,@) - =+ c=[p=_@ q=_@ r=_@ s=_@] + =+ c=[p=*@ q=*@ r=*@ s=*@] |- ^- (list ,@) ?~ a ~ => .(p.c (cut 3 [0 1] i.a)) @@ -5037,7 +5028,7 @@ $(i +(i)) ++ ix :: key expand, inv |= a=@ ^- @ - =+ [i=1 j=_@ b=_@ c=co:pin] + =+ [i=1 j=*@ b=*@ c=co:pin] |- ?: =(nnr i) a @@ -6519,7 +6510,7 @@ :^ %wtcl :: ?: [%bczp %bean] :: ? [%bczp %null] :: ~ - :- [%ktts %i [%dtzy 'tD' _@]] :: :- i=~~ + :- [%ktts %i [%dtzy 'tD' *@]] :: :- i=~~ [%ktts %t [%cnzy %$]] :: t=$ |- ^- twig :: ?~ p.gen :: @@ -9752,7 +9743,7 @@ ^- vase ?: &(=(-.q.ves -.q.sev) =(+>.q.ves +>.q.sev)) ves :: unchanged, use old - sev(+<.q [_@da _@ =>(~ |+(* ~))]) :: clear to stop leak + sev(+<.q [*@da *@ =>(~ |+(* ~))]) :: clear to stop leak :: ++ swim |= $: org=@tas @@ -9976,7 +9967,7 @@ ?: ?=(%verb -.q.i.ova) $(ova t.ova, lac !lac) ?: ?=(%veer -.q.i.ova) - $(ova t.ova, +>.^$ (veer _@da q.i.ova)) + $(ova t.ova, +>.^$ (veer *@da q.i.ova)) =+(avo=$(ova t.ova) [[i.ova -.avo] +.avo]) :: ++ peek :: external inspect From 4f293076012bb0a01cdb9eaf1c1ee0005eb28c85 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 31 Oct 2014 15:36:01 -0700 Subject: [PATCH 52/63] Various fixes and improvements. --- arvo/ames.hoon | 2 +- arvo/batz.hoon | 2 +- arvo/clay.hoon | 1 + arvo/eyre.hoon | 2 +- arvo/ford.hoon | 2 +- arvo/gall.hoon | 2 +- arvo/zuse.hoon | 4 ++-- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 0d5f096ba..9420aa57d 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -1,4 +1,4 @@ -:: ames (4a), networking +!: :: ames (4a), networking :: |= pit=vase => =~ diff --git a/arvo/batz.hoon b/arvo/batz.hoon index 76eeef205..0b9251b84 100644 --- a/arvo/batz.hoon +++ b/arvo/batz.hoon @@ -1,6 +1,6 @@ +!: :: batz (4b), shell :: -:: |= pit=vase => =~ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 243dd3ad4..98d4d797d 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -1,3 +1,4 @@ +!: :: clay (4c), revision control :: |= pit=vase diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 232eb4bf8..b704bb188 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -1,4 +1,4 @@ -:: :: %eyre, http servant +!: :: %eyre, http servant !? 164 :::: |= pit=vase diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 181a4b4a3..090ebe91f 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -1,4 +1,4 @@ -:::::: +!::::: :: :: %ford, new execution control !? 164 :::: diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 847dfea2d..cd3933701 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -1,4 +1,4 @@ -:: :: %gall, user-level applications +!: :: %gall, user-level applications !? 164 :::: |= pit=vase diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 6ada5eaf2..979264a50 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1036,7 +1036,7 @@ %indirect p.p == :: -++ ze +++ ze !: |_ [lim=@da dome rang] ++ aeon-to-tako ~(got by hit) ++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki) @@ -1838,7 +1838,7 @@ == -- :: -++ zu :: filesystem +++ zu !: :: filesystem |= ank=ankh :: filesystem state =| myz=(list ,[p=path q=miso]) :: changes in reverse =| ram=path :: reverse path into From 69b63718cb7c8295e39e2888de9ecb0ba39f0d42 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 31 Oct 2014 16:45:09 -0700 Subject: [PATCH 53/63] Restructured deft, added /foo/'tape?'/baz path form --- arvo/hoon.hoon | 14 ++++++++------ arvo/zuse.hoon | 24 ++++++++++-------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index e6b1747a5..970e558e4 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2816,16 +2816,17 @@ ;~(less bas soq prn) ;~(pfix bas ;~(pose bas soq mes)) :: escape chars == -++ qut ;~ pose :: cord +++ qut ;~ simu soq :: cord + ;~ pose ;~ less soqs (ifix [soq soq] (boss 256 (more gon qit))) == + =+ hed=;~(pose ;~(plug (plus ace) vul) (just '\0a')) %- inde %+ ifix - :- ;~ plug soqs - ;~(pose ;~(plug (plus ace) vul) (just '\0a')) - == + :- ;~(plug soqs hed) ;~(plug (just '\0a') soqs) (boss 256 (star qat)) + == == :: ++ soqs ;~(plug soq soq soq) :: delimiting ''' @@ -8397,6 +8398,7 @@ ++ hasp ;~ pose (ifix [sel ser] wide) (stag %cnhp (ifix [pel per] (most ace wide))) + (stag %dtzy (stag %t qut)) %+ cook |=(a=coin [%dtzy ?:(?=([~ %tas *] a) %tas %ta) ~(rent co a)]) nuck:so @@ -8772,7 +8774,7 @@ (stag %dtzz (stag %tas (cold %$ buc))) (stag %dtzz (stag %f (cold & pam))) (stag %dtzz (stag %f (cold | bar))) - (stag %dtzz (stag %ta qut)) + (stag %dtzz (stag %t qut)) (cook (jock &) nuck:so) (cook |=(a=(list) [%clsg (posh ~ ~ (lent a) ~)]) (star cen)) :: (easy [%clsg (poof wer)]) @@ -9396,7 +9398,7 @@ (stag %leaf (stag %tas (cold %$ buc))) (stag %leaf (stag %f (cold & pam))) (stag %leaf (stag %f (cold | bar))) - (stag %leaf (stag %ta qut)) + (stag %leaf (stag %t qut)) %+ cook |= lot=coin ^- tile ?- -.lot diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index d159e3c10..8840ccee7 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2024,23 +2024,19 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 3bG, URL handling :: :: -++ deft :: import url path +++ deft :: parse url extension |= rax=(list ,@t) |- ^- pork ?~ rax [~ ~] - ?~ t.rax - =+ den=(trip i.rax) - =+ ^= vex - %- %- full - ;~(plug sym ;~(pose (stag ~ ;~(pfix dot sym)) (easy ~))) - [[1 1] (trip i.rax)] - ?~ q.vex - [~ [i.rax ~]] - [+.p.u.q.vex [-.p.u.q.vex ~]] - =+ pok=$(rax t.rax) - :- p.pok - [i.rax q.pok] + ?^ t.rax + [p.pok [i.rax q.pok]]:[pok=$(rax t.rax) .] + =+ ^- raf=(unit ,[p=term q=(unit term)]) + %+ rush i.rax + ;~(plug sym ;~((bend) (easy ~) ;~(pfix dot sym))) + ?~ raf + [~ [i.rax ~]] + [q.u.raf [p.u.raf ~]] :: ++ fain :: path restructure |= [hom=path raw=path] @@ -2282,7 +2278,7 @@ %+ cook |*(a=[* *] [+.a -.a]) ;~ plug thos - ;~(pose (stag ~ ;~(pfix col dim:ag)) (easy ~)) + ;~((bend) (easy ~) ;~(pfix col dim:ag)) == ++ thos :: 2396 host, no local ;~ plug From 21b6d4ec432c6592be0aa4368c97d35f1e7ae58d Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sat, 1 Nov 2014 15:13:18 -0700 Subject: [PATCH 54/63] Various fixes and improvements. --- arvo/jael.hoon | 19 ++++++++++++++++- arvo/kahn.hoon | 56 +++++++++++++++++++++++++------------------------- arvo/lunt.hoon | 4 ++-- 3 files changed, 48 insertions(+), 31 deletions(-) diff --git a/arvo/jael.hoon b/arvo/jael.hoon index 158e0969c..395070e1f 100644 --- a/arvo/jael.hoon +++ b/arvo/jael.hoon @@ -4,20 +4,37 @@ :: !? 164 :::: +:: %jael is logically homogeneous, but please follow these conventions: +:: +:: /cap :: foreign app keys +:: /service :: service name, eg %face +:: /appid :: your ship's app-id +:: /@uvH :: by hash +:: /@ud :: by number +:: /@tas :: by name +:: +:: /key :: foreign user secrets +:: /service :: service name, eg %face +:: /userid :: user identity + |= pit=vase => =~ :: structures |% ++ axle :: %jael state $: %0 :: + ent=@uwH :: entropy all=(map ship ,[p=@ q=safe]) :: entropy, secrets == :: +++ mast $: ent=@ + ++ mort ,[p=@da q=duct r=@] :: a mortal secret ++ gift :: out result <-$ $% [%done p=path q=@] :: key expired == :: ++ kiss :: in request ->$ - $% [%drop p=@p q=path r=@] :: discard key + $% [%kill p= + [%drop p=@p q=path r=@] :: discard key [%junk p=@] :: add entropy [%show p=@p q=path] :: read subtree [%tell p=@ q=path r=@da s=@] :: save key diff --git a/arvo/kahn.hoon b/arvo/kahn.hoon index 2790cdbf8..83ed3d62c 100644 --- a/arvo/kahn.hoon +++ b/arvo/kahn.hoon @@ -10,45 +10,45 @@ |% ++ axle :: %kahn state $: %0 :: - all=(map ship axel) :: state by owner + big=(unit ship) :: main ship, freeze + all=(unit axel) :: state once big == :: ++ axel :: all social state - $: rod=(list ship) :: ancestry upward - myn=(map ship girl) :: daughters - == + $: rod=(list ship) :: leadership upward + myn=(map ship girl) :: contacts + cir=(map ,@tas clan) :: contact groups + nac=(map narc ship) :: foreign to home + wyl=will :: cryptowill + == :: ++ axon :: all descendants - $: [%a p=hulk q=hulk r=hulk] :: zeppelin - [%b p=hulk q=hulk] :: blimp - [%c p=hulk] :: balloon - [%d p=hulk] :: bubble - [%e p=ship] :: ghost + $: [%a p=hulk q=hulk r=hulk s=hulk t=hulk] :: zeppelin + [%b p=hulk q=hulk r=hulk s=hulk] :: blimp + [%c p=hulk q=hulk r=hulk] :: balloon + [%d p=hulk q=hulk] :: drone + [%e p=hulk] :: bird == :: ++ clan :: ranked group - $: pec=rank :: membership bar + $: pec=rank :: rank conferred who=(set ship) :: members == :: ++ gift :: out result <-$ - $: [%notice p=ship q=action] - == + $: [%step p=ship q=girl] :: change contact + == :: ++ girl :: daughter record $: hop=pony :: status tip=rank :: rank - fig=(set narc) :: other identities - gor=(set ,@tas) :: memberships - out=(unit ship) :: stepmother - res=(unit ,@da) :: reserved until - == :: -++ hulk :: social state - $: rod=(list ship) :: ancestry upward - myn=(map ship girl) :: daughter status - cir=(map ,@tas clan) :: daughter groups + fig=(set narc) :: home to foreign + gor=(set ,@tas) :: in groups + out=(unit ship) :: exported to + wyl=will :: cryptowill == :: +++ hulk (map ship girl) :: social state ++ kiss :: change - $: [%reserve p=@ud q=@ud] :: reserve class/num - [%renew ~] :: self-renew - [%modify p=ship q=action] :: - [%await p=(unit trigger)] :: subscribe actions - == + $: [%lead p=(list ship)] :: set leadership + [%tact p=ship q=girl] :: set contact + [%will p=will] :: set will + == :: +++ mojo ?(%a %b %c %d %e) :: ship rank ++ trigger $: (set ship) (set clan) @@ -68,7 +68,7 @@ adopt: external to free == ++ narc path :: contact path -++ pony :: daughter status +++ pony :: contacts status $? %cold :: virginal %dead :: inoperative %fake :: virtual @@ -77,7 +77,7 @@ %left :: divorced %warm :: reserved == :: -++ rank :: privilege +++ rank :: privilege ring $? %0 :: enemy %1 :: guest %2 :: customer/vendor diff --git a/arvo/lunt.hoon b/arvo/lunt.hoon index fa0bee89c..3caf840ec 100644 --- a/arvo/lunt.hoon +++ b/arvo/lunt.hoon @@ -21,7 +21,7 @@ ++ home :: storage access $: pad=@uvH :: passcode huc=husk :: log server - sog=hulk :: + sog=hulk :: storage server == :: ++ hulk :: checkpoint service $% [%astr p=@ud q=@ud] :: S3 @@ -39,7 +39,7 @@ [%new p=brat q=@p r=home s=(list ovum)] :: create == :: ++ kiss :: request - $: [%com p=@p] :: toggle computer + $: [%com p=@p] :: toggle compute svr [%end p=brat] :: local end [%fan p=@ud] :: set local fanout [%kil ~] :: terminate ship From ca1aa945232fcf3ec478d927a8b080dbf680746d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Sun, 2 Nov 2014 23:27:52 -0800 Subject: [PATCH 55/63] Removed pre-ford http handling --- arvo/zuse.hoon | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 8840ccee7..39d00b602 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2048,16 +2048,6 @@ ?> &(?=(^ mer) =(i.mer i.moh)) $(mer t.mer, moh t.moh) :: -++ fest :: web synthesizer - |= [hom=path raw=path] - |* yax=$+(epic *) - (yax (fuel (fain hom raw))) -:: -++ folk :: silk construction - |= [hom=path raw=path] - |* yox=$+((pair beam path) *) - (yox (fain hom raw)) -:: ++ fuel :: parse fcgi |= [bem=beam but=path] ^- epic @@ -2093,27 +2083,6 @@ nyp == :: -++ gist :: convenient html - |= [hom=path raw=path] - |= yax=$+(epic marl) - %- (fest hom raw) - |= piq=epic - ^- manx - =+ ^= sip :: skip blanks - |= mal=marl - ?~(mal ~ ?.(|(=(:/(~) i.mal) =(:/([10 ~]) i.mal)) mal $(mal t.mal))) - =+ zay=`marl`(yax piq) - =. zay (sip zay) - =+ ^= twa - |- ^- [p=marl q=marl] - ?~ zay [~ ~] - ?: ?=([[[%head *] *] *] zay) - [c.i.zay ?:(?=([[[%body *] *] ~] t.zay) c.i.t.zay t.zay)] - ?: ?=([[[%title *] *] *] zay) - [[i.zay ~] t.zay] - [~ zay] - [/html [/head (sip p.twa)] [/body (sip q.twa)] ~] -:: ++ sifo :: 64-bit encode |= tig=@ ^- tape From e3d1cf1d002fa185e61d5bfc01fde0af2dc27ad0 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Sun, 2 Nov 2014 23:30:45 -0800 Subject: [PATCH 56/63] Moved old model epic arms to template explanation --- try/syn/web/template/htmn.hoon | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/try/syn/web/template/htmn.hoon b/try/syn/web/template/htmn.hoon index 2c15abdcb..70368cc17 100644 --- a/try/syn/web/template/htmn.hoon +++ b/try/syn/web/template/htmn.hoon @@ -1,6 +1,34 @@ !: :: Some uses of template syntax :: +=> |% :: no longer in %zuse + ++ fest :: web synthesizer + |= [hom=path raw=path] + |* yax=$+(epic *) + (yax (fuel (fain hom raw))) + :: + ++ gist :: convenient html + |= [hom=path raw=path] + |= yax=$+(epic marl) + %- (fest hom raw) + |= piq=epic + ^- manx + =+ ^= sip :: skip blanks + |= mal=marl + ?~(mal ~ ?.(|(=(:/(~) i.mal) =(:/([10 ~]) i.mal)) mal $(mal t.mal))) + =+ zay=`marl`(yax piq) + =. zay (sip zay) + =+ ^= twa + |- ^- [p=marl q=marl] + ?~ zay [~ ~] + ?: ?=([[[%head *] *] *] zay) + [c.i.zay ?:(?=([[[%body *] *] ~] t.zay) c.i.t.zay t.zay)] + ?: ?=([[[%title *] *] *] zay) + [[i.zay ~] t.zay] + [~ zay] + [/html [/head (sip p.twa)] [/body (sip q.twa)] ~] + :: + -- %- gist |= epic ^- marl From bb65c8d4678ba601472b5dd02123e8485f08d190 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Sun, 2 Nov 2014 23:49:09 -0800 Subject: [PATCH 57/63] Fixed ++sifo --- arvo/zuse.hoon | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 39d00b602..428f229fb 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2091,13 +2091,12 @@ =+ ^= cha 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' =+ ^= sif - %- flop |- ^- tape ?~ pad ~ =+ d=(end 0 6 pad) - [(cut 3 [0 d] cha) $(pad (rsh 0 6 pad))] - (weld (scag (sub (lent sif) poc) sif) (trip (fil 3 poc '='))) + [(cut 3 [d 1] cha) $(pad (rsh 0 6 pad))] + (weld (flop (slag poc sif)) (trip (fil 3 poc '='))) :: ++ urle :: URL encode |= tep=tape From 1dd447001b0506d3cecdceae67522070e8d45dd6 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 3 Nov 2014 00:05:07 -0800 Subject: [PATCH 58/63] Restructured earn --- arvo/zuse.hoon | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 428f229fb..686ed69aa 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2130,53 +2130,51 @@ =+ nex=$(tep t.tep) ?~(nex ~ [~ i.tep u.nex]) :: -++ earl :: local purl to tape +++ earl :: localize purl |= [who=@p pul=purl] ^- purl pul(q.q [(rsh 3 1 (scot %p who)) q.q.pul]) :: ++ earn :: purl to tape - |= pul=purl - ^- tape - =< apex - |% - ++ apex - ^- tape - :(weld head "/" body tail) + |^ |= pul=purl + ^- tape + :(weld (head p.pul) "/" (body q.pul) (tail r.pul)) :: ++ body - |- ^- tape - ?~ q.q.pul - ?~(p.q.pul ~ ['.' (trip u.p.q.pul)]) - =+ seg=(trip i.q.q.pul) - ?:(=(~ t.q.q.pul) seg (weld seg `tape`['/' $(q.q.pul t.q.q.pul)])) + |= pok=pork ^- tape + ?~ q.pok + ?~(p.pok ~ ['.' (trip u.p.pok)]) + =+ seg=(trip i.q.pok) + ?:(=(~ t.q.pok) seg (weld seg `tape`['/' $(q.pok t.q.pok)])) :: ++ head + |= har=hart ^- tape ;: weld - ?:(&(p.p.pul !=([& /localhost] r.p.pul)) "https://" "http://") + ?:(&(p.har !=([& /localhost] r.har)) "https://" "http://") :: - ?- -.r.p.pul - | (trip (rsh 3 1 (scot %if p.r.p.pul))) - & =+ rit=(flop p.r.p.pul) + ?- -.r.har + | (trip (rsh 3 1 (scot %if p.r.har))) + & =+ rit=(flop p.r.har) |- ^- tape ?~(rit ~ (weld (trip i.rit) ?~(t.rit "" `tape`['.' $(rit t.rit)]))) == :: - ?~(q.p.pul ~ `tape`[':' (trip (rsh 3 2 (scot %ui u.q.p.pul)))]) + ?~(q.har ~ `tape`[':' (trip (rsh 3 2 (scot %ui u.q.har)))]) == :: ++ tail + |= kay=quay ^- tape - ?: =(~ r.pul) ~ + ?: =(~ kay) ~ :- '?' |- ^- tape - ?~ r.pul ~ + ?~ kay ~ ;: weld - (trip p.i.r.pul) + (trip p.i.kay) "=" - (trip q.i.r.pul) - ?~(t.r.pul ~ `tape`['&' $(r.pul t.r.pul)]) + (trip q.i.kay) + ?~(t.kay ~ `tape`['&' $(kay t.kay)]) == -- :: From 9de72b30ca6c252faed1d8b9fe9ab00c7a40b70f Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 3 Nov 2014 00:28:58 -0800 Subject: [PATCH 59/63] Fixed earn not escaping query string --- arvo/zuse.hoon | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 686ed69aa..2efb7c049 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2142,10 +2142,12 @@ :: ++ body |= pok=pork ^- tape - ?~ q.pok - ?~(p.pok ~ ['.' (trip u.p.pok)]) + ?~ q.pok ~ + |- =+ seg=(trip i.q.pok) - ?:(=(~ t.q.pok) seg (weld seg `tape`['/' $(q.pok t.q.pok)])) + ?~ t.q.pok + ?~(p.pok seg (welp seg '.' (trip u.p.pok))) + (welp seg '/' $(q.pok t.q.pok)) :: ++ head |= har=hart @@ -2171,9 +2173,9 @@ |- ^- tape ?~ kay ~ ;: weld - (trip p.i.kay) + (urle (trip p.i.kay)) "=" - (trip q.i.kay) + (urle (trip q.i.kay)) ?~(t.kay ~ `tape`['&' $(kay t.kay)]) == -- From 013edce53c21260ac426dd8c33effe5f901a3822 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 3 Nov 2014 15:07:46 -0800 Subject: [PATCH 60/63] Make it boot on linux. --- arvo/hoon.hoon | 2 +- arvo/jael.hoon | 3 ++ arvo/kahn.hoon | 107 ++++++++++++++++++------------------------------- 3 files changed, 44 insertions(+), 68 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index eeb333d88..d361acfe5 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -9662,7 +9662,7 @@ a :: == :: ++ kirk (unit (set monk)) :: audience -++ khan ,[p=@tas q=path] :: foreign identity +++ khan ,[p=@tas q=@ta] :: foreign identity ++ lens :: observation core $_ ^? :: |% ++ u *(unit (unit ,~)) :: existence diff --git a/arvo/jael.hoon b/arvo/jael.hoon index 395070e1f..74c1d4c3d 100644 --- a/arvo/jael.hoon +++ b/arvo/jael.hoon @@ -16,6 +16,9 @@ :: /key :: foreign user secrets :: /service :: service name, eg %face :: /userid :: user identity +:: +:: /urb :: urbit secrets +:: /tok/hash |= pit=vase => =~ diff --git a/arvo/kahn.hoon b/arvo/kahn.hoon index 83ed3d62c..dbce360c0 100644 --- a/arvo/kahn.hoon +++ b/arvo/kahn.hoon @@ -11,79 +11,30 @@ ++ axle :: %kahn state $: %0 :: big=(unit ship) :: main ship, freeze - all=(unit axel) :: state once big - == :: -++ axel :: all social state - $: rod=(list ship) :: leadership upward - myn=(map ship girl) :: contacts - cir=(map ,@tas clan) :: contact groups - nac=(map narc ship) :: foreign to home - wyl=will :: cryptowill - == :: -++ axon :: all descendants - $: [%a p=hulk q=hulk r=hulk s=hulk t=hulk] :: zeppelin - [%b p=hulk q=hulk r=hulk s=hulk] :: blimp - [%c p=hulk q=hulk r=hulk] :: balloon - [%d p=hulk q=hulk] :: drone - [%e p=hulk] :: bird - == :: -++ clan :: ranked group - $: pec=rank :: rank conferred - who=(set ship) :: members + soc=(map monk node) :: state once big == :: +++ cert (each will ,*) :: urbit and others ++ gift :: out result <-$ - $: [%step p=ship q=girl] :: change contact + $: [%then p=node] :: propagate change == :: -++ girl :: daughter record - $: hop=pony :: status - tip=rank :: rank - fig=(set narc) :: home to foreign - gor=(set ,@tas) :: in groups - out=(unit ship) :: exported to - wyl=will :: cryptowill +++ node :: social identity + $: ven=@ud :: iteration number + tin=(map monk link) :: inbound links + oud=(map monk link) :: outbound links + cet=cert :: certificate == :: -++ hulk (map ship girl) :: social state ++ kiss :: change - $: [%lead p=(list ship)] :: set leadership - [%tact p=ship q=girl] :: set contact - [%will p=will] :: set will - == :: -++ mojo ?(%a %b %c %d %e) :: ship rank -++ trigger - $: (set ship) - (set clan) - (set rank) - (set pony) - == -++ action - $: %warm -> %cold - %cold -> %here - %cold -> %fake - %cold -> %free - * -> %dead - * -> %left - *: tip - *: add, subtract fig - *: add, subtract gor - adopt: external to free - == -++ narc path :: contact path -++ pony :: contacts status - $? %cold :: virginal - %dead :: inoperative - %fake :: virtual - %free :: exported - %here :: hosted - %left :: divorced - %warm :: reserved + $: [%that p=note] :: social update == :: +++ link (pair rank ,@da) :: graph link +++ note (qual ,@ud monk (map monk link) cert) :: ++ rank :: privilege ring - $? %0 :: enemy - %1 :: guest - %2 :: customer/vendor - %3 :: member/employee - %4 :: admin/officer - %5 :: self/god + $? %0 :: owner / admin + %1 :: guardian / employer + %2 :: partner / employee + %3 :: friend / customer + %4 :: neighbor/ contact + %5 :: zombie == :: -- :: . == @@ -115,7 +66,29 @@ ++ scry |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] ^- (unit (unit (pair mark ,*))) - ~ + ?. =(big [~ who]) ~ + =+ ^= yub ^- [(unit monk) + ?: =(%urb syd) + ?. ?=([* ~] tyl) ~ + =+ goy=(slaw %p + + ?+ ?=([%$ %da @] + ?+ lot ~ + [%$ %ud @] + %+ bind + (perm who u.hun q.p.lot [syd t.tyl]) + |=(a=* [%noun a]) + :: + ?. =(now q.p.lot) ~ + %+ bind + (temp who u.hun [syd t.tyl]) + |=(a=* [%noun a]) + == + ?. ?=([%da + =+ mok ^- (unit monk) + ?: =(%urb face) + ( + :: ++ stay :: save w/o cache `axle`+>-.$ From ab64c9493ffdda1c7c56125734814fba27e03e02 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 4 Nov 2014 10:39:56 -0800 Subject: [PATCH 61/63] All pointers now eradicated. --- arvo/kahn.hoon | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arvo/kahn.hoon b/arvo/kahn.hoon index dbce360c0..b6b2cfae3 100644 --- a/arvo/kahn.hoon +++ b/arvo/kahn.hoon @@ -13,21 +13,20 @@ big=(unit ship) :: main ship, freeze soc=(map monk node) :: state once big == :: -++ cert (each will ,*) :: urbit and others +++ cert (each will ,*) :: urbit or other ++ gift :: out result <-$ $: [%then p=node] :: propagate change == :: ++ node :: social identity - $: ven=@ud :: iteration number - tin=(map monk link) :: inbound links + $: tin=(map monk link) :: inbound links oud=(map monk link) :: outbound links cet=cert :: certificate == :: -++ kiss :: change - $: [%that p=note] :: social update +++ kiss :: social update + $: [%that p=monk q=(map monk link)] :: set links + [%this p=monk q=cert] :: set certificate == :: -++ link (pair rank ,@da) :: graph link -++ note (qual ,@ud monk (map monk link) cert) :: +++ link (pair rank ,@da) :: trust/expiration ++ rank :: privilege ring $? %0 :: owner / admin %1 :: guardian / employer From 1a290c720cb4fad62065c7b7d225c5ab9784bdb5 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 4 Nov 2014 12:20:44 -0800 Subject: [PATCH 62/63] Fix a ++ap bug. --- arvo/ford.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index dbf9e2ae8..d09377ae2 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -803,7 +803,8 @@ |= [cof=cafe vax=vase gen=twig] =+ puz=(mule |.((~(mint ut p.vax) [%noun gen]))) ?- -.puz - | (flaw cof p.puz) + | ~& [%maim-fail p.puz] + (flaw cof p.puz) & %+ (coup cof) (mock [q.vax q.p.puz] (mole ska)) |= val=* `vase`[p.p.puz val] From 6f6930e7af73d026982b6f1ad5357711b1ac0241 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 4 Nov 2014 12:32:09 -0800 Subject: [PATCH 63/63] URL parser restructure --- arvo/zuse.hoon | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 2efb7c049..933db6a90 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2181,13 +2181,12 @@ -- :: ++ epur :: url/header parser - =< |=(a=cord (rush a apex)) + =< |=(a=cord (rush a auri)) |% ++ apat :: 2396 abs_path %+ cook deft (ifix [fas ;~(pose fas (easy ~))] (more fas smeg)) - ++ apex auri - ++ auri + ++ auri :: 2396 URL %+ cook |= a=purl ?.(=([& /localhost] r.p.a) a a(p.p &)) @@ -2214,13 +2213,7 @@ ++ fque (cook crip (plus pquo)) :: normal query field ++ fquu (cook crip (star pquo)) :: optional field ++ pcar ;~(pose pure pesc psub col pat) :: 2396 path char - ++ pcok ;~ pose :: cookie char - (just `@`0x21) - (shim 0x23 0x2b) - (shim 0x2d 0x3a) - (shim 0x3c 0x5b) - (shim 0x5d 0x7e) - == + ++ pcok ;~(less bas sem com doq prn) :: cookie char ++ pesc ;~(pfix cen mes) :: 2396 escaped ++ pold (cold ' ' (just '+')) :: old space code ++ pque ;~(pose pcar fas wut) :: 3986 query char