mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-29 12:15:43 +03:00
660 lines
21 KiB
Plaintext
660 lines
21 KiB
Plaintext
:: ::
|
|
:::: 6: layer six
|
|
::
|
|
~> %slog.[0 leaf+"arvo-boot"]
|
|
=< |= {now/@da ovo/*}
|
|
^- *
|
|
~> %slog.[0 leaf+"arvo-event"]
|
|
.(+> +:(poke now ovo))
|
|
=>
|
|
~% %hex + ~
|
|
|%
|
|
::
|
|
:::: 6a: arvo core
|
|
::
|
|
:: :: ++mean:error:
|
|
++ mean :: deify stack trace
|
|
|=(a/tang (fear (flop a) |.(!!)))
|
|
:: :: ++fear:error:
|
|
++ fear :: insert user mean
|
|
|* {a/tang _|?(**)}
|
|
^+ (+<+)
|
|
=> .(a `tang`a)
|
|
?~ a (+<+)
|
|
~_(i.a $(a t.a))
|
|
:: :: ++slog:error:
|
|
++ slog :: deify printf
|
|
:: pri: priority level
|
|
=| pri/@
|
|
::
|
|
:: .= ~&(%a 1)
|
|
::
|
|
|= a/tang ^+ same
|
|
::
|
|
:: ((slog ~[>%a<]) 1)
|
|
::
|
|
?~(a same ~>(%slog.[pri i.a] $(a t.a)))
|
|
::
|
|
++ sloy
|
|
|= sod/slyd
|
|
^- slyt
|
|
|= {ref/* raw/*}
|
|
=+ pux=((soft path) raw)
|
|
?~ pux ~
|
|
?. ?=({@ @ @ @ *} u.pux) ~
|
|
=+ :* hyr=(slay i.u.pux)
|
|
fal=(slay i.t.u.pux)
|
|
dyc=(slay i.t.t.u.pux)
|
|
ved=(slay i.t.t.t.u.pux)
|
|
tyl=t.t.t.t.u.pux
|
|
==
|
|
?. ?=({$~ $$ $tas @} hyr) ~
|
|
?. ?=({$~ $$ $p @} fal) ~
|
|
?. ?=({$~ $$ $tas @} dyc) ~
|
|
?. ?=(^ ved) ~
|
|
=+ ron=q.p.u.hyr
|
|
=+ bed=[[q.p.u.fal q.p.u.dyc (case p.u.ved)] (flop tyl)]
|
|
=+ bop=(sod ref ~ ron bed)
|
|
?~ bop ~
|
|
?~ u.bop [~ ~]
|
|
[~ ~ +.q.u.u.bop]
|
|
::
|
|
++ vent :: vane core
|
|
|= {lal/@tas vil/vile bud/vase sew/(pair worm vase)}
|
|
~% %vent +>+ ~
|
|
|%
|
|
++ ruck :: update vase
|
|
|= {pax/path txt/@ta}
|
|
^+ +>
|
|
=- ?:(?=($| -.res) ((slog p.res) +>.$) p.res)
|
|
^= res %- mule |.
|
|
=+ arg=[~2000.1.1 0 =>(~ |~(* ~))]
|
|
=+ rig=(slym q.sew arg)
|
|
=+ rev=(slym (slap bud (rain pax txt)) bud)
|
|
=+ syg=(slym rev arg)
|
|
~| %load-lost
|
|
+>.^$(q.sew (slam (slap syg [%limb %load]) (slap rig [%limb %stay])))
|
|
::
|
|
++ wink :: deploy
|
|
|= {now/@da eny/@ ski/slyd}
|
|
=+ rig=(slym q.sew +<) :: activate vane
|
|
~% %wink +>+> ~
|
|
|%
|
|
++ doze
|
|
|= {now/@da hen/duct}
|
|
^- (unit @da)
|
|
((hard (unit @da)) q:(slym (slap rig [%limb %doze]) +<))
|
|
::
|
|
++ slid
|
|
|= {hed/mill tal/mill}
|
|
^- mill
|
|
?: &(?=($& -.hed) ?=($& -.tal))
|
|
[%& (slop p.hed p.tal)]
|
|
[%| [%cell p.p.hed p.p.tal] [q.p.hed q.p.tal]]
|
|
::
|
|
++ slix
|
|
|= hil/mill
|
|
^- mill
|
|
?- -.hil
|
|
$& [%& (slop [typ.vil p.p.hil] p.hil)]
|
|
$| [%| [%cell typ.vil p.p.hil] p.hil]
|
|
==
|
|
::
|
|
++ slur :: call gate on
|
|
|= {gat/vase hil/mill}
|
|
^- (unit (pair vase worm))
|
|
=+ sam=(slot 6 gat)
|
|
=+ ^= hig
|
|
?- -.hil
|
|
$& (~(nest wa p.sew) p.sam p.p.hil)
|
|
$| (~(nets wa p.sew) p.sam p.p.hil)
|
|
==
|
|
?.(-.hig ~ `[(slym gat +>.hil) +.hig])
|
|
::
|
|
++ 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))))
|
|
++ slur-z ~/(%slur-z |=({gat/vase hil/mill} =+(%z (slur gat hil))))
|
|
::
|
|
++ 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)
|
|
==
|
|
::
|
|
++ song :: reduce metacard
|
|
~/ %song ::
|
|
|= mex/vase :: mex: vase of card
|
|
^- (unit (pair mill worm)) ::
|
|
=^ hip p.sew (~(nell wa p.sew) p.mex) ::
|
|
?. hip ~ :: a card is a cell
|
|
?. ?=($meta -.q.mex) `[[%& mex] p.sew] :: ordinary card
|
|
=^ tiv p.sew (~(slot wa p.sew) 3 mex) ::
|
|
=^ hip p.sew (~(nell wa p.sew) p.tiv) ::
|
|
?. hip ~ :: a vase is a cell
|
|
=^ vax p.sew (~(slot wa p.sew) 2 tiv) ::
|
|
=^ hip p.sew (~(nest wa p.sew) typ.vil p.vax) ::
|
|
?. hip ~ :: vase head is span
|
|
%+ biff ::
|
|
=+ mut=(milt q.tiv) :: card span, value
|
|
|- ^- (unit (pair milt worm)) ::
|
|
?. ?=({$meta p/* q/milt} q.mut) `[mut p.sew] :: ordinary metacard
|
|
=^ hip p.sew (~(nets wa p.sew) mev.vil p.mut)::
|
|
?. 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
|
|
%+ bind
|
|
=- ?- -.har
|
|
$| ~& [%dead-card p.har] ~ :: XX properly log?
|
|
$& (some p.har)
|
|
==
|
|
^= har ^- (each (pair arvo worm) term)
|
|
=^ caq p.sew (~(spot wa p.sew) 3 wec)
|
|
?+ q.caq [%| (cat 3 %funk (@tas q.caq))]
|
|
::
|
|
{$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
|
|
=^ yav p.sew (~(spot wa p.sew) 15 caq)
|
|
%+ bind (song yav)
|
|
|= {hil/mill vel/worm}
|
|
[%& [%pass pax lal hil] vel]
|
|
::
|
|
{$give p/{p/@tas q/*}}
|
|
%- (bond |.([%| p.p.q.caq]))
|
|
=^ yav p.sew (~(spot wa p.sew) 3 caq)
|
|
%+ 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) ~
|
|
=^ yav p.sew (~(spot wa p.sew) 7 caq)
|
|
%+ 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)
|
|
?: =(~ q.vud) [~ p.sew]
|
|
=^ hed p.sew (~(slot wa p.sew) 2 vud)
|
|
=^ tal p.sew (~(slot wa p.sew) 3 vud)
|
|
=^ mov p.sew (need (sump hed))
|
|
=^ moz p.sew $(vud tal)
|
|
[[mov moz] p.sew]
|
|
::
|
|
++ scry :: read namespace
|
|
~/ %scry
|
|
|= $: fur/(unit (set monk))
|
|
ren/@t
|
|
bed/beam
|
|
==
|
|
^- (unit (unit (cask)))
|
|
:: ~& [%arvo-scry ren bed]
|
|
=+ ^= old
|
|
:* fur
|
|
ren
|
|
[%& p.bed]
|
|
q.bed
|
|
`coin`[%$ r.bed]
|
|
(flop s.bed)
|
|
==
|
|
^- (unit (unit (cask)))
|
|
=+ pro=(slym (slap rig [%limb %scry]) old)
|
|
?~ q.pro ~
|
|
?~ +.q.pro [~ ~]
|
|
=+ dat=(slot 7 pro)
|
|
[~ ~ (mark -.q.dat) +.q.dat]
|
|
::
|
|
++ soar :: scrub vane
|
|
|= sev/vase
|
|
^- vase
|
|
?: &(=(-.q.q.sew -.q.sev) =(+>.q.q.sew +>.q.sev))
|
|
q.sew :: unchanged, use old
|
|
sev(+<.q [*@da *@ =>(~ |~(* ~))]) :: clear to stop leak
|
|
::
|
|
++ swim
|
|
~/ %swim
|
|
|= $: org/@tas
|
|
pux/(unit wire)
|
|
hen/duct
|
|
hil/mill
|
|
==
|
|
^- {{p/(list move) q/worm} q/vase}
|
|
:: ~& [%swim-wyt `@ud`~(wyt in p.sew)]
|
|
=+ ^= pru
|
|
?~ pux
|
|
~| [%swim-call-vane lal ({term $~} +.p.hil)]
|
|
=^ vax p.sew (~(slap wa p.sew) rig [%limb %call])
|
|
%^ slur-pro lal vax
|
|
(slid [%& duc.vil hen] (slix hil))
|
|
~| [%swim-take-vane lal ({term $~} +.p.hil)]
|
|
=^ vax p.sew (~(slap wa p.sew) rig [%limb %take])
|
|
%^ slur-pro lal vax
|
|
;: slid
|
|
[%& pah.vil u.pux]
|
|
[%& duc.vil hen]
|
|
(slix (slid [%& [%atom %tas `org] org] hil))
|
|
==
|
|
?~ pru
|
|
~& [%swim-lost lal (@tas +>-.hil)]
|
|
[[~ p.sew] q.sew]
|
|
=^ pro p.sew (need pru)
|
|
=^ moz p.sew (~(slap wa p.sew) pro [%limb %p])
|
|
=^ vem p.sew (~(slap wa p.sew) pro [%limb %q])
|
|
[(said moz) (soar vem)]
|
|
--
|
|
--
|
|
::
|
|
++ vint :: create vane
|
|
|= {lal/@tas vil/vile bud/vase pax/path txt/@ta} ::
|
|
=- ?:(?=($| -.res) ((slog p.res) ~) (some p.res))
|
|
^= res %- mule |.
|
|
(vent lal vil bud *worm (slym (slap bud (rain pax txt)) bud))
|
|
::
|
|
++ viol :: vane tools
|
|
|= but/span
|
|
^- vile
|
|
=+ pal=|=(a/@t ^-(span (~(play ut but) (vice a))))
|
|
:* typ=(pal '*span')
|
|
duc=(pal '*duct')
|
|
pah=(pal '*path')
|
|
mev=(pal '*{$meta $vase}')
|
|
==
|
|
::
|
|
++ is :: operate in time
|
|
|= {vil/vile eny/@ bud/vase niz/(pair worm (list {p/@tas q/vase}))}
|
|
|_ now/@da
|
|
++ beck
|
|
^- slyd
|
|
|= {* fur/(unit (set monk)) ron/term bed/beam}
|
|
^- (unit (unit (cask)))
|
|
=> .(fur ?^(fur fur `[[%& p.bed] ~ ~])) :: XX heinous
|
|
=+ lal=(end 3 1 ron)
|
|
=+ ren=(rsh 3 1 ron)
|
|
|- ^- (unit (unit (cask)))
|
|
?~ q.niz ~
|
|
?. =(lal p.i.q.niz) $(q.niz t.q.niz)
|
|
%- scry:(wink:(vent lal vil bud p.niz q.i.q.niz) now (shax now) ..^$)
|
|
[fur ren bed]
|
|
::
|
|
++ dink :: vase by char
|
|
|= din/@tas ^- vase
|
|
?~(q.niz !! ?:(=(din p.i.q.niz) q.i.q.niz $(q.niz t.q.niz)))
|
|
::
|
|
++ dint :: input routing
|
|
|= hap/path ^- @tas
|
|
?+ hap !!
|
|
{@ $ames *} %a
|
|
{@ $boat *} %c
|
|
{@ $newt *} %a
|
|
{@ $sync *} %c
|
|
{@ $term *} %d
|
|
{@ $http *} %e
|
|
{@ $behn *} %b
|
|
==
|
|
::
|
|
++ doos :: sleep until
|
|
|= hap/path ^- (unit @da)
|
|
=+ lal=(dint hap)
|
|
(doze:(wink:(vent lal vil bud p.niz (dink lal)) now 0 beck) now [hap ~])
|
|
::
|
|
++ hurl :: start loop
|
|
|= {lac/? ovo/ovum}
|
|
~? &(!lac !=(%belt -.q.ovo)) [%unix -.q.ovo p.ovo]
|
|
^- {p/(list ovum) q/(pair worm (list {p/@tas q/vase}))}
|
|
?> ?=(^ p.ovo)
|
|
%+ kick lac
|
|
:~ :* i.p.ovo
|
|
~
|
|
:^ %pass t.p.ovo
|
|
(dint p.ovo)
|
|
:+ %&
|
|
[%cell [%atom %tas `%soft] %noun]
|
|
[%soft q.ovo]
|
|
==
|
|
==
|
|
::
|
|
++ race :: take
|
|
|= {org/@tas lal/@tas pux/(unit wire) hen/duct hil/mill ves/vase}
|
|
^- {p/{p/(list move) q/worm} q/vase}
|
|
=+ ven=(vent lal vil bud [p.niz ves])
|
|
=+ win=(wink:ven now (shax now) beck)
|
|
(swim:win org pux hen hil)
|
|
::
|
|
++ fire :: execute
|
|
|= {org/term lal/term pux/(unit wire) hen/duct hil/mill}
|
|
?: &(?=(^ pux) ?=($~ hen))
|
|
[[[[lal u.pux] (curd +>.hil)]~ ~] niz]
|
|
=+ naf=q.niz
|
|
|- ^- {{p/(list ovum) q/(list muse)} _niz}
|
|
?~ naf [[~ ~] [p.niz ~]]
|
|
?. =(lal p.i.naf)
|
|
=+ tuh=$(naf t.naf)
|
|
[-.tuh [+<.tuh [i.naf +>.tuh]]]
|
|
=+ fiq=(race org lal pux hen hil q.i.naf)
|
|
[[~ (turn p.p.fiq |=(a/move [lal a]))] [q.p.fiq [[p.i.naf q.fiq] t.naf]]]
|
|
::
|
|
++ jack :: dispatch card
|
|
|= {lac/? gum/muse}
|
|
^- {{p/(list ovum) q/(list muse)} _niz}
|
|
:: =. lac |(lac ?=(?(%g %f) p.gum))
|
|
:: =. lac &(lac !?=($b p.gum))
|
|
%+ fire
|
|
p.gum
|
|
?- -.r.gum
|
|
$pass
|
|
~? &(!lac !=(%$ p.gum))
|
|
:^ %pass [p.gum p.q.r.gum]
|
|
[(@tas +>-.q.q.r.gum) p.r.gum]
|
|
q.gum
|
|
[p.q.r.gum ~ [[p.gum p.r.gum] q.gum] q.q.r.gum]
|
|
::
|
|
$give
|
|
?> ?=(^ q.gum)
|
|
?. ?=(^ i.q.gum)
|
|
~& [%jack-bad-duct q.gum]
|
|
~& [%jack-bad-card +>-.p.r.gum]
|
|
!!
|
|
~? &(!lac |(!=(%blit +>-.p.r.gum) !=(%d p.gum)))
|
|
[%give p.gum (@tas +>-.p.r.gum) `duct`q.gum]
|
|
[i.i.q.gum [~ t.i.q.gum] t.q.gum p.r.gum]
|
|
::
|
|
$slip
|
|
~? !lac [%slip p.gum (@tas +>-.q.p.r.gum) q.gum]
|
|
[p.p.r.gum ~ q.gum q.p.r.gum]
|
|
==
|
|
::
|
|
++ kick :: new main loop
|
|
|= {lac/? mor/(list muse)}
|
|
=| ova/(list ovum)
|
|
|- ^- {p/(list ovum) q/(pair worm (list {p/@tas q/vase}))}
|
|
?~ mor [(flop ova) niz]
|
|
=^ nyx niz (jack lac i.mor)
|
|
$(ova (weld p.nyx ova), mor (weld q.nyx t.mor))
|
|
--
|
|
--
|
|
::
|
|
:::: arvo interface
|
|
::
|
|
=+ pit=`vase`!>(.) ::
|
|
=+ vil=(viol p.pit) :: cached reflexives
|
|
=| $: lac/? :: not verbose
|
|
bod/(unit vase) :: standard library
|
|
urb/(unit ship) :: identity
|
|
eny/@ :: entropy
|
|
niz/(pair worm (list {p/@tas q/vase})) :: modules
|
|
== ::
|
|
=< |%
|
|
++ come |= {@ (list ovum) pone} :: 11
|
|
^- {(list ovum) _+>}
|
|
~& %hoon-come
|
|
=^ rey +>+ (^come +<)
|
|
[rey +>.$]
|
|
++ keep |=(* (^keep ((hard {@da path}) +<))) :: 4
|
|
++ load |= {@ (list ovum) pane} :: 86
|
|
^- {(list ovum) _+>}
|
|
~& %hoon-load
|
|
=^ rey +>+ (^load +<)
|
|
[rey +>.$]
|
|
++ peek |=(* (^peek ((hard {@da path}) +<))) :: 87
|
|
++ poke |= * :: 42
|
|
^- {(list ovum) *}
|
|
=> .(+< ((hard {now/@da ovo/ovum}) +<))
|
|
=^ ova +>+ (^poke now ovo)
|
|
|- ^- {(list ovum) *}
|
|
?~ ova
|
|
[~ +>.^$]
|
|
?: ?=($verb -.q.i.ova)
|
|
$(ova t.ova, lac !lac)
|
|
?: ?=($veer -.q.i.ova)
|
|
$(ova t.ova, +>+.^$ (veer now q.i.ova))
|
|
?: ?=($vega -.q.i.ova)
|
|
(fall (vega now t.ova (path +.q.i.ova)) [~ +>.^$])
|
|
?: ?=($velo -.q.i.ova)
|
|
(fall (velo now t.ova ({@ @} +.q.i.ova)) [~ +>.^$])
|
|
?: ?=(?($init $veal) -.q.i.ova)
|
|
=+ avo=$(ova t.ova, +>+.^$ (boot (@ +.q.i.ova)))
|
|
[[i.ova -.avo] +.avo]
|
|
?: ?=($mass -.q.i.ova)
|
|
=+ avo=$(ova t.ova)
|
|
:_ +.avo
|
|
:_ -.avo
|
|
%= i.ova
|
|
q.q
|
|
:- %userspace
|
|
:- %|
|
|
:~ hoon+`pit
|
|
zuse+`mast
|
|
hoon-cache+`p.niz
|
|
q.q.i.ova
|
|
dot+`.
|
|
==
|
|
==
|
|
=+(avo=$(ova t.ova) [[i.ova -.avo] +.avo])
|
|
++ wish |=(* (^wish ((hard @ta) +<))) :: 20
|
|
--
|
|
|%
|
|
++ boot :: set singlehome
|
|
|= {who/@p}
|
|
^+ +>
|
|
?: &(?=(^ urb) (lth u.urb who)) +>
|
|
+>(urb `who, bod ?~(bod ~ bod(-.q.u who)))
|
|
::
|
|
++ come :: load incompatible
|
|
|= {yen/@ ova/(list ovum) nyf/pone}
|
|
^+ [ova +>]
|
|
(load yen ova (turn nyf |=({a/@tas b/vise} [a (slim b)])))
|
|
::
|
|
++ keep :: wakeup delay
|
|
|= {now/@da hap/path}
|
|
=> .(+< ((hard {now/@da hap/path}) +<))
|
|
(~(doos (is vil eny mast niz) now) hap)
|
|
::
|
|
++ load :: load compatible
|
|
|= {yen/@ ova/(list ovum) nyf/pane}
|
|
^+ [ova +>]
|
|
=: eny yen
|
|
q.niz nyf
|
|
==
|
|
|- ^+ [ova +>.^$]
|
|
?~ ova
|
|
[~ +>.^$]
|
|
?: ?=($verb -.q.i.ova)
|
|
$(ova t.ova, lac !lac)
|
|
?: ?=($veer -.q.i.ova)
|
|
$(ova t.ova, +>.^$ (veer *@da q.i.ova))
|
|
=+(avo=$(ova t.ova) [[i.ova -.avo] +.avo])
|
|
::
|
|
++ mast ?~(bod pit u.bod) :: stdlib if installed
|
|
++ peek :: external inspect
|
|
|= {now/@da hap/path}
|
|
^- (unit)
|
|
?~ hap [~ hoon]
|
|
=+ rob=((sloy ~(beck (is vil eny mast niz) now)) [151 %noun] hap)
|
|
?~ rob ~
|
|
?~ u.rob ~
|
|
[~ u.u.rob]
|
|
::
|
|
++ poke :: external apply
|
|
|= {now/@da ovo/ovum}
|
|
^- {(list ovum) _+>}
|
|
=. eny (mix eny (shaz now))
|
|
:: ~& [%poke -.q.ovo]
|
|
?: ?=(?($veer $vega $verb $veal) -.q.ovo)
|
|
::
|
|
:: these effects on arvo proper fall through and
|
|
:: are handled in post.
|
|
::
|
|
[[ovo ~] +>.$]
|
|
=^ zef niz
|
|
(~(hurl (is vil eny mast niz) now) lac ovo)
|
|
[zef +>.$]
|
|
::
|
|
++ vega :: reboot kernel
|
|
|= {now/@da ova/(list ovum) hap/path}
|
|
^- (unit {p/(list ovum) q/*})
|
|
=- ?:(?=($| -.res) ((slog p.res) ~) `p.res)
|
|
^= res %- mule |.
|
|
=+ pax=(weld hap `path`[%hoon ~])
|
|
~& [%vega-start hap]
|
|
=+ src=((hard @t) (need (peek now cx+pax)))
|
|
=+ gen=(rain hap src)
|
|
~& %vega-parsed
|
|
=+ ken=.*(0 q:(~(mint ut %noun) %noun gen))
|
|
=+ ^= nex
|
|
=+ gat=.*(ken .*(ken [0 87]))
|
|
(need ((hard (unit @)) .*([-.gat [[now ~] +>.gat]] -.gat)))
|
|
~& [%vega-compiled hoon nex]
|
|
?> (lte nex hoon)
|
|
=+ gat=.*(ken .*(ken [0 ?:(=(nex hoon) 86 11)]))
|
|
=+ sam=[eny ova q.niz]
|
|
=+ raw=.*([-.gat [sam +>.gat]] -.gat)
|
|
[[[~ %vega hap] ((list ovum) -.raw)] +.raw]
|
|
::
|
|
++ velo :: new full reboot
|
|
|= $: :: 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 {p/(list ovum) q/*})
|
|
::
|
|
:: virtualize; dump error if we fail
|
|
::
|
|
=- ?:(?=($| -.-) ((slog p.-) ~) `p.-)
|
|
%- mule |.
|
|
::
|
|
:: produce a new kernel and an output list
|
|
::
|
|
^- (pair (list ovum) *)
|
|
::
|
|
:: compile the hoon.hoon source with the current compiler
|
|
::
|
|
~& [%hoon-compile `@p`(mug hun)]
|
|
=+ raw=(ride %noun hun)
|
|
::
|
|
:: activate the new compiler gate
|
|
::
|
|
=+ cop=.*(0 +.raw)
|
|
::
|
|
:: find the hoon version number of the new kernel
|
|
::
|
|
=+ nex=(@ .*(cop q:(~(mint ut p.raw) %noun [%limb %hoon])))
|
|
?> |(=(nex hoon) =(+(nex) hoon))
|
|
::
|
|
:: if we're upgrading language versions, recompile the compiler
|
|
::
|
|
=> ?: =(nex hoon)
|
|
[hot=`*`raw .]
|
|
~& [%hoon-compile-upgrade nex]
|
|
=+ hot=.*(cop(+< [%noun hun]) -.cop)
|
|
.(cop .*(0 +.hot))
|
|
::
|
|
:: extract the hoon core from the outer gate
|
|
::
|
|
=+ hoc=.*(cop [0 7])
|
|
::
|
|
:: compute the span of the hoon.hoon core
|
|
::
|
|
=+ hyp=-:.*(cop(+< [-.hot '+>']) -.cop)
|
|
::
|
|
:: compile arvo
|
|
::
|
|
~& [%compile-arvo `@p`(mug hyp) `@p`(mug van)]
|
|
=+ rav=.*(cop(+< [hyp van]) -.cop)
|
|
::
|
|
:: create the arvo kernel
|
|
::
|
|
=+ arv=.*(hoc +.rav)
|
|
::
|
|
:: extract the arvo core from the outer gate
|
|
::
|
|
=+ voc=.*(arv [0 7])
|
|
::
|
|
:: compute the span of the arvo.hoon core
|
|
::
|
|
=+ vip=-:.*(cop(+< [-.rav '+>']) -.cop)
|
|
::
|
|
:: entry gate: ++load for the normal case, ++come for upgrade
|
|
::
|
|
=+ gat=.*(voc +:.*(cop(+< [vip ?:(=(nex hoon) 'load' 'come')]) -.cop))
|
|
::
|
|
:: sample: [entropy actions vases]
|
|
::
|
|
=+ sam=[eny ova q.niz]
|
|
::
|
|
:: call into the new kernel
|
|
::
|
|
=+ out=.*(gat(+< sam) -.gat)
|
|
::
|
|
:: tack a reset notification onto the product
|
|
::
|
|
[[[~ %vega ~] ((list ovum) -.out)] +.out]
|
|
::
|
|
++ veer :: install vane/tang
|
|
|= {now/@da fav/curd}
|
|
=> .(fav ((hard {$veer lal/@ta pax/path txt/@t}) fav))
|
|
=- ?:(?=($| -.res) ((slog p.res) +>.$) p.res)
|
|
^= res %- mule |.
|
|
?: =(%$ lal.fav)
|
|
~& [%tang pax.fav `@p`(mug txt.fav)]
|
|
=+ gen=(rain pax.fav txt.fav)
|
|
=+ vax=(slap pit gen)
|
|
=+ orb=`@p`?~(urb 0xffff.ffff.ffff.ffff.ffff.ffff.ffff.ffff u.urb)
|
|
+>.^$(bod `[[%cell [%face [~ %our] [%atom %p ~]] p.vax] [orb q.vax]])
|
|
%_ +>.^$
|
|
q.niz
|
|
|- ^+ q.niz
|
|
?~ q.niz
|
|
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
|
|
=+ vin=(vint lal.fav vil mast pax.fav txt.fav)
|
|
?~ vin
|
|
q.niz
|
|
[[lal.fav q.sew:u.vin] q.niz]
|
|
?. =(lal.fav p.i.q.niz)
|
|
[i.q.niz $(q.niz t.q.niz)]
|
|
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
|
|
:_ t.q.niz
|
|
:- p.i.q.niz
|
|
q.sew:(ruck:(vent lal.fav vil mast [p.niz q.i.q.niz]) pax.fav txt.fav)
|
|
==
|
|
::
|
|
++ wish :: external compute
|
|
|= txt/@
|
|
q:(slap mast (ream txt))
|
|
--
|