urbit/gen/solid.hoon

88 lines
2.2 KiB
Plaintext
Raw Normal View History

:: Compile arvo as a pill noun, without compiler changes.
:: usage
::
:: .urbit/pill +solid
2015-06-18 04:08:47 +03:00
::
2016-02-11 03:41:28 +03:00
:::: /hoon/solid/gen
2015-06-18 04:08:47 +03:00
::
/? 310
/+ pill
2015-06-18 04:08:47 +03:00
::
::::
!:
2015-09-12 03:24:51 +03:00
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
arg=$@(~ [top=path ~])
dub=_|
2015-06-18 04:08:47 +03:00
==
2017-12-07 04:53:17 +03:00
:- %noun
:: sys: root path to boot system, `/~me/[desk]/now/sys`
::
=/ sys=path
?^ arg top.arg
/(scot %p p.bec)/[q.bec]/(scot %da now)/sys
::
=/ compiler-path (weld sys /hoon)
=/ arvo-path (weld sys /arvo)
2015-06-18 04:08:47 +03:00
~& %solid-start
=/ compiler-src .^(@t %cx (weld compiler-path /hoon))
=/ arvo-src .^(@t %cx (weld arvo-path /hoon))
=/ arvo-formula
~& %solid-loaded
=/ compiler-hoon (rain compiler-path compiler-src)
?. dub
:: compile arvo against hoon, with our current compiler
::
=/ whole-hoon=hoon
[%tsbn compiler-hoon [%tsbn [%$ 7] (rain arvo-path arvo-src)]]
~& %solid-parsed
=/ whole-formula q:(~(mint ut %noun) %noun whole-hoon)
~& %solid-arvo
whole-formula
:: compile arvo against hoon, with a freshly compiled hoon (via +ride)
::
~& %solid-parsed
=/ compiler-formula q:(~(mint ut %noun) %noun compiler-hoon)
~& %solid-compiled
=/ whole-src
(rap 3 ['=> ' compiler-src '=> +7 ' arvo-src ~])
~& %solid-double-loaded
=/ whole-formula
=< +
.* 0
:+ %7
compiler-formula
[%9 2 %10 [6 %1 %noun whole-src] [%0 1]]
~& %solid-double-compiled
whole-formula
2017-12-07 04:51:26 +03:00
::
~& [%solid-kernel `@ux`(mug arvo-formula)]
::
:: installed: Arvo gate (formal interface) with %zuse and vanes installed
::
=/ installed
=< q
%^ spin
(module-ova:pill sys)
.*(0 arvo-formula)
|= [ovo=ovum ken=*]
[~ .*(ken [%9 2 %10 [6 %1 now ovo] %0 1])]
::
:: our boot-ova is a list containing one massive formula:
::
:: We evaluate :arvo-formula (for jet registration),
:: then ignore the result and produces :installed
::
=/ boot-ova=(list)
[[%7 arvo-formula %1 installed] ~]
::
:: a pill is a 3-tuple of event-lists: [boot kernel userspace]
::
:: Our kernel event-list is ~, as we've already installed them.
:: Our userspace event-list is a list containing a full %clay
:: filesystem sync event.
::
:+ boot-ova ~
=/ bas (flop (tail (flop sys)))
[(file-ovum:pill bas) ~]