on master help sign in
cool
a75f8a7Robert
learn/hoon/hoon-tutorial/egg-timer.md+5−5
@@ -4,7 +4,7 @@ weight = 0
4template = "doc.html"
4template = "doc.html"
5+++
5+++
6
6
7−Arvo is divided up into parts called vanes. Gall is one of those vanes and it is the one responsible for providing an api for building stateful applications in Urbit. Gall is a complex system that takes a lot of getting used to so let's dip our toes in with a very simple app.
7+The Arvo operating system is divided up into modules called _vanes_. Gall is the vane responsible for providing an api for building stateful applications in Urbit. Gall is a complex system that takes a lot of getting used to so let's dip our toes in with a very simple app.
8
8
9
9
10```
10```
@@ -37,7 +37,7 @@ The first thing to notice is that we are creating a `core` and a `door`. This is
37
37
38The `core` here defines two types `effect` and `syscall`. An `effect` is a `pair` of `bone` and `syscall`. A `bone` is an opaque reference to a set of events. A `syscall` is a request to Arvo to do something for us. In this case the only valid `syscall` will be `%wait` which we'll discuss in a bit. It's important to note that the names `effect` and `syscall` are not important and you can call them whatever you would like. Commonly you will see them called `move` and `card` respectively but we've changed the names here to try to help provide some clarity over the older convention.
38The `core` here defines two types `effect` and `syscall`. An `effect` is a `pair` of `bone` and `syscall`. A `bone` is an opaque reference to a set of events. A `syscall` is a request to Arvo to do something for us. In this case the only valid `syscall` will be `%wait` which we'll discuss in a bit. It's important to note that the names `effect` and `syscall` are not important and you can call them whatever you would like. Commonly you will see them called `move` and `card` respectively but we've changed the names here to try to help provide some clarity over the older convention.
39
39
40−The sample of the `door` is
40+The sample of the `door` is
41
41
42```
42```
43[bowl:gall ~]
43[bowl:gall ~]
@@ -51,7 +51,7 @@ You can find the full definition of `bowl` in `sys/zuse.hoon` but for now it's e
51`eny` Entropy
51`eny` Entropy
52`now` The current time of the event
52`now` The current time of the event
53
53
54−The `door` we've made has two arms `poke-noun` and `wake`. Gall is capable of dispatching `pokes`, or requests, to an app based on the mark of the data given along with that poke. These are sent to the arm with the name that matches the mark of the data. Here we use the generic `noun` mark
54+The `door` we've made has two arms `poke-noun` and `wake`. Gall is capable of dispatching `pokes`, or requests, to an app based on the mark of the data given along with that poke. These are sent to the arm with the name that matches the mark of the data. Here we use the generic `noun` mark
55
55
56
56
57```
57```
@@ -73,7 +73,7 @@ We're going to create a gate that takes a single `@dr` argument. `@dr` is an aur
73
73
74As a mater of good type hygiene, we explicitly cast the output of this gate with `^+` to ensure we are producing the correct thing for gall to handle. `^+` is the rune for cast by example. Our example is a cell of `list` of `effect`, which we `bunt` with `*`, and `+>.$`, the enclosing core which is our `door`.
74As a mater of good type hygiene, we explicitly cast the output of this gate with `^+` to ensure we are producing the correct thing for gall to handle. `^+` is the rune for cast by example. Our example is a cell of `list` of `effect`, which we `bunt` with `*`, and `+>.$`, the enclosing core which is our `door`.
75
75
76−Next we're going to use the `:_` rune which is just the inverted form a `:-` the cell construction rune. We use it twice so the actual data will end up looking something like
76+Next we're going to use the `:_` rune which is just the inverted form a `:-` the cell construction rune. We use it twice so the actual data will end up looking something like
77
77
78```
78```
79[[[ost %wait /(scot %da now) (add now t)] ~] +>.$]
79[[[ost %wait /(scot %da now) (add now t)] ~] +>.$]
@@ -117,4 +117,4 @@ Next we have the same cast we used in `++poke-noun` to make sure we are producin
117
117
118`~&` is the debugging printf rune. Here we're simply going to output a message. We could however do any other computation here we wanted to happen when `++wait` gets called.
118`~&` is the debugging printf rune. Here we're simply going to output a message. We could however do any other computation here we wanted to happen when `++wait` gets called.
119
119
120−Finally we need to produce our `effect`, which here is simply `[~ +>.$]` since we have no `syscall` or `cards` we want to make and we are not changing the state of our app, we just use the `door` without changing it's sample.
120+Finally we need to produce our `effect`, which here is simply `[~ +>.$]` since we have no `syscall` or `cards` we want to make and we are not changing the state of our app, we just use the `door` without changing it's sample.