shrub/pkg/arvo/gen/glass.hoon

133 lines
2.9 KiB
Plaintext
Raw Normal View History

:: Produce a glass pill
2017-04-17 03:12:12 +03:00
::
:::: /hoon/glass/gen
::
/? 310
::
::::
2017-04-19 17:48:10 +03:00
::
2017-04-17 03:12:12 +03:00
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
*
==
=< [%noun ~]
=> |%
++ wasp :: arvo effect
$% {$wack p/@uvJ} :: add entropy
2019-01-18 08:37:34 +03:00
{$what p/(list (pair path (pair term noun)))} :: reset reptile
2017-04-17 03:12:12 +03:00
{$whom p/@p} :: id and boot
==
--
::
:: deterministic test
::
=. eny 0v0
::
:: build arvo with existing compiler
::
2017-04-18 04:52:05 +03:00
|^ ^- *
2017-04-17 03:12:12 +03:00
::
2017-04-18 06:16:07 +03:00
:: neo: root path to boot system, `/~me/[desk]/now/neo`
2017-04-17 03:12:12 +03:00
::
2017-04-18 06:16:07 +03:00
=+ neo=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/neo
2017-04-17 03:12:12 +03:00
::
2017-04-18 06:16:07 +03:00
:: arvo-source: hoon source file producing arvo kernel, `neo/arvo`
2017-04-17 03:12:12 +03:00
::
2017-04-18 06:16:07 +03:00
=+ arvo-source=.^(@t %cx (welp neo /arvo/hoon))
2017-04-17 03:12:12 +03:00
::
:: arvo-twig: parsed arvo source
::
~& [%parsing `@p`(mug arvo-source)]
=+ arvo-twig=(ream arvo-source)
~& %parsed
::
2017-04-18 04:52:05 +03:00
:: arvo-kernel: a living urbit
2017-04-17 03:12:12 +03:00
::
~& [%compiling `@p`(mug arvo-twig)]
2017-04-18 04:52:05 +03:00
=+ arvo-kernel=+:(slap !>(..ream) arvo-twig)
2017-04-17 03:12:12 +03:00
~& %compiled
::
:: events: list of events to feed our urbit
::
2017-04-18 04:52:05 +03:00
~& %loading
2017-04-17 03:12:12 +03:00
=+ events=main-events
2017-04-18 04:52:05 +03:00
~& [%loaded `@p`(mug events)]
2017-04-17 03:12:12 +03:00
::
:: execute events
::
=+ number=0
2017-04-18 04:52:05 +03:00
|- ^- *
?~ events arvo-kernel
~& number+number
2017-04-17 03:12:12 +03:00
%= $
2017-04-18 04:52:05 +03:00
events t.events
number +(number)
arvo-kernel .*(arvo-kernel(+< i.events) -.arvo-kernel)
2017-04-17 03:12:12 +03:00
==
::
++ main-events
2017-04-17 04:52:41 +03:00
=. now ~2017.3.1
2017-04-17 03:12:12 +03:00
=+ mov=main-moves
|- ^- (list (pair @da ovum))
?~ mov ~
:- [now i.mov]
$(mov t.mov, now (add now (bex 48)))
::
++ main-moves
^- (list ovum)
2017-04-17 04:52:41 +03:00
:~ [[%$ ~] [%what boot-files]]
2017-04-18 06:07:14 +03:00
:: [[%$ ~] [%whom ~zod]]
2017-04-17 03:12:12 +03:00
==
++ boot-files
2017-04-17 04:52:41 +03:00
^- (list (pair path (pair term noun)))
2017-04-17 03:12:12 +03:00
::
:: userspace:
::
:: /app %gall applications
:: /gen :dojo generators
:: /lib %ford libraries
:: /mar %ford marks
:: /sur %ford structures
:: /ren %ford renderers
:: /web %eyre web content
:: /sys system files
2017-04-18 06:07:14 +03:00
:: /neo new system files
2017-04-17 03:12:12 +03:00
::
2017-04-18 06:07:14 +03:00
(user-files /neo ~)
2017-04-17 03:12:12 +03:00
::
++ user-files :: userspace loading
|= :: sal: all spurs to load from
::
sal/(list spur)
^- (list (pair path (pair term noun)))
::
2019-01-18 08:37:34 +03:00
:: hav: all user files
::
2017-04-17 03:12:12 +03:00
=| hav/(list (pair path (pair term noun)))
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
::
2019-01-18 08:37:34 +03:00
:: tyl: spur
2017-04-17 03:12:12 +03:00
::
=/ tyl i.sal
|- ^+ hav
::
:: pax: full path at `tyl`
:: lon: directory at `tyl`
::
=/ pax (en-beam:format bec tyl)
=/ lon .^(arch %cy pax)
2019-01-18 08:37:34 +03:00
=? hav ?=(^ fil.lon)
2017-04-17 03:12:12 +03:00
::
:: install only hoon files for now
::
?. ?=({$hoon *} tyl) hav
2017-04-18 06:07:14 +03:00
:_(hav [(flop `path`t.tyl) [%hoon .^(@t %cx pax)]])
2017-04-17 03:12:12 +03:00
::
=/ all ~(tap by dir.lon)
2017-04-17 03:12:12 +03:00
|- ^+ hav
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
--