shrub/sys/parv.hoon

256 lines
11 KiB
Plaintext
Raw Normal View History

2017-02-08 05:28:12 +03:00
!: :: /sys/arvo
:: :: !%reference/2
:: %arvo: arvo microkernel.
::
=< :: 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/ovum}
^+ .
~> %slog.[0 leaf+"arvo-event"]
.(+> +:(poke now ovo))
=>
:: :: ::
2017-02-09 05:19:39 +03:00
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: (1) public molds
2017-02-08 05:28:12 +03:00
:: :: ::
|%
2017-02-09 05:19:39 +03:00
++ arms (map chip dope) :: stated identity
2017-02-08 05:28:12 +03:00
++ card {p/@tas q/*} :: tagged event
++ chip :: standard identity
$? $giv :: given name
2017-02-09 05:19:39 +03:00
$fam :: surname
2017-02-08 05:28:12 +03:00
$had :: fictitious name
$mid :: middle name
2017-02-09 05:19:39 +03:00
$gen :: generational suffix
2017-02-08 05:28:12 +03:00
== ::
2017-02-09 05:19:39 +03:00
++ dope (pair @tas @t) :: term/unicode pair
2017-02-08 05:28:12 +03:00
++ duct (list wire) :: causal history
++ ovum (pair wire card) :: input or output
++ ruby @pG :: 64-bit passcode
++ wire path :: cause
-- =>
2017-02-09 05:19:39 +03:00
:: :: ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: (2) state molds
:: :: ::
2017-02-08 05:28:12 +03:00
|%
2017-02-09 05:19:39 +03:00
++ evil :: hoon-dependent
2017-02-09 21:39:36 +03:00
|* {span/_span twig/_twig vase/_vase} :: inject hoon version
2017-02-09 05:19:39 +03:00
|% ::
2017-02-08 05:28:12 +03:00
++ mall :: any arvo version
2017-02-11 05:03:33 +03:00
$? {$293 mast} :: kelvin 293, current
2017-02-08 05:28:12 +03:00
== ::
++ mast :: system state
2017-02-11 05:03:33 +03:00
$: $= gut :: abdomen
$: run/(list move) :: worklist
2017-02-08 05:28:12 +03:00
out/(list ovum) :: output
2017-02-12 05:44:56 +03:00
sac/worm :: compiler cache
2017-02-08 05:28:12 +03:00
== ::
2017-02-11 05:03:33 +03:00
$= bug :: insect brain
$: noc/@ta :: process nonce
ver/(qual @tas @ud @ud @ud) :: vendor/version
== ::
2017-02-08 05:28:12 +03:00
$= mal :: mammal brain
2017-02-12 05:44:56 +03:00
$: off/? :: not yet booted
lac/? :: not verbose
2017-02-11 05:03:33 +03:00
bud/vase :: compiled zuse
2017-02-12 05:44:56 +03:00
van/(map term vase) :: vanes
2017-02-08 05:28:12 +03:00
== ::
$= rep :: reptile brain
$: orb/@p :: ship
nym/arms :: name information
roy/(map @ud ruby) :: start secrets
fat/(map path (pair term noun)) :: boot filesystem
== == ::
2017-02-09 05:19:39 +03:00
++ mill (each vase milo) :: vase or metavase
2017-02-08 05:28:12 +03:00
++ milo {p/* q/*} :: untyped metavase
2017-02-11 05:03:33 +03:00
++ move (pair duct part) :: vane move
2017-02-08 05:28:12 +03:00
++ part :: arvo vane move
$% {$give p/mill} :: vane "return"
2017-02-11 05:03:33 +03:00
{$pass p/wire q/(pair term mill)} :: vane "call"
2017-02-08 05:28:12 +03:00
== ::
2017-02-09 05:19:39 +03:00
++ worm :: compiler cache
$: nes/(set ^) :: ++nest
pay/(map (pair span twig) span) :: ++play
mit/(map (pair span twig) (pair span nock)) :: ++mint
== ::
-- ::
++ live (evil) :: modern molds
++ vile (evil typo twit vise) :: old molds
2017-02-11 05:03:33 +03:00
++ wasp :: arvo effect
2017-02-12 05:44:56 +03:00
$% {$walk ~} :: finish mammal brain
2017-02-11 05:03:33 +03:00
{$wear p/@tas q/@t} :: load/reload vane
{$what p/(list (pair path (pair term noun)))} :: put reptile files
{$whom p/@p q/arms r/(map @ud ruby)} :: put reptile identity
2017-02-12 05:44:56 +03:00
{$wine p/@tas q/@t} :: install a vane
2017-02-11 05:03:33 +03:00
{$wink p/@t q/@t} :: reset york/zuse
2017-02-12 05:44:56 +03:00
{$woke ~} :: finish booting
2017-02-11 05:03:33 +03:00
== ::
2017-02-08 05:28:12 +03:00
-- =>
2017-02-09 05:19:39 +03:00
|%
2017-02-08 05:28:12 +03:00
:: :: ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: (2) engines
:: :: ::
|%
2017-02-09 05:19:39 +03:00
:: :: ++le
++ le :: deep engine
=+ mast:live
2017-02-12 05:44:56 +03:00
=* ::
:: sys: system state
::
sys -
2017-02-09 05:19:39 +03:00
|%
2017-02-12 05:44:56 +03:00
:: :: ++abet:le
++
:: :: ++buzz:le
++ buzz :: arvo effect
|= wap/wasp
^+ +>
?+ -.wap !!
::
:: $what: install boot files in reptile brain
2017-02-11 05:03:33 +03:00
::
2017-02-12 05:44:56 +03:00
$what ::
=+ mol $: fat/(map path (pair term noun))
=+ dat=((hard {@p arms (map @ud ruby)}) +.ovo)
::
:: $whom: install identity information and complete boot process
2017-02-11 05:03:33 +03:00
::
2017-02-12 05:44:56 +03:00
$whom
=* mol $: orb/@p
nym/arms
roy/(map @ud ruby)
==
=+ dat=((hard mol) +.ovo)
=: orb.rep orb.dat
nym.rep nym.dat
roy.rep (~(uni by roy.rep) roy.rep roy.dat)
==
==
:: :: ++emit:le
++ emit :: push move on stack
|=(move +>(run.gut [+> run.gut))
2017-02-11 05:03:33 +03:00
:: :: ++pike:le
2017-02-12 05:44:56 +03:00
++ pike :: event to %pass
2017-02-09 05:19:39 +03:00
|= $: :: lay: event route
:: now: date
2017-02-12 05:44:56 +03:00
:: tea: cause
:: vax: vase of card
2017-02-09 05:19:39 +03:00
::
lay/@tas
now/@da
2017-02-11 05:03:33 +03:00
tea/wire
2017-02-12 05:44:56 +03:00
jac/card
2017-02-09 05:19:39 +03:00
==
2017-02-12 05:44:56 +03:00
^+ +>
:: print event if in verbose mode
2017-02-11 05:03:33 +03:00
::
~? &(!lac.mal !=(%belt -.q.ovo)) [%unix -.q.ovo p.ovo]
::
2017-02-12 05:44:56 +03:00
:: convert ovum to vase
2017-02-11 05:03:33 +03:00
::
2017-02-12 05:44:56 +03:00
=^ vax +> (open jac)
::
:: push move to stack
::
(emit %pass tea lay %& vax)
:: :: ++open:le
++ open :: input card to move
|= jac/card
^- {vase _+>}
?< off.mal
=^ vax sac.gut (~(slap wa sac.gut) [%limb %unix-task])
[vax +>.$]
2017-02-09 05:19:39 +03:00
:: :: ++poke:le
++ poke :: event from unix
|= $: :: now: event date
:: ovo: event
::
now/@da
ovo/ovum
==
^+ sys
2017-02-12 05:44:56 +03:00
~| [%poke -.ovo]
2017-02-09 21:39:36 +03:00
::
2017-02-12 05:44:56 +03:00
:: the event is either vane input or an arvo action (wasp).
:: we default to treating it as a wasp.
2017-02-11 05:03:33 +03:00
::
2017-02-12 05:44:56 +03:00
?+ -.ovo
(buzz ((hard wasp) ovo))
2017-02-11 05:03:33 +03:00
::
2017-02-12 05:44:56 +03:00
$belt (pike %d now ovo)
$blew (pike %d now ovo)
$born (pike %e now ovo)
$hail (pike %d now ovo)
$hear (pike %a now ovo)
$hook (pike %d now ovo)
$into (pike %c now ovo)
$they (pike %e now ovo)
$this (pike %e now ovo)
$thus (pike %e now ovo)
2017-02-09 05:19:39 +03:00
==
2017-02-12 05:44:56 +03:00
:: :: ++wear:le
++ wear :: primary import
|
2017-02-11 05:03:33 +03:00
++ work
2017-02-09 05:19:39 +03:00
--
2017-02-08 05:28:12 +03:00
--
:: :: ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: (3) surface
:: :: ::
|_
:: :: ++come
++ come :: upgrade from old
|=
^- {(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))
?: ?=($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
--