-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglass.hoon
131 lines (131 loc) · 2.91 KB
/
glass.hoon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
::
:::: /hoon/glass/gen
::
/? 310
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
*
==
=< [%noun ~]
=> |%
++ wasp :: arvo effect
$% {$wack p/@uvJ} :: add entropy
{$what p/(list (pair path (pair term noun)))} :: reset reptile
{$whom p/@p} :: id and boot
==
--
::
:: deterministic test
::
=. eny 0v0
::
:: build arvo with existing compiler
::
|^ ^- *
::
:: neo: root path to boot system, `/~me/[desk]/now/neo`
::
=+ neo=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/neo
::
:: arvo-source: hoon source file producing arvo kernel, `neo/arvo`
::
=+ arvo-source=.^(@t %cx (welp neo /arvo/hoon))
::
:: arvo-twig: parsed arvo source
::
~& [%parsing `@p`(mug arvo-source)]
=+ arvo-twig=(ream arvo-source)
~& %parsed
::
:: arvo-kernel: a living urbit
::
~& [%compiling `@p`(mug arvo-twig)]
=+ arvo-kernel=+:(slap !>(..ream) arvo-twig)
~& %compiled
::
:: events: list of events to feed our urbit
::
~& %loading
=+ events=main-events
~& [%loaded `@p`(mug events)]
::
:: execute events
::
=+ number=0
|- ^- *
?~ events arvo-kernel
~& number+number
%= $
events t.events
number +(number)
arvo-kernel .*(arvo-kernel(+< i.events) -.arvo-kernel)
==
::
++ main-events
=. now ~2017.3.1
=+ mov=main-moves
|- ^- (list (pair @da ovum))
?~ mov ~
:- [now i.mov]
$(mov t.mov, now (add now (bex 48)))
::
++ main-moves
^- (list ovum)
:~ [[%$ ~] [%what boot-files]]
:: [[%$ ~] [%whom ~zod]]
==
++ boot-files
^- (list (pair path (pair term noun)))
::
:: 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
:: /neo new system files
::
(user-files /neo ~)
::
++ user-files :: userspace loading
|= :: sal: all spurs to load from
::
sal/(list spur)
^- (list (pair path (pair term noun)))
::
:: hav: all user files
::
=| hav/(list (pair path (pair term noun)))
|- ^+ hav
?~ sal ~
=. hav $(sal t.sal)
::
:: tyl: spur
::
=/ tyl i.sal
|- ^+ hav
::
:: pax: full path at `tyl`
:: lon: directory at `tyl`
::
=/ pax (en-beam:format bec tyl)
=/ lon .^(arch %cy pax)
=? hav ?=(^ fil.lon)
::
:: install only hoon files for now
::
?. ?=({$hoon *} tyl) hav
:_(hav [(flop `path`t.tyl) [%hoon .^(@t %cx pax)]])
::
=/ all ~(tap by dir.lon)
|- ^+ hav
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
--