on master help sign in
various fixes to runes and other pages
commit5a942e0fc545c2f3bfdd14ac662b28f8273c55fd authorjoshuareagan <joshuareagan@gmail.com> dateWed 10 Oct 2018, 18:15 (8 years ago) parentb63272f
6 files changed+10−11
docs/about/overview.udon+2−3 docs/tutorials/hoon-ch1/hoon-ch1-4.udon+2−2 docs/tutorials/hoon-ch1/hoon-ch1-6.udon+1−1 docs/tutorials/hoon-ch2/hoon-ch2-10.udon+1−1 docs/tutorials/hoon-ch2/hoon-ch2-7.udon+1−1 docs/tutorials/hoon-ch2/hoon-ch2-8.udon+3−3
docs/about/overview.udon+2−3
@@ -18,8 +18,7 @@ The current Urbit stack includes (among other things):
1818- Arvo: the functional operating system of each urbit, written in Hoon.
1919- Hoon: a strictly typed functional programming language whose standard library
2020 includes a Hoon-to-Nock compiler.
21−- Nock: a low-level combinator language whose formal specification gzips to 340
22− bytes.
21+- Nock: a low-level combinator language whose formal specification fits readably on a t-shirt.
2322- Vere: a Nock interpreter and Unix-based virtual machine that mediates between
2423 each urbit and the Unix software layer.
2524
@@ -58,7 +57,7 @@ there is a risk of losing functional purity; your urbit cannot _guarantee_ that
5857the side effects in question actually occur. What's the solution?
5958
6059Each urbit is
61−[sandboxed](https://en.wikipedia.org/wiki/Sandbox_(computer_security)) in a
60+[sandboxed](https://en.wikipedia.org/wiki/Sandbox_(computer_security%29) in a
6261virtual machine, Vere, which runs on Unix. Code running in your urbit cannot
6362make Unix system calls or otherwise directly affect the underlying platform.
6463Strictly speaking, internal urbit code can only change internal urbit state; it
docs/tutorials/hoon-ch1/hoon-ch1-4.udon+2−2
@@ -28,7 +28,7 @@ Nock is a [low-level](https://en.wikipedia.org/wiki/Low-level_programming_langua
2828
2929### What is a Function?
3030
31−The word 'function' is used in various ways in other programming languages, but we mean it in basically its [mathematical sense](https://en.wikipedia.org/wiki/Function_(mathematics)). Roughly put, a function takes one or more arguments (i.e., input values) and returns a value. What the return value is depends solely on the argument(s), and nothing else. For example, we can understand multiplication as a function: it takes two numbers and returns another number. It doesn't matter where you ask, when you ask, or what kind of hat you're wearing when you ask. If you pass the same two numbers (e.g., `3` and `4`), you get the same answer returned every time (`12`).
31+The word 'function' is used in various ways in other programming languages, but we mean it in basically its [mathematical sense](https://en.wikipedia.org/wiki/Function_(mathematics%29). Roughly put, a function takes one or more arguments (i.e., input values) and returns a value. What the return value is depends solely on the argument(s), and nothing else. For example, we can understand multiplication as a function: it takes two numbers and returns another number. It doesn't matter where you ask, when you ask, or what kind of hat you're wearing when you ask. If you pass the same two numbers (e.g., `3` and `4`), you get the same answer returned every time (`12`).
3232
3333### The Nock Function
3434
@@ -45,7 +45,7 @@ Here's an example of some Nock run in the dojo, using `.*( )`:
4545
4646In this example `[15 17]` is the subject, `[[4 0 2] [0 3]]` is the formula, and `[16 17]` is the product.
4747
48−This tutorial series is designed to teach you Hoon. For that purpose it's not important that you know how to read and understand Nock formulas; you just need to know that Nock takes a subject and a formula and returns a product. (Those who who want to learn more about Nock should head over to the [Nock tutorial]([Nock spec](../../nock)).)
48+This tutorial series is designed to teach you Hoon. For that purpose it's not important that you know how to read and understand Nock formulas; you just need to know that Nock takes a subject and a formula and returns a product. (Those who who want to learn more about Nock should head over to the [Nock tutorial](../../nock).)
4949
5050### Nock Formulas Define Functions
5151
docs/tutorials/hoon-ch1/hoon-ch1-6.udon+1−1
@@ -54,7 +54,7 @@ The second way of making a function call involves an expression that _produces_
5454246
5555```
5656
57−Pop quiz: Are calls to `add` and `mul` of the Hoon standard library of the first kind, or the second?
57+Are calls to `add` and `mul` of the Hoon standard library of the first kind, or the second?
5858
5959```
6060> (add 12 23)
docs/tutorials/hoon-ch2/hoon-ch2-10.udon+1−1
@@ -198,7 +198,7 @@ There are other set functions in the Hoon standard library we won't cover here.
198198
199199### Cartesian Product
200200
201−Here's a program that takes two sets of atoms and returns the Cartesian product of those sets. A Cartesian of two sets `a` and `b` is a set of all the cells whose head is a member of `a` and whose tail is a member of `b`.
201+Here's a program that takes two sets of atoms and returns the Cartesian product of those sets. A Cartesian product of two sets `a` and `b` is a set of all the cells whose head is a member of `a` and whose tail is a member of `b`.
202202
203203```
204204|= [a=(set @) b=(set @)]
docs/tutorials/hoon-ch2/hoon-ch2-7.udon+1−1
@@ -349,7 +349,7 @@ To use a door as a state machine, put the door in the subject and modify that do
3493490
350350```
351351
352−As you can see, you never actually 'change' the `num` core literally; you actually product a variant of that core and set that as the new value of `num`. You can see the sample value of `num` using `a.num`.
352+As you can see, you never actually 'change' the `num` core literally; you actually produce a variant of that core and set that as the new value of `num`. You can see the sample value of `num` using `a.num`.
353353
354354Let's do the same sort of thing in a generator. Save the following as `numcore.hoon` in the `/gen` directory of your urbit's pier:
355355
docs/tutorials/hoon-ch2/hoon-ch2-8.udon+3−3
@@ -99,7 +99,7 @@ You'll notice that the `plus` arm of the `num` core above evaluates to a gate.
9999 [(add a b) this(a (add a b))]
100100```
101101
102−But this gate doesn't have a cast in it, and that's bad practice. Any time you produce a gate you should include a cast for the desired output type. The desired output of the `plus` gate is a cell whose head is an atom and whose tail is a core of the same type as `num`. The head is easy to case for using `@`, but what about the tail? How do we cast for a core of the same type as `num`?
102+But this gate doesn't have a cast in it, and that's bad practice. Any time you produce a gate you should include a cast for the desired output type. The desired output of the `plus` gate is a cell whose head is an atom and whose tail is a core of the same type as `num`. We know how to cast for the head -- it's just an atom, `@`. But what about the tail? How do we cast for a core of the same type as `num`?
103103
104104There is no straight-forward way of casting for a core in general, and anyway that isn't what is desired in this case. We don't want `plus` to produce just any core; we want it to produce a core of the same type as `num`.
105105
@@ -136,7 +136,7 @@ The irregular form of `$_( )` is just `_`, so we can shorten the cast above to:
136136 [(add a b) this(a (add a b))]
137137```
138138
139−This kind of casting is relatively common. It's generally used in gates of doors used as state machines.
139+This kind of casting is relatively common. It's generally used in cores used as state machines.
140140
141141#### The `_+>.$` Construction
142142
@@ -628,7 +628,7 @@ With this version of the program, you get a different sorted deck of cards each
628628
629629### Dealing Cards with a State Machine
630630
631−Let's use a door as a state machine. The state will have two parts: (1) a deck of cards, and (2) `rng` a copy of the `og` core with a seed value. Instead of having functions that produce a sorted deck of cards or a shuffled deck of cards, let's have the arms of this door compute a new version of the state machine with an appropriately modified state.
631+Let's use a door as a state machine. The state will have two parts: (1) `deck`, a deck of cards, and (2) `rng`, a copy of the `og` core with a seed value. Instead of having functions that produce a sorted deck of cards or a shuffled deck of cards, let's have the arms of this door compute a new version of the state machine with an appropriately modified state.
632632
633633We'll use this state machine in a program that deals `a` hands of `b` cards each:
634634