on master help sign in
Merge remote-tracking branch 'origin/cleanorg'
16b6b1eproduction server
docs.md+8−3
@@ -14,10 +14,15 @@ Go to the [technical overview](about/overview) for a high-level
14architecture description. To install and run Urbit, read forward from the
14architecture description. To install and run Urbit, read forward from the
15[installation guide](using/install).
15[installation guide](using/install).
16
16
17−Most programmers start by [learning Hoon](hoon). Some maniacs can skim the
17+To begin developing for Urbit, start by learning Hoon [syntax](hoon/syntax),
18−Hoon doc, then go straight to [Arvo systems programming](arvo). All
18+then walk through the [Arvo tutorials](arvo). The examples and exercises
19−registered aspies are required to start with [Nock](nock).
19+in Arvo will teach you to build high-level programs and interact with the network.
20
20
21+Dig into the mechanics of Urbit with [Core Hoon](hoon). Refer back
22+there for pure-code exercises and functions in the [standard library](hoon/library).
23+
24+Registered academics are required to start with the [Nock definition](nock/definition)
25+and work upward from there.
21<br/>
26<br/>
22<br/>
27<br/>
23
28
docs/arvo/basic.md+82−68
@@ -7,10 +7,10 @@ title: Hoon refresher / crash course
7
7
8# Basic Hoon
8# Basic Hoon
9
9
10−This recapitulates material you've already learned in Core Hoon.
10+This recapitulates material you've already learned in [Hoon](/docs/hoon/).
11It will be a very abrupt tutorial if you don't know Hoon already,
11It will be a very abrupt tutorial if you don't know Hoon already,
12but it may be enough in and of itself. If you don't find it obvious at first
12but it may be enough in and of itself. If you don't find it obvious at first
13−glance, read it over again.
13+glance, try working up from Hoon.
14
14
15Our goal is to get you programming interesting and useful things
15Our goal is to get you programming interesting and useful things
16as soon as possible. To get there, we have to quickly cover some
16as soon as possible. To get there, we have to quickly cover some
@@ -29,8 +29,8 @@ operation](/docs/user/basic) of your urbit.
29
29
30If you haven't copied in the examples repo, running the following commands from your urbit directory should do the trick:
30If you haven't copied in the examples repo, running the following commands from your urbit directory should do the trick:
31
31
32−`cp -r {wherever-you've-pulled-to}/examples/gall/*/ arvo/`
32+`$ cp -r {wherever-you've-pulled-to}/examples/gall/*/ arvo/`
33−`cp -r {wherever-you've-pulled-to}/examples/dojo/*/ arvo/`
33+`$ cp -r {wherever-you've-pulled-to}/examples/dojo/*/ arvo/`
34
34
35Run an example to ensure it worked:
35Run an example to ensure it worked:
36
36
@@ -115,10 +115,10 @@ more detail later.
115### How to form expressions
115### How to form expressions
116
116
117Hoon does not typically use reserved words to form expressions. Instead,
117Hoon does not typically use reserved words to form expressions. Instead,
118−expressions are formed with runes--diagraphs of two
118+expressions are formed with _runes_: digraphs of two
119−ascii symbols. Each rune takes a specific number of
119+ASCII symbols. Each rune takes a specific number of
120−children--either expressions formed by other runes or literals
120+children, either expressions formed by other runes or literals
121−that produce their own value (some runes take n children, and are usually closed with `==`).
121+that produce their own value (some runes take _N_ children, and are usually closed with `==`).
122
122
123For example, the rune `?:` from line 17 is the classic
123For example, the rune `?:` from line 17 is the classic
124'if-then-else' statement, and thus takes three children:
124'if-then-else' statement, and thus takes three children:
@@ -131,16 +131,16 @@ Since runes are such a fundamental structure in Hoon, we found
131ourselves speaking them out loud frequently. It quickly grew
131ourselves speaking them out loud frequently. It quickly grew
132cumbersome to have to say "question mark, colon" to describe
132cumbersome to have to say "question mark, colon" to describe
133`?:`. To alleviate this problem, we came up with our own naming
133`?:`. To alleviate this problem, we came up with our own naming
134−scheme: each ascii glyph has a single syllable pronunciation
134+scheme: each ASCII glyph has a single-syllable pronunciation
135phonetically designed to be both easily remembered and easily
135phonetically designed to be both easily remembered and easily
136pronounced in conjunction with the other glyphs (when forming a
136pronounced in conjunction with the other glyphs (when forming a
137rune).
137rune).
138
138
139−See the entire naming schema below/or link to it:
139+See the entire naming scheme below.
140
140
141```
141```
142 ace [1 space] gal < pel (
142 ace [1 space] gal < pel (
143− bar | gap [>1 space, nl] per )
143+ bar | gap [>1 space, \n] per )
144 bas \ gar > sel [
144 bas \ gar > sel [
145 buc $ hax # sem ;
145 buc $ hax # sem ;
146 cab _ hep - ser ]
146 cab _ hep - ser ]
@@ -152,9 +152,9 @@ See the entire naming schema below/or link to it:
152 fas / pat @ zap !
152 fas / pat @ zap !
153```
153```
154
154
155−Using our naming scheme `?:` is said 'wut col'.
155+Using this scheme, we would pronounce `?:` as 'wutcol'.
156
156
157−For those that would prefer to use reserved words to form expressions, you can substitute a rune's keyword--which you can find in `++twig` in `/arvo/hoon.hoon`--for the rune. For example, here's the code for `?:` in `++twig`:
157+For those who prefer to use reserved words to form expressions, you can substitute any rune with that rune's keyword, which you can find in `++twig` in `/arvo/hoon.hoon`. For example, here's the code for `?:` in `++twig`:
158
158
159`{$if p/twig q/twig r/twig} :: ?: if/then/else`
159`{$if p/twig q/twig r/twig} :: ?: if/then/else`
160
160
@@ -174,8 +174,8 @@ if(=(1 2) 'this is true' 'this is false')
174### Lines 12-34
174### Lines 12-34
175
175
176Now let's quickly walk through this code line-by-line. Lines
176Now let's quickly walk through this code line-by-line. Lines
177−12-34 are wrapped in a `|%` (pronounced 'bar cen'), which
177+12-34 are wrapped in a `|%` ('barcen'), which produces a core.
178−produces a core, a fundamental datatype in hoon similar to a
178+Cores are a fundamental datatype in Hoon, similar to a
179struct, class, or object. A core is just a map of names
179struct, class, or object. A core is just a map of names
180to any kind of code, whether it be functions or data. Each
180to any kind of code, whether it be functions or data. Each
181element in this map begins with a `++` followed by the name and
181element in this map begins with a `++` followed by the name and
@@ -183,8 +183,8 @@ the corresponding code. Since `|%` takes an arbitrary number of
183children, it needs to be closed with a `--`.
183children, it needs to be closed with a `--`.
184
184
185<blockquote class="blockquote">
185<blockquote class="blockquote">
186−`++` is not technically a rune, since it is only used in core
186+`++` ('luslus') is not technically a rune, since it is only used
187−syntax as shown above
187+in core syntax, as shown above.
188</blockquote>
188</blockquote>
189
189
190Let's step into each of the three arms within our core.
190Let's step into each of the three arms within our core.
@@ -196,16 +196,16 @@ Let's step into each of the three arms within our core.
196 (add (five a) (three a))
196 (add (five a) (three a))
197 --
197 --
198
198
199−`|=` produces a function, much like a lambda in lisp. It takes two children:
199+`|=` ('bartis') produces a function, much like a lambda in lisp. It takes two children:
200
200
201−- A set of argument(s). In this case our argument set only
201+1. A set of argument(s). In this case our argument set only
202− contains one: `a`, which is required to be an atom or natural
202+ contains one: `a`, which is required to be an atom or natural
203 number, denoted by `@`.
203 number, denoted by `@`.
204
204
205−- The body of the function itself, which is executed when the
205+1. The body of the function itself, which is executed when the
206 function is called (in this case, with `(sum 1.000)`). This
206 function is called (in this case, with `(sum 1.000)`). This
207 particular function adds the results of evaluating the gates `++
207 particular function adds the results of evaluating the gates `++
208− five` and `++three` with each of their respective input
208+ five` and `++three` with each of their respective input
209 parameters set to `a`.
209 parameters set to `a`.
210
210
211### ++ three
211### ++ three
@@ -222,20 +222,34 @@ As above, `++three` takes an integer argument, `a`, and then
222executes the remainder of the code with `a` set to the actual
222executes the remainder of the code with `a` set to the actual
223arguments.
223arguments.
224
224
225−Similarly, `=|` pushes its first child, `b` into our context (in
225+Similarly, `=|` ('tisbar') pushes its first child, `b` into our
226−other words, it declares a variable `b`) and executes the
226+context (in other words, it declares a variable `b`) and executes
227−remainder of the code. However, `b` is not an argument; `=|`
227+the remainder of the code. However, `b` is not an argument; `=|`
228sets `b` to the default value of whatever type it is declared as.
228sets `b` to the default value of whatever type it is declared as.
229Since the default value of an atom is `0`, b is set to `0`.
229Since the default value of an atom is `0`, b is set to `0`.
230
230
231+<blockquote class="blockquote">
232+To produce the default value of any given type, use `$*` ('buctar') followed by the type.
233+Alternatively, use the irregular form `*`.
234+
235+```
236+ > *@ :: produce the default value of atom @
237+ 0
238+
239+ > *@p :: produce the phonemic base of atom @
240+ ~zod
241+
242+```
243+</blockquote>
244+
231So now we have two variables: `a` is set to our input, and `b` is
245So now we have two variables: `a` is set to our input, and `b` is
232initialized to `0`.
246initialized to `0`.
233
247
234−The easiest way to think about `|-` that it lays down a recursion
248+One way to think about `|-` ('barhep') is that it lays down a recursion
235point. More on this later.
249point. More on this later.
236
250
237−`^-` is just a cast that sets the result of the remainder of the
251+`^-` ('kethep') is just a cast that sets the result of the remainder of
238−code to an unsigned integer, `@u`.
252+the code to an unsigned integer, `@u`.
239
253
240In pseudocode, the last three lines read like this: if `a` is
254In pseudocode, the last three lines read like this: if `a` is
241less than `b`, produce zero. Else, add `b` to the result of
255less than `b`, produce zero. Else, add `b` to the result of
@@ -250,73 +264,73 @@ you recurse by an actual function call, then you have to specify
250every argument.
264every argument.
251
265
252<blockquote class="blockquote">
266<blockquote class="blockquote">
253−If you're familiar with Clojure, `|-` is `loop` and `$()` is
267+If you're familiar with Clojure, `|-` is `loop` and `$()` is `recur`.
254−recur.
255</blockquote>
268</blockquote>
256
269
257**Exercises**:
270**Exercises**:
258
271
259−Please tweak your code to complete the following excercises.
272+Tweak your code to complete the following excercises.
260
273
261−There are a few runes and some syntaxes that we have yet to cover that
274+There are a few runes and some syntax that we have yet to cover that
262you will need to complete the excercises below. For these, please
275you will need to complete the excercises below. For these, please
263refer to our cheatsheat at the bottom.
276refer to our cheatsheat at the bottom.
264
277
265−- Read and understand `++five` line by line.
278+1. Read and understand `++five` line by line.
266
279
267−- Change `++sum` to accept two variables, `a` and `b`. Pass `a`
280+1. Change `++sum` to accept two variables, `a` and `b`. Pass `a`
268− to three and `b` to five. Then run the code with `a` set to
281+ to `three` and `b` to `five`. Then run the code with `a` set to
269− `1.000` and ` q` set to `2.000`.
282+ `1.000` and `q` set to `2.000`.
270
283
271−- Check if this new result is under one thousand. If it is,
284+1. Check if this new result is under one thousand. If it is,
272− return the string 'result is less than one thousand'. If not,
285+ return the string `'result < 1.000'`. If not,
273− return 'result is greater than or equal to one thousand'.
286+ return `'result >= 1.000'`.
274
287
275−```
276−Review
288+### Review
277
289
278−|% start core (collection of named ++ arms; an "object")
290+ |% ('barcen') start core (collection of named ++ arms; an "object")
279−|= define function
291+ |= ('bartis') define function
280−=| define variable from type with default value
292+ =| ('tisbar') define variable from type with default value
281−|- drop a recursion point
293+ |- ('barhep') drop a recursion point
282−^- cast
294+ ^- ('kethep') cast
283−?: if-then-else
295+ ?: ('wutcol') if-then-else
284−=(a b) test equality
296+ =(a b) test equality
285−(function args ...) call function
297+ (function args ...) call function with args
286
298
287−New material
299+### New material
288
300
289−- There are two syntaxes for writing Hoon: tall form and wide
301+1. There are two syntaxes for writing Hoon: tallform and wideform.
290− form.
291
302
292− In tall form, expressions are formed with either two spaces or
303+ In tallform, expressions are formed with either two spaces or
293 a line break separating both a rune from its children and each
304 a line break separating both a rune from its children and each
294− of its children from one another. We use tall form when writing
305+ of its children from one another. We use tallform when writing
295 multiline expressions.
306 multiline expressions.
296
307
297 For more concise expressions, we use wideform, which is always
308 For more concise expressions, we use wideform, which is always
298− a single line. Wideform can be used inside tall form
309+ a single line. Wideform can be used inside tallform
299 expressions, but not vice versa.
310 expressions, but not vice versa.
300
311
301− Wideform expressions are formed with a rune followed by ()
312+ Wideform expressions are formed with a rune followed by `()`
302 containing its children, all of which are separated by a
313 containing its children, all of which are separated by a
303− single space. For example to make a cell of two elements:
314+ single space. For example, to make a cell of two elements:
304
315
305− :-(a b)
316+ :-(a b)
306
317
307 We've already seen wideform in action, for example with
318 We've already seen wideform in action, for example with
308− =((mod b 3) 0). In this case = is actually an irregular form
319+ `=((mod b 3) 0)`. In this case, `=` is actually an irregular form
309− of .=, which tests its two children for equality.
320+ of `.=`, which tests its two children for equality.
310
321
311− Surrounding a function with () is an irregular wide form
322+ Surrounding a function with `()` is an irregular wide form
312− syntax for calling a function with n arguments. More on this later.
323+ syntax for calling a function with _N_ arguments. More on this later.
313
324
314−- :- makes a cell of values. The irregular wide form of this is
325+1. `:-` makes a cell of values. The irregular wide form of this is
326+ `[a b]`, with two expressions separated by a single space.
315− [a b], with two expressions separated by a single space. (While the regular form of this rune takes a fixed number of children--2--its irregular wide form can accept n expressions:[a1..an])
327+ While the regular form of this rune takes a fixed number of
328+ children (two), its irregular wide form can accept _N_ expressions:
329+ `[a1..an]`
316
330
317−- Cords are one datatype for text in hoon. They're just a big
331+2. Cords are one datatype for text in Hoon. They're just a big
318 atom formed from adjacent unicode bytes -- a "c string". To
332 atom formed from adjacent unicode bytes -- a "c string". To
319− produce a cord enclose text within single quotes. To set the type
333+ produce a cord, enclose text within single quotes. To set the type
320− of an argument to a cord, use @t.
334+ of an argument to a cord, use `@t`.
335+
321
336
322−```
docs/using/admin.md+2−2
@@ -23,11 +23,11 @@ You can turn your Urbit off with `^D` from the `:talk` or `:dojo` prompts.
23
23
24To restart your Urbit simply pass the name of your pier:
24To restart your Urbit simply pass the name of your pier:
25
25
26− bin/urbit some-planet
26+ $ bin/urbit some-planet
27
27
28or
28or
29
29
30− bin/urbit comet
30+ $ bin/urbit comet
31
31
32## Console
32## Console
33
33
docs/using/setup.md+29−20
@@ -7,35 +7,38 @@ title: Setup
7
7
8# Getting started
8# Getting started
9
9
10−<div class="row">
11−<div class="col-md-8">
12−
13−On disk your Urbit is an append-only log and a checkpoint. Or, in simpler terms, a directory where we keep all of your Urbit’s state. We call this a ‘pier’.
10+On disk your urbit is an append-only log and a checkpoint. Or, in simpler terms, a directory where we keep your urbit’s state. We call this a ‘pier’.
14−
15−</div>
16−</div>
17
11
18## Initialize
12## Initialize
19
13
20−When you first start an Urbit we create this pier directory and write to it.
14+To create an urbit, we need an identity, called a "ship." A ship
15+is both a network address and a memorable name.
16+
17+You are probably creating one of two kinds of ship, a 32-bit
18+"planet" or a 128-bit "comet."
21
19
20+If you have an Urbit invitation, you'll have a planet like
22−To start with a planet (`~fintud-macrep`) and ticket (`~fortyv-tombyt-tabsen-sonres`):
21+`~fintud-macrep` and `~fortyv-tombyt-tabsen-sonres`. To create
22+your pier:
23
23
24− bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
24+ $ bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
25
25
26−This will create a directory `fintud-macrep/` and begin the initialization process for that planet. Be patient, it can take a few minutes.
26+This will create a directory `fintud-macrep/` and begin building
27+your urbit. This may take a few minutes.
27
28
28−Without a planet anyone can create a comet:
29+If you do not have a ticket, you can still make a 'comet', a wild
30+urbit drifting through cyberspace. Pick your own directory name,
31+it doesn't matter:
29
32
30− bin/urbit -c comet
33+ $ bin/urbit -c mycomet
31
34
32−This will create a directory `comet/` and start up a random 128-bit comet. You can specify any name you like.
35+This will create the directory `mycomet/` and generate a 128-bit identity for your urbit.
33
36
34## Orientation
37## Orientation
35
38
36−When your Urbit is finished booting you should see a `dojo>` prompt. Welcome!
39+When your urbit is finished booting you should see a `dojo>` prompt. Welcome!
37
40
38−By default your Urbit is quite bare bones. Let's take a very short stroll through what's running by default:
41+By default your urbit is quite bare-bones. Let's stroll through what's already running:
39
42
40### Shell — `:dojo`
43### Shell — `:dojo`
41
44
@@ -52,11 +55,13 @@ Good.
52
55
53### Messaging — `:talk`
56### Messaging — `:talk`
54
57
55−Use `^X` to change your prompt. Let's join the main Urbit chat channel:
58+Use `^X` (ctrl-x) to change your prompt. Let's join the main Urbit chat channel:
56
59
57 ~fitund-macrep:talk() ;join ~doznec/urbit-meta
60 ~fitund-macrep:talk() ;join ~doznec/urbit-meta
58
61
62+`:talk` is stateful, so your urbit will download a backlog.
59−This may take a bit as `:talk` is stateful so your Urbit will download some backlog. `/urbit-meta` is the place to ask questions, get help and talk about anything Urbit related.
63+`/urbit-meta` is the place to ask questions, get help and talk
64+about anything Urbit-related.
60
65
61### Web — `:tree`
66### Web — `:tree`
62
67
@@ -64,7 +69,11 @@ Urbit is also accessible through the web. Try opening:
64
69
65 http://localhost:8080/
70 http://localhost:8080/
66
71
72+in your favorite browser. You'll be prompted to use `+code`.
73+This page was generated by `:tree`, the basic Urbit web
74+interface. You can also access your urbit through
67−in your favorite browser. You'll be prompted to use `+code`. This page was generated by `:tree`, the basic Urbit web interface. You can also access your Urbit through `http://fintud-macrep.urbit.org` (where `fintud-macrep` is your planet name).
75+`http://fintud-macrep.urbit.org` (where `fintud-macrep` is your
76+planet name).
68
77
69### Filesystem — `%clay`
78### Filesystem — `%clay`
70
79
@@ -79,7 +88,7 @@ This should produce:
79
88
80which indicates the command was processed.
89which indicates the command was processed.
81
90
82−`|mount %` will cause a `home/` directory to appear inside your pier folder. Changes to these files are automatically synced into your Urbit.
91+`|mount %` will cause a `home/` directory to appear inside your pier folder. Changes to these files are automatically synced into your urbit.
83
92
84## Learn more
93## Learn more
85
94
docs/using/web.md+6−2
@@ -26,7 +26,7 @@ We ship `tree` as compiled JavaScript on your Urbit, but the source lives in its
26Your Urbit runs a web server and can be found at either `http://localhost:8080/` (or `8081` if you're running other processes that might be occupying `8080`, you can determine which port your urbit is on by looking at your boot sequence — it's specified there), or `http://your-urbit.urbit.org/`.
26Your Urbit runs a web server and can be found at either `http://localhost:8080/` (or `8081` if you're running other processes that might be occupying `8080`, you can determine which port your urbit is on by looking at your boot sequence — it's specified there), or `http://your-urbit.urbit.org/`.
27
27
28(Make sure you have a desk mounted to unix, as covered in the
28(Make sure you have a desk mounted to unix, as covered in the
29−[filesystem walkthrough](/docs/using/filesystem))
29+[filesystem walkthrough](/docs/using/filesystem)).
30
30
31To switch the desk you're serving from:
31To switch the desk you're serving from:
32
32
@@ -38,7 +38,7 @@ To host a file on the web try putting the following in `/home/web/test.md` (from
38
38
39 This is a simple markdown file.
39 This is a simple markdown file.
40
40
41−Create a folder with two more markdown files in it and copy it to `/home/web/test/`. (In urbit, there is no distinction between a director and a file--in this case `test` is both a file and a directory. So, if you're adding files directly from unix, simply `mkdir test` and urbit will treat the file and directory as the same entity.)
41+Create the directory `/home/web/test/` and add two more markdown files in it.
42
42
43Now modify `/home/web/test.md` to list the children using the `<list/>` JSX:
43Now modify `/home/web/test.md` to list the children using the `<list/>` JSX:
44
44
@@ -56,6 +56,10 @@ To view your file as raw `html`:
56
56
57 http://localhost:8080/test.html
57 http://localhost:8080/test.html
58
58
59+You may have noticed that we just created both `test.md` and `test/`. In Urbit, there is no distinction between a directory and a file. So, if you're adding files directly from unix, simply `mkdir test` and Urbit will treat the file and directory as the same entity.
60+
61+You can use this feature to change your homepage at `your-urbit.urbit.org` with the page `/home/web.md`, where `home` is the current mounted desk. By default, `web.md` will display some info about your urbit, but you can customize it to your heart's content.
62+
59## Examples
63## Examples
60
64
61We've created a few simple examples of how to get set up publishing content from your Urbit. Feel free to ask questions in the comments.
65We've created a few simple examples of how to get set up publishing content from your Urbit. Feel free to ask questions in the comments.