2017-09-28 03:27:08 +03:00
|
|
|
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
:::::: :::::: Postface ::::::
|
|
|
|
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
~> %slog.[0 leaf+"%arvo-assembly"]
|
2018-02-13 06:25:46 +03:00
|
|
|
=- ~> %slog.[0 leaf+"%arvo-assembled"]
|
|
|
|
-
|
2018-12-06 23:32:42 +03:00
|
|
|
=< ::
|
|
|
|
:: Arvo formal interface
|
|
|
|
::
|
|
|
|
:: this lifecycle wrapper makes the arvo door (multi-armed core)
|
|
|
|
:: look like a gate (function or single-armed core), to fit
|
|
|
|
:: urbit's formal lifecycle function. a practical interpreter
|
|
|
|
:: can ignore it.
|
|
|
|
::
|
|
|
|
|= [now=@da ovo=*]
|
|
|
|
^- *
|
|
|
|
~> %slog.[0 leaf+"arvo-event"]
|
|
|
|
.(+> +:(poke now ovo))
|
2017-09-28 03:27:08 +03:00
|
|
|
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
:::::: :::::: volume 3, Arvo models and skeleton ::::::
|
|
|
|
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
2019-01-18 08:37:34 +03:00
|
|
|
=>
|
2017-09-28 03:27:08 +03:00
|
|
|
|%
|
|
|
|
++ arch {fil/(unit @uvI) dir/(map @ta $~)} :: fundamental node
|
|
|
|
++ arvo (wind {p/term q/mill} mill) :: arvo card
|
|
|
|
++ beam {{p/ship q/desk r/case} s/path} :: global name
|
|
|
|
++ beak {p/ship q/desk r/case} :: garnish with beak
|
|
|
|
++ bone @ud :: opaque duct
|
|
|
|
++ case :: version
|
|
|
|
$% {$da p/@da} :: date
|
|
|
|
{$tas p/@tas} :: label
|
|
|
|
{$ud p/@ud} :: sequence
|
|
|
|
== ::
|
|
|
|
++ desk @tas :: ship desk case spur
|
2019-01-02 22:09:25 +03:00
|
|
|
++ dock (pair @p term) :: message target
|
2017-09-28 03:27:08 +03:00
|
|
|
++ cage (cask vase) :: global metadata
|
|
|
|
++ cask |*(a/mold (pair mark a)) :: global data
|
2017-11-16 23:44:27 +03:00
|
|
|
++ curd {p/@tas q/*} :: typeless card
|
2017-09-28 03:27:08 +03:00
|
|
|
++ duct (list wire) :: causal history
|
2017-11-16 23:44:27 +03:00
|
|
|
++ hypo |*(a/mold (pair type a)) :: type associated
|
2017-09-28 03:27:08 +03:00
|
|
|
++ hobo |* a/mold :: kiss wrapper
|
|
|
|
$? $% {$soft p/*} ::
|
|
|
|
== ::
|
|
|
|
a ::
|
|
|
|
== ::
|
2017-11-16 23:44:27 +03:00
|
|
|
++ mark @tas :: content type
|
2017-09-28 03:27:08 +03:00
|
|
|
++ mash |=(* (mass +<)) :: producing mass
|
2019-01-18 08:37:34 +03:00
|
|
|
++ mass $~ [%$ [%& ~]] :: memory usage
|
2018-02-13 06:25:46 +03:00
|
|
|
(pair cord (each noun (list mash))) ::
|
2017-09-28 03:27:08 +03:00
|
|
|
++ mill (each vase milt) :: vase+metavase
|
|
|
|
++ milt {p/* q/*} :: metavase
|
|
|
|
++ monk (each ship {p/@tas q/@ta}) :: general identity
|
2019-02-22 02:56:46 +03:00
|
|
|
++ muse {p/@tas q/duct r/arvo s/@ud} :: sourced move
|
2017-09-28 03:27:08 +03:00
|
|
|
++ move {p/duct q/arvo} :: arvo move
|
2017-11-16 23:44:27 +03:00
|
|
|
++ ovum {p/wire q/curd} :: typeless ovum
|
2017-09-28 03:27:08 +03:00
|
|
|
++ pane (list {p/@tas q/vase}) :: kernel modules
|
|
|
|
++ pone (list {p/@tas q/vise}) :: kernel modules old
|
2018-12-03 01:05:10 +03:00
|
|
|
+$ scry-sample
|
|
|
|
[fur=(unit (set monk)) ren=@tas why=shop syd=desk lot=coin tyl=path]
|
2019-01-14 02:54:47 +03:00
|
|
|
+$ vane-sample
|
|
|
|
[our=ship now=@da eny=@uvJ ski=slyd]
|
2017-09-28 03:27:08 +03:00
|
|
|
++ ship @p :: network identity
|
|
|
|
++ sink (trel bone ship path) :: subscription
|
|
|
|
++ sley $- {* (unit (set monk)) term beam} :: namespace function
|
|
|
|
(unit (unit cage)) ::
|
|
|
|
++ slyd $- {* (unit (set monk)) term beam} :: super advanced
|
2019-08-29 01:39:04 +03:00
|
|
|
(unit (unit (cask milt))) ::
|
2017-09-28 03:27:08 +03:00
|
|
|
++ slyt $-({* *} (unit (unit))) :: old namespace
|
2018-12-01 02:07:08 +03:00
|
|
|
+$ vane [=vase =worm]
|
2017-09-28 03:27:08 +03:00
|
|
|
++ vile :: reflexive constants
|
2017-11-16 23:44:27 +03:00
|
|
|
$: typ/type :: -:!>(*type)
|
|
|
|
duc/type :: -:!>(*duct)
|
|
|
|
pah/type :: -:!>(*path)
|
|
|
|
mev/type :: -:!>([%meta *vase])
|
2017-09-28 03:27:08 +03:00
|
|
|
== ::
|
|
|
|
++ wind :: new kernel action
|
|
|
|
|* {a/mold b/mold} :: forward+reverse
|
|
|
|
$% {$pass p/path q/a} :: advance
|
|
|
|
{$slip p/a} :: lateral
|
|
|
|
{$give p/b} :: retreat
|
|
|
|
== ::
|
|
|
|
++ wire path :: event pretext
|
2018-02-01 02:36:48 +03:00
|
|
|
--
|
|
|
|
=>
|
|
|
|
~% %hex +> ~
|
|
|
|
|%
|
|
|
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
:: section 3bE, Arvo core ::
|
|
|
|
::
|
2017-09-28 03:27:08 +03:00
|
|
|
++ sloy
|
2018-12-08 01:43:07 +03:00
|
|
|
:: +sloy: adapter from old style scrys to new style scrys
|
|
|
|
::
|
|
|
|
:: This does path parsing which shows up hot, but removing the last +slay
|
|
|
|
:: here requires deeper interface changes.
|
|
|
|
::
|
2017-09-28 03:27:08 +03:00
|
|
|
!:
|
2018-12-08 01:43:07 +03:00
|
|
|
~/ %sloy
|
2017-09-28 03:27:08 +03:00
|
|
|
|= sod/slyd
|
|
|
|
^- slyt
|
|
|
|
|= {ref/* raw/*}
|
|
|
|
=+ pux=((soft path) raw)
|
|
|
|
?~ pux ~
|
|
|
|
?. ?=({@ @ @ @ *} u.pux) ~
|
2018-12-08 01:43:07 +03:00
|
|
|
=+ :* hyr=(slaw %tas i.u.pux)
|
|
|
|
fal=(slaw %p i.t.u.pux)
|
|
|
|
dyc=(slaw %tas i.t.t.u.pux)
|
2017-09-28 03:27:08 +03:00
|
|
|
ved=(slay i.t.t.t.u.pux)
|
|
|
|
tyl=t.t.t.t.u.pux
|
|
|
|
==
|
2018-12-08 01:43:07 +03:00
|
|
|
?~ hyr ~
|
|
|
|
?~ fal ~
|
|
|
|
?~ dyc ~
|
2017-09-28 03:27:08 +03:00
|
|
|
?. ?=(^ ved) ~
|
2018-12-08 01:43:07 +03:00
|
|
|
=/ ron=@tas u.hyr
|
2019-08-29 01:39:04 +03:00
|
|
|
=/ bed=beam
|
|
|
|
[[u.fal u.dyc (case p.u.ved)] (flop tyl)]
|
|
|
|
=/ bop=(unit (unit (cask milt)))
|
|
|
|
(sod ref ~ ron bed)
|
2017-09-28 03:27:08 +03:00
|
|
|
?~ bop ~
|
|
|
|
?~ u.bop [~ ~]
|
2019-08-29 01:39:04 +03:00
|
|
|
:: XX figure out wth to do about hoon-version
|
|
|
|
::
|
|
|
|
?. ?& ?=([?(%151 %141) *] ref)
|
|
|
|
-:(~(nets wa *worm) +.ref -.q.u.u.bop)
|
|
|
|
==
|
|
|
|
~>(%slog.[0 leaf+"arvo: scry-lost"] ~)
|
2017-09-28 03:27:08 +03:00
|
|
|
[~ ~ +.q.u.u.bop]
|
2018-12-11 00:22:56 +03:00
|
|
|
:: +sloy-light: minimal parsing version of sloy
|
|
|
|
::
|
|
|
|
:: There are several places inside vanes where we manually call the scry
|
|
|
|
:: function raw, instead of passing it into +mink. In those cases, we're
|
|
|
|
:: paying the price to render the arguments as text, and then are
|
|
|
|
:: immediately parsing the passed in data. We can avoid that.
|
|
|
|
::
|
|
|
|
:: TODO: The entire scrying system needs to be cleaned up in a more
|
|
|
|
:: permanent way. This hack fixes up some print/parse costs, but doesn't
|
|
|
|
:: recover the print/parse costs of the scry itself, which we could prevent
|
|
|
|
:: if we didn't send (list @ta), but instead sent (list dime).
|
|
|
|
::
|
|
|
|
++ sloy-light
|
|
|
|
~/ %sloy-light
|
|
|
|
|= sod/slyd
|
|
|
|
|= [ref=* ron=@tas fal=@p dyc=@tas ved=case tyl=path]
|
2018-12-11 02:40:47 +03:00
|
|
|
:: we do not flop tyl because tyl wouldn't have been flopped by +en-beam
|
|
|
|
::
|
2019-08-29 01:39:04 +03:00
|
|
|
=/ bed=beam
|
|
|
|
[[fal dyc ved] tyl]
|
|
|
|
=/ bop=(unit (unit (cask milt)))
|
|
|
|
(sod ref ~ ron bed)
|
2017-09-28 03:27:08 +03:00
|
|
|
?~ bop ~
|
|
|
|
?~ u.bop [~ ~]
|
2019-08-29 01:39:04 +03:00
|
|
|
:: XX figure out wth to do about hoon-version
|
|
|
|
::
|
|
|
|
?. ?& ?=([?(%151 %141) *] ref)
|
|
|
|
-:(~(nets wa *worm) +.ref -.q.u.u.bop)
|
|
|
|
==
|
|
|
|
~>(%slog.[0 leaf+"arvo: scry-dark"] ~)
|
2017-09-28 03:27:08 +03:00
|
|
|
[~ ~ +.q.u.u.bop]
|
|
|
|
::
|
2018-11-28 07:07:54 +03:00
|
|
|
++ symp :: symbol or empty
|
|
|
|
|= a=* ^- @tas
|
|
|
|
?.(&(?=(@ a) ((sane %tas) a)) %$ a)
|
|
|
|
::
|
2017-09-28 03:27:08 +03:00
|
|
|
++ vent :: vane core
|
2018-12-06 00:41:21 +03:00
|
|
|
|= [who=ship lal=@tas vil=vile bud=vase =vane]
|
2017-09-28 03:27:08 +03:00
|
|
|
~% %vent +>+ ~
|
|
|
|
|%
|
|
|
|
++ ruck :: update vase
|
|
|
|
|= {pax/path txt/@ta}
|
|
|
|
^+ +>
|
2018-03-19 06:54:47 +03:00
|
|
|
=- ?:(?=(%| -.res) ((slog p.res) +>.$) p.res)
|
2017-09-28 03:27:08 +03:00
|
|
|
^= res %- mule |.
|
2019-01-14 02:54:47 +03:00
|
|
|
:: XX should use real entropy and the real date
|
|
|
|
::
|
|
|
|
=/ arg=vane-sample
|
|
|
|
[who ~2000.1.1 *@uvJ =>(~ |~(* ~))]
|
2018-12-01 02:07:08 +03:00
|
|
|
=+ rig=(slym vase.vane arg)
|
2018-02-14 08:36:25 +03:00
|
|
|
=+ gen=(rain pax txt)
|
|
|
|
=+ rev=(slym (slap bud gen) bud)
|
2017-09-28 03:27:08 +03:00
|
|
|
=+ syg=(slym rev arg)
|
2018-12-03 01:05:10 +03:00
|
|
|
:: update the vane itself
|
|
|
|
::
|
2019-02-09 02:03:46 +03:00
|
|
|
:: We don't cache the n+slap/+slam types because they're only used once
|
2018-12-03 01:05:10 +03:00
|
|
|
:: right here; they'll never be used again.
|
|
|
|
::
|
|
|
|
=. vase.vane
|
|
|
|
~| %load-lost
|
|
|
|
(slam (slap syg [%limb %load]) (slap rig [%limb %stay]))
|
|
|
|
:: prime the new compiler cache
|
|
|
|
::
|
|
|
|
prime
|
|
|
|
:: reset and prime the worm cache for scrys
|
|
|
|
::
|
|
|
|
:: If the +slap/+slym in scry isn't cached, we spend the majority of
|
|
|
|
:: the time in a scry in the compiler. The +scry gate cannot have side
|
|
|
|
:: effects so we can't modify the cache at access time. So we seed the
|
|
|
|
:: cache with all the things +scry will need when we install the vane
|
|
|
|
::
|
|
|
|
++ prime
|
|
|
|
^+ ..prime
|
|
|
|
::
|
|
|
|
%_ ..prime
|
|
|
|
worm.vane
|
|
|
|
:: reset cache and add in vane activation entry
|
|
|
|
::
|
|
|
|
=^ rig worm.vane
|
2019-01-14 02:54:47 +03:00
|
|
|
(~(slym wa *worm) vase.vane *vane-sample)
|
2018-12-03 01:05:10 +03:00
|
|
|
:: cache the access of the %scry arm
|
|
|
|
::
|
2019-01-18 02:31:41 +03:00
|
|
|
+:(~(slap wa worm.vane) rig [%limb %scry])
|
2018-12-03 01:05:10 +03:00
|
|
|
==
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ wink :: deploy
|
|
|
|
|= {now/@da eny/@ ski/slyd}
|
2018-12-06 00:26:20 +03:00
|
|
|
=^ rig worm.vane
|
|
|
|
~| [%failed-vane-activation-for lal]
|
2019-01-14 02:54:47 +03:00
|
|
|
(~(slym wa worm.vane) vase.vane `vane-sample`[who +<]) :: activate vane
|
2017-09-28 03:27:08 +03:00
|
|
|
~% %wink +>+> ~
|
|
|
|
|%
|
|
|
|
++ slid
|
|
|
|
|= {hed/mill tal/mill}
|
|
|
|
^- mill
|
2018-03-19 06:54:47 +03:00
|
|
|
?: &(?=(%& -.hed) ?=(%& -.tal))
|
2017-09-28 03:27:08 +03:00
|
|
|
[%& (slop p.hed p.tal)]
|
|
|
|
[%| [%cell p.p.hed p.p.tal] [q.p.hed q.p.tal]]
|
|
|
|
::
|
|
|
|
++ slix
|
|
|
|
|= hil/mill
|
|
|
|
^- mill
|
|
|
|
?- -.hil
|
2018-03-19 06:54:47 +03:00
|
|
|
%& [%& (slop [typ.vil p.p.hil] p.hil)]
|
|
|
|
%| [%| [%cell typ.vil p.p.hil] p.hil]
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ slur :: call gate on
|
|
|
|
|= {gat/vase hil/mill}
|
|
|
|
^- (unit (pair vase worm))
|
2018-12-06 00:26:20 +03:00
|
|
|
=^ sam worm.vane
|
|
|
|
~| [%failed-slot-in lal]
|
|
|
|
(~(slot wa worm.vane) 6 gat)
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ hig worm.vane
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-nest-in lal]
|
2017-09-28 03:27:08 +03:00
|
|
|
?- -.hil
|
2018-12-01 02:07:08 +03:00
|
|
|
%& (~(nest wa worm.vane) p.sam p.p.hil)
|
|
|
|
%| (~(nets wa worm.vane) p.sam p.p.hil)
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
2018-11-26 22:31:34 +03:00
|
|
|
?. hig
|
|
|
|
~
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-slym-in lal]
|
2018-12-01 02:07:08 +03:00
|
|
|
`(~(slym wa worm.vane) gat +>.hil)
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ slur-a ~/(%slur-a |=({gat/vase hil/mill} =+(%a (slur gat hil))))
|
|
|
|
++ slur-b ~/(%slur-b |=({gat/vase hil/mill} =+(%b (slur gat hil))))
|
|
|
|
++ slur-c ~/(%slur-c |=({gat/vase hil/mill} =+(%c (slur gat hil))))
|
|
|
|
++ slur-d ~/(%slur-d |=({gat/vase hil/mill} =+(%d (slur gat hil))))
|
|
|
|
++ slur-e ~/(%slur-e |=({gat/vase hil/mill} =+(%e (slur gat hil))))
|
|
|
|
++ slur-f ~/(%slur-f |=({gat/vase hil/mill} =+(%f (slur gat hil))))
|
|
|
|
++ slur-g ~/(%slur-g |=({gat/vase hil/mill} =+(%g (slur gat hil))))
|
2018-05-10 02:43:43 +03:00
|
|
|
++ slur-j ~/(%slur-j |=({gat/vase hil/mill} =+(%j (slur gat hil))))
|
2017-09-28 03:27:08 +03:00
|
|
|
++ slur-z ~/(%slur-z |=({gat/vase hil/mill} =+(%z (slur gat hil))))
|
2019-02-11 22:44:56 +03:00
|
|
|
++ slur-r
|
|
|
|
~/ %slur-r
|
|
|
|
|=({gat/vase hil/mill} =+(%r (slur gat hil)))
|
|
|
|
++ slur-l
|
|
|
|
~/ %slur-l
|
|
|
|
|=({gat/vase hil/mill} =+(%l (slur gat hil)))
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ slur-pro :: profiling slur
|
|
|
|
~/ %slur-pro
|
|
|
|
|= {lal/@tas gat/vase hil/mill}
|
|
|
|
?+ lal (slur-z gat hil)
|
|
|
|
$a (slur-a gat hil)
|
|
|
|
$b (slur-b gat hil)
|
|
|
|
$c (slur-c gat hil)
|
|
|
|
$d (slur-d gat hil)
|
|
|
|
$e (slur-e gat hil)
|
|
|
|
$f (slur-f gat hil)
|
|
|
|
$g (slur-g gat hil)
|
2018-05-10 02:43:43 +03:00
|
|
|
$j (slur-j gat hil)
|
2019-02-09 02:03:46 +03:00
|
|
|
::
|
2019-02-11 22:44:56 +03:00
|
|
|
%l (slur-l gat hil)
|
|
|
|
%r (slur-r gat hil)
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ song :: reduce metacard
|
|
|
|
~/ %song ::
|
|
|
|
|= mex/vase :: mex: vase of card
|
|
|
|
^- (unit (pair mill worm)) ::
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ hip worm.vane (~(nell wa worm.vane) p.mex) ::
|
2017-09-28 03:27:08 +03:00
|
|
|
?. hip ~ :: a card is a cell
|
2018-12-01 02:07:08 +03:00
|
|
|
?. ?=($meta -.q.mex) `[[%& mex] worm.vane] :: ordinary card
|
|
|
|
=^ tiv worm.vane (~(slot wa worm.vane) 3 mex) ::
|
|
|
|
=^ hip worm.vane (~(nell wa worm.vane) p.tiv) ::
|
2017-09-28 03:27:08 +03:00
|
|
|
?. hip ~ :: a vase is a cell
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ vax worm.vane (~(slot wa worm.vane) 2 tiv) ::
|
|
|
|
=^ hip worm.vane (~(nest wa worm.vane) typ.vil p.vax) ::
|
2017-11-16 23:44:27 +03:00
|
|
|
?. hip ~ :: vase head is type
|
2017-09-28 03:27:08 +03:00
|
|
|
%+ biff ::
|
2017-11-16 23:44:27 +03:00
|
|
|
=+ mut=(milt q.tiv) :: card type, value
|
2017-09-28 03:27:08 +03:00
|
|
|
|- ^- (unit (pair milt worm)) ::
|
2018-12-01 02:07:08 +03:00
|
|
|
?. ?=({$meta p/* q/milt} q.mut) `[mut worm.vane] :: ordinary metacard
|
|
|
|
=^ hip worm.vane (~(nets wa worm.vane) mev.vil p.mut)::
|
2017-09-28 03:27:08 +03:00
|
|
|
?. hip ~ :: meta-metacard
|
|
|
|
$(mut +.q.mut) :: descend into meta
|
|
|
|
|=(a/(pair milt worm) `[[%| p.a] q.a]) :: milt to mill
|
|
|
|
::
|
|
|
|
++ sump :: vase to move
|
|
|
|
~/ %sump
|
|
|
|
|= wec/vase
|
|
|
|
^- (unit (pair move worm))
|
|
|
|
%+ biff ((soft duct) -.q.wec)
|
|
|
|
|= a/duct
|
2019-01-18 08:37:34 +03:00
|
|
|
%+ bind
|
2017-09-28 03:27:08 +03:00
|
|
|
=- ?- -.har
|
2018-03-19 06:54:47 +03:00
|
|
|
%| ~& [%dead-card p.har] ~ :: XX properly log?
|
|
|
|
%& (some p.har)
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
|
|
|
^= har ^- (each (pair arvo worm) term)
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ caq worm.vane (~(spot wa worm.vane) 3 wec)
|
2018-11-28 07:07:54 +03:00
|
|
|
?+ q.caq [%| (cat 3 %funk (symp q.caq))]
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
{$pass p/* q/@tas r/{p/@tas q/*}}
|
|
|
|
%- (bond |.([%| p.r.q.caq]))
|
|
|
|
%+ biff ((soft @) q.q.caq)
|
|
|
|
|= lal/@tas
|
|
|
|
?. ((sane %tas) lal) ~
|
|
|
|
%+ biff ((soft path) p.q.caq)
|
|
|
|
|= pax/path
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ yav worm.vane (~(spot wa worm.vane) 15 caq)
|
2017-09-28 03:27:08 +03:00
|
|
|
%+ bind (song yav)
|
|
|
|
|= {hil/mill vel/worm}
|
|
|
|
[%& [%pass pax lal hil] vel]
|
|
|
|
::
|
|
|
|
{$give p/{p/@tas q/*}}
|
|
|
|
%- (bond |.([%| p.p.q.caq]))
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ yav worm.vane (~(spot wa worm.vane) 3 caq)
|
2017-09-28 03:27:08 +03:00
|
|
|
%+ bind (song yav)
|
|
|
|
|= {hil/mill vel/worm}
|
|
|
|
[%& [%give hil] vel]
|
|
|
|
::
|
|
|
|
{$slip p/@tas q/{p/@tas q/*}}
|
|
|
|
%- (bond |.([%| p.q.q.caq]))
|
|
|
|
%+ biff ((soft @) p.q.caq)
|
|
|
|
|= lal/@tas
|
|
|
|
?. ((sane %tas) lal) ~
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ yav worm.vane (~(spot wa worm.vane) 7 caq)
|
2017-09-28 03:27:08 +03:00
|
|
|
%+ bind (song yav)
|
|
|
|
|= {hil/mill vel/worm}
|
|
|
|
[%& [%slip lal hil] vel]
|
|
|
|
==
|
|
|
|
|=(b/(pair arvo worm) [`move`[a p.b] q.b])
|
|
|
|
::
|
|
|
|
++ said :: vase to (list move)
|
|
|
|
|= vud/vase
|
|
|
|
|- ^- (pair (list move) worm)
|
2018-12-01 02:07:08 +03:00
|
|
|
?: =(~ q.vud) [~ worm.vane]
|
|
|
|
=^ hed worm.vane (~(slot wa worm.vane) 2 vud)
|
|
|
|
=^ tal worm.vane (~(slot wa worm.vane) 3 vud)
|
|
|
|
=^ mov worm.vane (need (sump hed))
|
|
|
|
=^ moz worm.vane $(vud tal)
|
|
|
|
[[mov moz] worm.vane]
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ scry :: read namespace
|
|
|
|
~/ %scry
|
|
|
|
|= $: fur/(unit (set monk))
|
|
|
|
ren/@t
|
|
|
|
bed/beam
|
|
|
|
==
|
2019-08-29 01:39:04 +03:00
|
|
|
^- (unit (unit (cask milt)))
|
2017-09-28 03:27:08 +03:00
|
|
|
:: ~& [%arvo-scry ren bed]
|
2018-12-03 01:05:10 +03:00
|
|
|
=/ old=scry-sample
|
|
|
|
:* fur
|
|
|
|
ren
|
|
|
|
[%& p.bed]
|
|
|
|
q.bed
|
|
|
|
`coin`[%$ r.bed]
|
|
|
|
(flop s.bed)
|
|
|
|
==
|
2019-08-29 01:39:04 +03:00
|
|
|
^- (unit (unit (cask milt)))
|
2018-12-03 01:05:10 +03:00
|
|
|
=+ fun=-:(~(slap wa worm.vane) rig [%limb %scry])
|
2019-01-18 02:31:41 +03:00
|
|
|
::
|
2019-08-29 01:39:04 +03:00
|
|
|
%- (unit (unit (cask milt)))
|
2019-01-18 02:31:41 +03:00
|
|
|
(slum q.fun old)
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ soar :: scrub vane
|
|
|
|
|= sev/vase
|
|
|
|
^- vase
|
2018-12-01 02:07:08 +03:00
|
|
|
?: &(=(-.q.vase.vane -.q.sev) =(+>.q.vase.vane +>.q.sev))
|
|
|
|
vase.vane :: unchanged, use old
|
2019-01-14 02:54:47 +03:00
|
|
|
=| sam=vane-sample
|
|
|
|
sev(+<.q sam(ski =>(~ |~(* ~)))) :: clear to stop leak
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ swim
|
|
|
|
~/ %swim
|
|
|
|
|= $: org/@tas
|
|
|
|
pux/(unit wire)
|
|
|
|
hen/duct
|
|
|
|
hil/mill
|
|
|
|
==
|
2018-12-01 02:07:08 +03:00
|
|
|
^- [(list move) _vane]
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-swim lal org pux]
|
2018-12-01 02:07:08 +03:00
|
|
|
:: ~& [%swim-wyt `@ud`~(wyt in worm.vane)]
|
2017-09-28 03:27:08 +03:00
|
|
|
=+ ^= pru
|
|
|
|
?~ pux
|
2018-12-18 04:12:38 +03:00
|
|
|
~| [%swim-call-vane lal (symp ?@(+.p.hil +.p.hil +<.p.hil))]
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ vax worm.vane (~(slap wa worm.vane) rig [%limb %call])
|
2017-09-28 03:27:08 +03:00
|
|
|
%^ slur-pro lal vax
|
|
|
|
(slid [%& duc.vil hen] (slix hil))
|
2018-12-18 04:12:38 +03:00
|
|
|
~| [%swim-take-vane lal (symp ?@(+.p.hil +.p.hil +<.p.hil))]
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ vax worm.vane (~(slap wa worm.vane) rig [%limb %take])
|
2017-09-28 03:27:08 +03:00
|
|
|
%^ slur-pro lal vax
|
|
|
|
;: slid
|
|
|
|
[%& pah.vil u.pux]
|
|
|
|
[%& duc.vil hen]
|
|
|
|
(slix (slid [%& [%atom %tas `org] org] hil))
|
|
|
|
==
|
|
|
|
?~ pru
|
2018-11-28 07:07:54 +03:00
|
|
|
~& [%swim-lost lal (symp +>-.hil)]
|
2018-12-01 02:07:08 +03:00
|
|
|
[~ [vase.vane worm.vane]]
|
|
|
|
=^ pro worm.vane (need pru)
|
2018-12-01 22:31:54 +03:00
|
|
|
=^ moz worm.vane (~(slot wa worm.vane) 2 pro)
|
|
|
|
=^ vem worm.vane (~(slot wa worm.vane) 3 pro)
|
2018-12-01 02:07:08 +03:00
|
|
|
=^ sad worm.vane (said moz)
|
|
|
|
[sad [(soar vem) worm.vane]]
|
2017-09-28 03:27:08 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ vint :: create vane
|
2018-12-06 00:41:21 +03:00
|
|
|
|= $: who=ship
|
|
|
|
lal=@tas
|
|
|
|
vil=vile
|
|
|
|
bud=vase
|
|
|
|
pax=path
|
|
|
|
txt=@ta
|
|
|
|
==
|
2018-03-19 06:54:47 +03:00
|
|
|
=- ?:(?=(%| -.res) ((slog p.res) ~) (some p.res))
|
2017-09-28 03:27:08 +03:00
|
|
|
^= res %- mule |.
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-vint lal]
|
2018-02-14 08:36:25 +03:00
|
|
|
=+ gen=(rain pax txt)
|
2018-02-27 08:18:47 +03:00
|
|
|
~& [%vane-parsed `@p`(mug gen)]
|
2018-12-06 00:41:21 +03:00
|
|
|
=+ pro=(vent who lal vil bud [(slym (slap bud gen) bud) *worm])
|
2018-02-27 08:18:47 +03:00
|
|
|
~& [%vane-compiled `@p`(mug pro)]
|
2018-12-03 01:05:10 +03:00
|
|
|
prime:pro
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ viol :: vane tools
|
2017-11-16 23:44:27 +03:00
|
|
|
|= but/type
|
2017-09-28 03:27:08 +03:00
|
|
|
^- vile
|
2017-11-16 23:44:27 +03:00
|
|
|
=+ pal=|=(a/@t ^-(type (~(play ut but) (vice a))))
|
2018-02-13 06:25:46 +03:00
|
|
|
:* typ=(pal '$:type')
|
|
|
|
duc=(pal '$:duct')
|
|
|
|
pah=(pal '$:path')
|
|
|
|
mev=(pal '$:{$meta $vase}')
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ is :: operate in time
|
2018-12-06 00:41:21 +03:00
|
|
|
|= [who=ship vil=vile eny=@ bud=vase vanes=(list [label=@tas =vane])]
|
2017-09-28 03:27:08 +03:00
|
|
|
|_ now/@da
|
|
|
|
++ beck
|
|
|
|
^- slyd
|
2019-08-29 01:39:04 +03:00
|
|
|
|= {typ/* fur/(unit (set monk)) ron/term bed/beam}
|
|
|
|
^- (unit (unit (cask milt)))
|
2017-09-28 03:27:08 +03:00
|
|
|
=> .(fur ?^(fur fur `[[%& p.bed] ~ ~])) :: XX heinous
|
|
|
|
=+ lal=(end 3 1 ron)
|
2017-10-20 03:47:24 +03:00
|
|
|
=+ ren=(@t (rsh 3 1 ron))
|
2019-08-29 01:39:04 +03:00
|
|
|
|- ^- (unit (unit (cask milt)))
|
2018-12-01 02:58:56 +03:00
|
|
|
?~ vanes ~
|
|
|
|
?. =(lal label.i.vanes) $(vanes t.vanes)
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-scry ron bed]
|
2018-12-07 03:51:52 +03:00
|
|
|
%- scry:(wink:(vent who lal vil bud vane.i.vanes) now eny ..^$)
|
2017-09-28 03:27:08 +03:00
|
|
|
[fur ren bed]
|
|
|
|
::
|
|
|
|
++ dink :: vase by char
|
|
|
|
|= din/@tas ^- vase
|
2018-12-01 02:58:56 +03:00
|
|
|
?~(vanes !! ?:(=(din label.i.vanes) vase.vane.i.vanes $(vanes t.vanes)))
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ dint :: input routing
|
|
|
|
|= hap/path ^- @tas
|
2019-07-27 06:43:07 +03:00
|
|
|
?+ hap ~|([%bad-dint hap] !!)
|
2017-09-28 03:27:08 +03:00
|
|
|
{@ $ames *} %a
|
|
|
|
{@ $boat *} %c
|
|
|
|
{@ $newt *} %a
|
|
|
|
{@ $sync *} %c
|
|
|
|
{@ $term *} %d
|
2019-07-04 03:08:23 +03:00
|
|
|
{@ $http-client *} %i
|
2019-07-04 02:01:45 +03:00
|
|
|
{@ $http-server *} %e
|
2017-09-28 03:27:08 +03:00
|
|
|
{@ $behn *} %b
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ hurl :: start loop
|
|
|
|
|= {lac/? ovo/ovum}
|
2019-02-23 02:52:18 +03:00
|
|
|
~? &(!lac !=(%belt -.q.ovo)) ["" %unix -.q.ovo p.ovo now]
|
2018-12-01 02:58:56 +03:00
|
|
|
:: ^- {p/(list ovum) q/(pair worm (list {p/@tas q/vase}))}
|
|
|
|
^- {p/(list ovum) q=(list [label=@tas =vane])}
|
2017-09-28 03:27:08 +03:00
|
|
|
?> ?=(^ p.ovo)
|
|
|
|
%+ kick lac
|
|
|
|
:~ :* i.p.ovo
|
|
|
|
~
|
|
|
|
:^ %pass t.p.ovo
|
|
|
|
(dint p.ovo)
|
|
|
|
:+ %&
|
|
|
|
[%cell [%atom %tas `%soft] %noun]
|
|
|
|
[%soft q.ovo]
|
2019-02-22 02:56:46 +03:00
|
|
|
0
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ race :: take
|
2018-12-01 02:58:56 +03:00
|
|
|
|= {org/@tas lal/@tas pux/(unit wire) hen/duct hil/mill =vane}
|
|
|
|
^- [p=(list move) q=_vane]
|
2018-12-06 00:41:21 +03:00
|
|
|
=+ ven=(vent who lal vil bud vane)
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-take lal]
|
2018-12-07 03:51:52 +03:00
|
|
|
=+ win=(wink:ven now eny beck)
|
2017-09-28 03:27:08 +03:00
|
|
|
(swim:win org pux hen hil)
|
|
|
|
::
|
|
|
|
++ fire :: execute
|
2019-02-22 02:56:46 +03:00
|
|
|
|= {org/term deh/@ud lal/term pux/(unit wire) hen/duct hil/mill}
|
2018-12-01 02:58:56 +03:00
|
|
|
^- {{p/(list ovum) q/(list muse)} _vanes}
|
2017-09-28 03:27:08 +03:00
|
|
|
?: &(?=(^ pux) ?=($~ hen))
|
2018-12-01 02:58:56 +03:00
|
|
|
[[[[lal u.pux] (curd +>.hil)]~ ~] vanes]
|
|
|
|
=+ naf=vanes
|
|
|
|
|- ^- {{p/(list ovum) q/(list muse)} _vanes}
|
|
|
|
?~ naf [[~ ~] ~]
|
|
|
|
?. =(lal label.i.naf)
|
2019-02-09 02:03:46 +03:00
|
|
|
~| [%lal lal label.i.naf]
|
2017-09-28 03:27:08 +03:00
|
|
|
=+ tuh=$(naf t.naf)
|
|
|
|
[-.tuh [+<.tuh [i.naf +>.tuh]]]
|
2018-12-01 02:07:08 +03:00
|
|
|
::
|
2018-12-01 02:58:56 +03:00
|
|
|
=+ fiq=(race org lal pux hen hil vane.i.naf)
|
2019-02-22 02:56:46 +03:00
|
|
|
:- [~ (turn p.fiq |=(a/move [lal p.a q.a +(deh)]))]
|
|
|
|
[[label.i.naf q.fiq] t.naf]
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ jack :: dispatch card
|
|
|
|
|= {lac/? gum/muse}
|
2018-12-01 02:58:56 +03:00
|
|
|
^- {{p/(list ovum) q/(list muse)} _vanes}
|
2018-12-06 00:36:29 +03:00
|
|
|
~| %failed-jack
|
2017-09-28 03:27:08 +03:00
|
|
|
:: =. lac |(lac ?=(?(%g %f) p.gum))
|
|
|
|
:: =. lac &(lac !?=($b p.gum))
|
2019-02-22 02:56:46 +03:00
|
|
|
%^ fire
|
|
|
|
p.gum
|
|
|
|
s.gum
|
2017-09-28 03:27:08 +03:00
|
|
|
?- -.r.gum
|
|
|
|
$pass
|
|
|
|
~? &(!lac !=(%$ p.gum))
|
2019-02-22 02:56:46 +03:00
|
|
|
:- (runt [s.gum '|'] "")
|
2017-09-28 03:27:08 +03:00
|
|
|
:^ %pass [p.gum p.q.r.gum]
|
2018-11-28 07:07:54 +03:00
|
|
|
[(symp +>-.q.q.r.gum) p.r.gum]
|
2017-09-28 03:27:08 +03:00
|
|
|
q.gum
|
|
|
|
[p.q.r.gum ~ [[p.gum p.r.gum] q.gum] q.q.r.gum]
|
|
|
|
::
|
|
|
|
$give
|
2018-11-28 07:07:54 +03:00
|
|
|
?. &(?=(^ q.gum) ?=(^ i.q.gum))
|
2018-11-24 01:17:08 +03:00
|
|
|
~| [%jack-bad-duct q.gum]
|
2018-11-28 07:07:54 +03:00
|
|
|
~| [%jack-bad-card p.gum (symp +>-.p.r.gum)]
|
2017-09-28 03:27:08 +03:00
|
|
|
!!
|
|
|
|
~? &(!lac |(!=(%blit +>-.p.r.gum) !=(%d p.gum)))
|
2019-02-22 02:56:46 +03:00
|
|
|
:- (runt [s.gum '|'] "")
|
2018-11-28 07:07:54 +03:00
|
|
|
[%give p.gum (symp +>-.p.r.gum) `duct`q.gum]
|
2017-09-28 03:27:08 +03:00
|
|
|
[i.i.q.gum [~ t.i.q.gum] t.q.gum p.r.gum]
|
|
|
|
::
|
|
|
|
$slip
|
2019-02-22 02:56:46 +03:00
|
|
|
~? !lac
|
|
|
|
:- (runt [s.gum '|'] "")
|
|
|
|
[%slip p.gum (symp +>-.q.p.r.gum) q.gum]
|
2017-09-28 03:27:08 +03:00
|
|
|
[p.p.r.gum ~ q.gum q.p.r.gum]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ kick :: new main loop
|
|
|
|
|= {lac/? mor/(list muse)}
|
|
|
|
=| ova/(list ovum)
|
2018-12-01 02:58:56 +03:00
|
|
|
|- ^- {p/(list ovum) q=(list [label=@tas =vane])}
|
2018-12-18 04:01:23 +03:00
|
|
|
?~ mor
|
|
|
|
[ova vanes]
|
2018-12-01 02:58:56 +03:00
|
|
|
=^ nyx vanes (jack lac i.mor)
|
2018-12-20 03:05:27 +03:00
|
|
|
:: we emit ova to unix in fifo order, but emit internal moves depth-first
|
|
|
|
::
|
2018-12-20 02:39:35 +03:00
|
|
|
$(ova (weld ova p.nyx), mor (weld q.nyx t.mor))
|
2019-02-01 10:52:48 +03:00
|
|
|
:: +spam: kick every vane with :ovum
|
2019-02-01 10:37:00 +03:00
|
|
|
::
|
2019-02-01 10:52:48 +03:00
|
|
|
++ spam
|
2019-02-01 10:37:00 +03:00
|
|
|
|= [lac=? ovo=ovum]
|
|
|
|
^- [(list ovum) (list [label=@tas =vane])]
|
|
|
|
=/ card
|
|
|
|
:+ %&
|
|
|
|
[%cell [%atom %tas `%soft] %noun]
|
|
|
|
[%soft q.ovo]
|
|
|
|
%+ kick lac
|
|
|
|
%+ turn vanes
|
2019-02-22 02:56:46 +03:00
|
|
|
|=([label=@tas *] [label ~ [%pass p.ovo label card] 0])
|
2017-09-28 03:27:08 +03:00
|
|
|
--
|
|
|
|
--
|
2018-12-06 04:58:41 +03:00
|
|
|
=< :: Arvo larval stage
|
|
|
|
::
|
|
|
|
:: The true Arvo kernel knows who it is. It should not *maybe*
|
|
|
|
:: have an identity, nor should it contain multitudes. This outer
|
|
|
|
:: kernel exists to accumulate identity, entropy, and the
|
|
|
|
:: standard library. Upon having done so, it upgrades itself into
|
|
|
|
:: the true Arvo kernel. Subsequent upgrades will fall through
|
|
|
|
:: the larval stage directly into the actual kernel.
|
|
|
|
::
|
|
|
|
:: For convenience, this larval stage also supports hoon compilation
|
|
|
|
:: with +wish and vane installation with the %veer event.
|
|
|
|
::
|
2018-12-06 09:10:24 +03:00
|
|
|
=/ pit=vase !>(..is)
|
|
|
|
=| $: :: who: our identity once we know it
|
|
|
|
:: eny: entropy once we learn it
|
|
|
|
:: bod: %zuse once we receive it
|
|
|
|
::
|
|
|
|
who=(unit ship)
|
2018-12-06 04:58:41 +03:00
|
|
|
eny=(unit @)
|
2018-12-06 09:10:24 +03:00
|
|
|
bod=(unit vase)
|
2018-12-06 04:58:41 +03:00
|
|
|
==
|
|
|
|
:: larval Arvo structural interface
|
|
|
|
::
|
|
|
|
|%
|
2019-01-07 23:36:06 +03:00
|
|
|
++ come ^come :: 4
|
|
|
|
++ load ^load :: 10
|
|
|
|
++ peek |=(* ~) :: 46
|
2018-12-06 04:58:41 +03:00
|
|
|
::
|
2019-01-07 23:36:06 +03:00
|
|
|
++ poke |= * :: 47
|
2018-12-06 04:58:41 +03:00
|
|
|
^- [(list ovum) *]
|
2019-05-09 22:46:19 +03:00
|
|
|
=> .(+< ;;([now=@da ovo=ovum] +<))
|
2018-12-06 04:58:41 +03:00
|
|
|
^- [(list ovum) *]
|
|
|
|
=. +>.$
|
|
|
|
?+ -.q.ovo
|
|
|
|
:: ignore unrecognized
|
|
|
|
::
|
|
|
|
~& [%larval-ignore p.ovo -.q.ovo]
|
|
|
|
+>.$
|
|
|
|
:: install %zuse or vane
|
|
|
|
::
|
|
|
|
%veer
|
|
|
|
^+ +>.$
|
2018-12-06 09:10:24 +03:00
|
|
|
:: use the maximum comet if we don't know who we are yet
|
|
|
|
::
|
2018-12-07 01:30:57 +03:00
|
|
|
=/ our
|
|
|
|
?^ who
|
|
|
|
u.who
|
|
|
|
=/ fip=ship (dec (bex 128))
|
|
|
|
~>(%slog.[0 leaf+"arvo: larval identity {(scow %p fip)}"] fip)
|
2018-12-06 09:10:24 +03:00
|
|
|
=. ..veer (veer our now q.ovo)
|
|
|
|
+>.$(bod ?^(bod bod `bud.^poke))
|
2018-12-06 04:58:41 +03:00
|
|
|
:: add entropy
|
|
|
|
::
|
|
|
|
%wack
|
|
|
|
^+ +>.$
|
|
|
|
?> ?=(@ q.q.ovo)
|
|
|
|
+>.$(eny `q.q.ovo)
|
|
|
|
:: become who you were born to be
|
|
|
|
::
|
|
|
|
%whom
|
|
|
|
^+ +>.$
|
|
|
|
?> ?=(@ q.q.ovo)
|
|
|
|
+>.$(who `q.q.ovo)
|
|
|
|
==
|
2018-12-06 09:10:24 +03:00
|
|
|
:: upgrade once we've accumulated identity, entropy, and %zuse
|
2018-12-06 04:58:41 +03:00
|
|
|
::
|
2018-12-06 09:10:24 +03:00
|
|
|
?. &(?=(^ who) ?=(^ eny) ?=(^ bod))
|
2018-12-06 04:58:41 +03:00
|
|
|
[~ +>.$]
|
|
|
|
~> %slog.[0 leaf+"arvo: metamorphosis"]
|
|
|
|
=/ nyf
|
2018-12-06 09:10:24 +03:00
|
|
|
(turn vanes.^poke |=([label=@tas =vane] [label vase.vane]))
|
|
|
|
(load u.who now u.eny ova=~ u.bod nyf)
|
2018-12-06 04:58:41 +03:00
|
|
|
::
|
2019-01-07 23:36:06 +03:00
|
|
|
++ wish |= txt=* :: 22
|
2018-12-06 09:10:24 +03:00
|
|
|
?> ?=(@ txt)
|
|
|
|
q:(slap ?~(bod pit u.bod) (ream txt))
|
2018-12-06 04:58:41 +03:00
|
|
|
--
|
|
|
|
::
|
2018-12-06 02:25:12 +03:00
|
|
|
:: persistent arvo state
|
|
|
|
::
|
2018-12-06 09:10:24 +03:00
|
|
|
=/ pit=vase !>(..is) ::
|
2018-12-05 19:42:20 +03:00
|
|
|
=/ vil=vile (viol p.pit) :: cached reflexives
|
2019-03-08 08:27:07 +03:00
|
|
|
=| $: lac=_& :: laconic bit
|
2018-12-05 19:42:20 +03:00
|
|
|
eny=@ :: entropy
|
2018-12-06 04:58:41 +03:00
|
|
|
our=ship :: identity
|
2018-12-06 09:10:24 +03:00
|
|
|
bud=vase :: %zuse
|
2018-12-01 02:58:56 +03:00
|
|
|
vanes=(list [label=@tas =vane]) :: modules
|
2017-09-28 03:27:08 +03:00
|
|
|
== ::
|
2018-12-06 02:25:12 +03:00
|
|
|
=< :: Arvo structural interface
|
|
|
|
::
|
|
|
|
|%
|
2019-05-09 22:46:19 +03:00
|
|
|
++ come |= [@ @ @ (list ovum) vise pone] :: 4
|
|
|
|
^- [(list ovum) _+>]
|
2017-09-28 03:27:08 +03:00
|
|
|
~& %hoon-come
|
|
|
|
=^ rey +>+ (^come +<)
|
|
|
|
[rey +>.$]
|
2018-12-06 02:25:12 +03:00
|
|
|
::
|
2019-05-09 22:46:19 +03:00
|
|
|
++ load |= [@ @ @ (list ovum) vase pane] :: 10
|
|
|
|
^- [(list ovum) _+>]
|
2017-09-28 03:27:08 +03:00
|
|
|
~& %hoon-load
|
|
|
|
=^ rey +>+ (^load +<)
|
|
|
|
[rey +>.$]
|
2018-12-06 02:25:12 +03:00
|
|
|
::
|
2019-05-09 22:46:19 +03:00
|
|
|
++ peek |=(* (^peek ;;([@da path] +<))) :: 46
|
2018-12-06 02:25:12 +03:00
|
|
|
::
|
2019-01-07 23:36:06 +03:00
|
|
|
++ poke |= * :: 47
|
2018-12-05 10:34:45 +03:00
|
|
|
^- [(list ovum) *]
|
2019-05-09 22:46:19 +03:00
|
|
|
=> .(+< ;;([now=@da ovo=ovum] +<))
|
2018-12-05 10:34:45 +03:00
|
|
|
=^ ova +>+.$ (^poke now ovo)
|
2019-02-01 10:48:53 +03:00
|
|
|
=| out=(list ovum)
|
2018-12-05 10:34:45 +03:00
|
|
|
|- ^- [(list ovum) *]
|
2017-09-28 03:27:08 +03:00
|
|
|
?~ ova
|
2019-02-01 10:48:53 +03:00
|
|
|
[(flop out) +>.^$]
|
2018-12-07 01:30:57 +03:00
|
|
|
:: upgrade the kernel
|
2018-12-05 10:34:45 +03:00
|
|
|
::
|
2019-02-01 22:02:33 +03:00
|
|
|
?: ?=(%lyra -.q.i.ova)
|
2017-10-19 06:50:48 +03:00
|
|
|
%+ fall
|
2019-05-09 22:46:19 +03:00
|
|
|
(vega now t.ova ;;([@ @] +.q.i.ova))
|
2017-10-19 06:50:48 +03:00
|
|
|
[~ +>.^$]
|
2018-12-07 01:30:57 +03:00
|
|
|
:: iterate over effects, handling those on arvo proper
|
|
|
|
:: and passing the rest through as output
|
2018-12-05 10:34:45 +03:00
|
|
|
::
|
|
|
|
=^ vov +>+.^$ (feck now i.ova)
|
2019-02-01 10:48:53 +03:00
|
|
|
=? out ?=(^ vov) [+.vov out]
|
|
|
|
$(ova t.ova)
|
2018-12-05 10:34:45 +03:00
|
|
|
::
|
2019-05-09 22:46:19 +03:00
|
|
|
++ wish |=(* (^wish ;;(@ta +<))) :: 22
|
2017-09-28 03:27:08 +03:00
|
|
|
--
|
2018-12-06 02:25:12 +03:00
|
|
|
:: Arvo implementation core
|
|
|
|
::
|
2017-09-28 03:27:08 +03:00
|
|
|
|%
|
|
|
|
++ come :: load incompatible
|
2018-12-06 09:10:24 +03:00
|
|
|
|= [who=ship now=@da yen=@ ova=(list ovum) dub=vise nyf=pone]
|
2017-09-28 03:27:08 +03:00
|
|
|
^+ [ova +>]
|
2018-12-06 09:10:24 +03:00
|
|
|
=/ fyn (turn nyf |=([a=@tas b=vise] [a (slim b)]))
|
|
|
|
(load who now yen ova (slim dub) fyn)
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ load :: load compatible
|
2018-12-06 09:10:24 +03:00
|
|
|
|= [who=ship now=@da yen=@ ova=(list ovum) dub=vase nyf=pane]
|
2017-09-28 03:27:08 +03:00
|
|
|
^+ [ova +>]
|
2018-12-06 04:58:41 +03:00
|
|
|
=: our who
|
|
|
|
eny yen
|
2018-12-06 09:10:24 +03:00
|
|
|
bud dub
|
2018-12-01 02:58:56 +03:00
|
|
|
vanes (turn nyf |=({a/@tas b/vise} [a [b *worm]]))
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
2019-02-01 10:37:00 +03:00
|
|
|
=| out=(list ovum)
|
2018-12-05 10:34:45 +03:00
|
|
|
|- ^- [(list ovum) _+>.^$]
|
2017-09-28 03:27:08 +03:00
|
|
|
?~ ova
|
2019-02-01 10:37:00 +03:00
|
|
|
[(flop out) +>.^$]
|
2018-12-07 01:30:57 +03:00
|
|
|
:: iterate over effects, handling those on arvo proper
|
|
|
|
:: and passing the rest through as output
|
|
|
|
::
|
|
|
|
:: In practice, the pending effects after an upgrade
|
2019-02-01 10:37:00 +03:00
|
|
|
:: are the %veer moves to install %zuse and the vanes,
|
|
|
|
:: plus a %vega notification that the upgrade is complete.
|
|
|
|
::
|
|
|
|
:: N.B. this implementation assumes that %vega will be
|
|
|
|
:: at the end of :ova.
|
|
|
|
::
|
|
|
|
?: ?=(%vega -.q.i.ova)
|
|
|
|
=^ zef vanes
|
2019-02-01 10:52:48 +03:00
|
|
|
(~(spam (is our vil eny bud vanes) now) lac i.ova)
|
2019-02-01 10:37:00 +03:00
|
|
|
$(out [i.ova out], ova (weld t.ova zef))
|
2018-12-05 10:34:45 +03:00
|
|
|
::
|
2018-12-06 04:58:41 +03:00
|
|
|
=^ vov +>.^$ (feck now i.ova)
|
2019-02-01 10:37:00 +03:00
|
|
|
=? out ?=(^ vov) [+.vov out]
|
|
|
|
$(ova t.ova)
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
|
|
|
++ peek :: external inspect
|
|
|
|
|= {now/@da hap/path}
|
|
|
|
^- (unit)
|
2017-10-31 21:07:42 +03:00
|
|
|
?~ hap [~ hoon-version]
|
2018-12-06 09:10:24 +03:00
|
|
|
=+ rob=((sloy ~(beck (is our vil eny bud vanes) now)) [151 %noun] hap)
|
2017-09-28 03:27:08 +03:00
|
|
|
?~ rob ~
|
|
|
|
?~ u.rob ~
|
|
|
|
[~ u.u.rob]
|
|
|
|
::
|
|
|
|
++ poke :: external apply
|
2018-12-05 10:34:45 +03:00
|
|
|
|= [now=@da ovo=ovum]
|
2018-12-07 03:51:52 +03:00
|
|
|
=. eny (shaz (cat 3 eny now))
|
2018-12-05 10:34:45 +03:00
|
|
|
^- [(list ovum) _+>.$]
|
|
|
|
::
|
2018-12-07 01:30:57 +03:00
|
|
|
:: These external events are actually effects on arvo proper.
|
|
|
|
:: They can also be produced as the effects of other events.
|
|
|
|
:: In either case, they fall through here to be handled
|
|
|
|
:: after the fact in +feck.
|
2018-12-05 10:34:45 +03:00
|
|
|
::
|
2019-04-25 21:48:55 +03:00
|
|
|
?: ?=(?(%veer %verb %wack %warn) -.q.ovo)
|
2018-12-05 10:34:45 +03:00
|
|
|
[[ovo ~] +>.$]
|
|
|
|
::
|
2019-09-27 23:00:37 +03:00
|
|
|
:: These external events (currently only %trim) are global
|
|
|
|
:: notifications, spammed to every vane
|
|
|
|
::
|
|
|
|
?: ?=(%trim -.q.ovo)
|
|
|
|
=> .(ovo ;;((pair wire [%trim @ud]) ovo))
|
|
|
|
=^ zef vanes
|
|
|
|
(~(spam (is our vil eny bud vanes) now) lac ovo)
|
|
|
|
[zef +>.$]
|
|
|
|
::
|
|
|
|
:: Normal events are routed to a single vane
|
|
|
|
::
|
2018-12-01 02:58:56 +03:00
|
|
|
=^ zef vanes
|
2018-12-06 09:10:24 +03:00
|
|
|
(~(hurl (is our vil eny bud vanes) now) lac ovo)
|
2017-09-28 03:27:08 +03:00
|
|
|
[zef +>.$]
|
2018-12-05 10:34:45 +03:00
|
|
|
:: +feck: handle an arvo effect
|
2017-11-18 02:14:56 +03:00
|
|
|
::
|
2018-12-05 10:34:45 +03:00
|
|
|
++ feck
|
|
|
|
|= [now=@da ovo=ovum]
|
|
|
|
^- [(unit ovum) _+>.$]
|
|
|
|
?+ -.q.ovo
|
|
|
|
:: pass through unrecognized effect
|
|
|
|
::
|
|
|
|
[[~ ovo] +>.$]
|
|
|
|
:: toggle event verbose event printfs
|
|
|
|
::
|
|
|
|
%verb
|
|
|
|
[~ +>.$(lac !lac)]
|
|
|
|
:: install %zuse or vane
|
|
|
|
::
|
|
|
|
%veer
|
2018-12-06 04:58:41 +03:00
|
|
|
[~ (veer our now q.ovo)]
|
2018-12-05 10:34:45 +03:00
|
|
|
:: add data to memory profile
|
|
|
|
::
|
|
|
|
%mass
|
|
|
|
=. q.q.ovo
|
|
|
|
:- %userspace
|
|
|
|
:- %|
|
2019-02-06 22:03:52 +03:00
|
|
|
:~ hoon+&+pit
|
|
|
|
zuse+&+bud
|
|
|
|
:+ %caches %|
|
|
|
|
%+ turn
|
|
|
|
%+ sort vanes
|
|
|
|
|=([a=[lab=@tas *] b=[lab=@tas *]] (aor lab.a lab.b))
|
|
|
|
|=([label=@tas =vane] [(cat 3 %vane- label) %& worm.vane])
|
2018-12-05 10:34:45 +03:00
|
|
|
q.q.ovo
|
2019-02-06 22:03:52 +03:00
|
|
|
:+ %vases %|
|
|
|
|
%+ turn
|
|
|
|
%+ sort vanes
|
|
|
|
|=([a=[lab=@tas *] b=[lab=@tas *]] (aor lab.a lab.b))
|
|
|
|
|=([label=@tas =vane] [(cat 3 %vane- label) %& vase.vane])
|
|
|
|
dot+&+.
|
2018-12-05 10:34:45 +03:00
|
|
|
==
|
|
|
|
[[~ ovo] +>.$]
|
2018-12-05 23:50:28 +03:00
|
|
|
:: add entropy
|
|
|
|
::
|
|
|
|
%wack
|
|
|
|
?> ?=(@ q.q.ovo)
|
2018-12-07 03:51:52 +03:00
|
|
|
=. eny (shaz (cat 3 eny q.q.ovo))
|
2018-12-05 23:50:28 +03:00
|
|
|
[~ +>.$]
|
2019-04-25 21:48:55 +03:00
|
|
|
:: learn of event-replacement failure
|
|
|
|
::
|
|
|
|
%warn
|
|
|
|
:_ +>.$
|
|
|
|
?. ?=(^ +.q.ovo)
|
|
|
|
~
|
|
|
|
=/ msg=tape
|
|
|
|
:(weld "(for %" (trip (symp +<.q.ovo)) ") failed")
|
|
|
|
~> %slog.[0 leaf+(weld "arvo: replacement event " msg)]
|
|
|
|
?: lac
|
|
|
|
~
|
|
|
|
=/ rep
|
|
|
|
%- mule |.
|
|
|
|
((slog (tang +>.q.ovo)) ~)
|
|
|
|
?.(?=(%& -.rep) ~ p.rep)
|
2018-12-05 10:34:45 +03:00
|
|
|
==
|
2019-01-18 08:37:34 +03:00
|
|
|
::
|
2017-11-18 02:14:56 +03:00
|
|
|
++ vega :: reboot kernel
|
2018-12-05 20:28:46 +03:00
|
|
|
|= $: :: now: current date
|
|
|
|
:: ova: actions to process after reboot
|
|
|
|
:: hun: hoon.hoon source
|
|
|
|
:: arv: arvo.hoon source
|
|
|
|
::
|
|
|
|
now=@da
|
|
|
|
ova=(list ovum)
|
|
|
|
hun=@t
|
|
|
|
van=@t
|
|
|
|
==
|
|
|
|
^- (unit (pair (list ovum) *))
|
|
|
|
:: virtualize; dump error if we fail
|
|
|
|
::
|
2018-03-19 06:54:47 +03:00
|
|
|
=- ?:(?=(%| -.res) ((slog p.res) ~) `p.res)
|
2017-11-18 02:14:56 +03:00
|
|
|
^= res %- mule |.
|
2018-12-05 20:28:46 +03:00
|
|
|
:: produce a new kernel and an effect list
|
|
|
|
::
|
|
|
|
^- (pair (list ovum) *)
|
|
|
|
:: compile the hoon.hoon source with the current compiler
|
|
|
|
::
|
|
|
|
=/ raw
|
|
|
|
~& [%hoon-compile `@p`(mug hun)]
|
|
|
|
(ride %noun hun)
|
|
|
|
:: activate the new compiler gate, producing +ride
|
|
|
|
::
|
|
|
|
=/ cop .*(0 +.raw)
|
|
|
|
:: find the hoon version number of the new kernel
|
|
|
|
::
|
|
|
|
=/ nex
|
|
|
|
(@ .*(cop q:(~(mint ut p.raw) %noun [%limb %hoon-version])))
|
|
|
|
?> |(=(nex hoon-version) =(+(nex) hoon-version))
|
|
|
|
:: if we're upgrading language versions, recompile the compiler
|
|
|
|
::
|
|
|
|
:: hot: raw compiler formula
|
|
|
|
::
|
|
|
|
=> ?: =(nex hoon-version)
|
|
|
|
[hot=`*`raw .]
|
|
|
|
~& [%hoon-compile-upgrade nex]
|
2018-12-09 05:42:36 +03:00
|
|
|
=/ hot (slum cop [%noun hun])
|
2018-12-05 20:28:46 +03:00
|
|
|
.(cop .*(0 +.hot))
|
|
|
|
:: extract the hoon core from the outer gate (+ride)
|
|
|
|
::
|
|
|
|
=/ hoc .*(cop [%0 7])
|
2018-12-05 20:48:27 +03:00
|
|
|
:: compute the type of the hoon.hoon core
|
2018-12-05 20:28:46 +03:00
|
|
|
::
|
2018-12-09 05:42:36 +03:00
|
|
|
=/ hyp -:(slum cop [-.hot '+>'])
|
2018-12-05 20:28:46 +03:00
|
|
|
:: compile arvo
|
|
|
|
::
|
|
|
|
=/ rav
|
2018-12-07 01:30:57 +03:00
|
|
|
~& [%arvo-compile `@p`(mug hyp) `@p`(mug van)]
|
2018-12-09 05:42:36 +03:00
|
|
|
(slum cop [hyp van])
|
2018-12-05 20:48:27 +03:00
|
|
|
:: activate arvo, and extract the arvo core from the outer gate
|
2018-12-05 20:28:46 +03:00
|
|
|
::
|
2018-12-05 20:48:27 +03:00
|
|
|
=/ voc .*(hoc [%7 +.rav %0 7])
|
2018-12-05 20:28:46 +03:00
|
|
|
:: entry gate: ++load for the normal case, ++come for upgrade
|
|
|
|
::
|
|
|
|
=/ gat
|
2018-12-05 20:48:27 +03:00
|
|
|
=/ arm ?:(=(nex hoon-version) 'load' 'come')
|
|
|
|
:: compute the type of the arvo.hoon core
|
|
|
|
::
|
2018-12-09 05:42:36 +03:00
|
|
|
=/ vip -:(slum cop [-.rav '+>'])
|
2018-12-05 20:48:27 +03:00
|
|
|
:: compute the formula for the upgrade gate
|
|
|
|
::
|
2018-12-09 05:42:36 +03:00
|
|
|
=/ fol +:(slum cop [vip arm])
|
2018-12-05 20:48:27 +03:00
|
|
|
:: produce the upgrade gate
|
|
|
|
::
|
|
|
|
.*(voc fol)
|
2018-12-06 04:58:41 +03:00
|
|
|
:: upgrade gate sample
|
2018-12-05 20:28:46 +03:00
|
|
|
::
|
|
|
|
=/ sam
|
2018-12-06 04:58:41 +03:00
|
|
|
:* our
|
|
|
|
now
|
|
|
|
eny
|
2019-02-01 10:37:00 +03:00
|
|
|
:: tack a notification onto the pending effects
|
|
|
|
::
|
|
|
|
(weld ova [`ovum`[/ %vega ~] ~])
|
2018-12-06 09:10:24 +03:00
|
|
|
bud
|
2018-12-06 04:58:41 +03:00
|
|
|
(turn vanes |=([label=@tas =vane] [label vase.vane]))
|
|
|
|
==
|
2018-12-05 20:28:46 +03:00
|
|
|
:: call into the new kernel
|
|
|
|
::
|
2018-12-09 05:42:36 +03:00
|
|
|
=/ out (slum gat sam)
|
2019-02-01 10:37:00 +03:00
|
|
|
:: add types to the product
|
2018-12-05 20:28:46 +03:00
|
|
|
::
|
2019-02-01 10:37:00 +03:00
|
|
|
[((list ovum) -.out) +.out]
|
2018-12-06 04:58:41 +03:00
|
|
|
:: +veer: install %zuse or a vane
|
2017-09-28 03:27:08 +03:00
|
|
|
::
|
2018-12-06 04:58:41 +03:00
|
|
|
:: Identity is in the sample so the larval stage
|
|
|
|
:: can use this as well.
|
2018-12-05 20:28:46 +03:00
|
|
|
::
|
2018-12-06 04:58:41 +03:00
|
|
|
++ veer
|
|
|
|
|= [who=ship now=@da fav=curd]
|
2019-05-09 22:46:19 +03:00
|
|
|
=> .(fav ;;({$veer lal/@ta pax/path txt/@t} fav))
|
2018-03-19 06:54:47 +03:00
|
|
|
=- ?:(?=(%| -.res) ((slog p.res) +>.$) p.res)
|
2017-09-28 03:27:08 +03:00
|
|
|
^= res %- mule |.
|
|
|
|
?: =(%$ lal.fav)
|
|
|
|
~& [%tang pax.fav `@p`(mug txt.fav)]
|
|
|
|
=+ gen=(rain pax.fav txt.fav)
|
|
|
|
=+ vax=(slap pit gen)
|
|
|
|
+>.^$(bud vax)
|
|
|
|
%_ +>.^$
|
2018-12-01 02:58:56 +03:00
|
|
|
vanes
|
|
|
|
|- ^+ vanes
|
|
|
|
?~ vanes
|
2017-09-28 03:27:08 +03:00
|
|
|
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
|
2018-12-06 09:10:24 +03:00
|
|
|
=+ vin=(vint who lal.fav vil bud pax.fav txt.fav)
|
2017-09-28 03:27:08 +03:00
|
|
|
?~ vin
|
2018-12-01 02:58:56 +03:00
|
|
|
vanes
|
2018-12-03 01:05:10 +03:00
|
|
|
[[lal.fav vane:u.vin] vanes]
|
2018-12-01 02:58:56 +03:00
|
|
|
?. =(lal.fav label.i.vanes)
|
|
|
|
[i.vanes $(vanes t.vanes)]
|
2018-12-05 19:42:20 +03:00
|
|
|
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
|
2018-12-01 02:58:56 +03:00
|
|
|
:_ t.vanes
|
|
|
|
:- label.i.vanes
|
2018-12-06 00:26:20 +03:00
|
|
|
~| [%failed-vane-activation now lal.fav]
|
2018-12-06 09:10:24 +03:00
|
|
|
vane:(ruck:(vent who lal.fav vil bud [vase.vane.i.vanes *worm]) pax.fav txt.fav)
|
2017-09-28 03:27:08 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ wish :: external compute
|
2018-12-06 09:10:24 +03:00
|
|
|
|= txt/@
|
2017-09-28 03:27:08 +03:00
|
|
|
q:(slap bud (ream txt))
|
|
|
|
--
|