on master help sign in
Various cleanups.
commita602330d3273c62a56d2a4ef847352c9bbba720d authorC. Guy Yarvin <cgyarvin@gmail.com> dateMon 25 Apr 2016, 14:26 (11 years ago) parentebb9716
47 files changed+92−109
docs/hoon/basic.md+16−20 docs/hoon/syntax.md+1−1 docs/hoon/twig/atom.md+1−1 docs/hoon/twig/atom/knit.md+1−1 docs/hoon/twig/atom/rock.md+1−1 docs/hoon/twig/atom/sand.md+2−2 docs/hoon/twig/bar-core.md+2−2 docs/hoon/twig/bar-core/cab-door.md+1 docs/hoon/twig/bar-core/cen-core.md+1 docs/hoon/twig/bar-core/dot-trap.md+1 docs/hoon/twig/bar-core/hep-loop.md+1 docs/hoon/twig/bar-core/tis-gate.md+1 docs/hoon/twig/buc-mold.md+2−2 docs/hoon/twig/buc-mold/base.md+2−2 docs/hoon/twig/buc-mold/cen-book.md+1−1 docs/hoon/twig/buc-mold/col-bank.md+1−1 docs/hoon/twig/buc-mold/hep-lamb.md+2−2 docs/hoon/twig/buc-mold/ket-bush.md+1−1 docs/hoon/twig/buc-mold/pat-claw.md+2−2 docs/hoon/twig/buc-mold/tis-coat.md+1−1 docs/hoon/twig/buc-mold/wut-pick.md+2−2 docs/hoon/twig/cen-call.md+6−8 docs/hoon/twig/cen-call/cab-keep.md+1 docs/hoon/twig/cen-call/sig-open.md+1−1 docs/hoon/twig/col-cell.md+1−1 docs/hoon/twig/col-cell/ket-conq.md+1−1 docs/hoon/twig/dot-nock.md+3−5 docs/hoon/twig/ket-cast.md+3−5 docs/hoon/twig/ket-cast/bar-iron.md+1−1 docs/hoon/twig/ket-cast/lus-like.md+1−1 docs/hoon/twig/ket-cast/sig-burn.md+1−1 docs/hoon/twig/ket-cast/wut-lead.md+1−1 docs/hoon/twig/limb.md−1 docs/hoon/twig/limb/limb.md+1−1 docs/hoon/twig/limb/wing.md+1−2 docs/hoon/twig/sem-make.md+3−5 docs/hoon/twig/sig-hint.md+3−5 docs/hoon/twig/sig-hint/fas-funk.md+2−1 docs/hoon/twig/tis-flow.md+3−5 docs/hoon/twig/tis-flow/lus-pin.md+1−1 docs/hoon/twig/wut-test.md+2−5 docs/hoon/twig/wut-test/gar-sure.md+1−1 docs/hoon/twig/wut-test/hep-case.md+1−1 docs/hoon/twig/wut-test/pam-and.md+1−1 docs/hoon/twig/wut-test/tis-fits.md+1−1 docs/hoon/twig/zap-wild.md+3−5 docs/using/install.md+6−7
docs/hoon/basic.md+16−20
@@ -10,11 +10,11 @@ A `span` is a set of nouns and an interpretation of these nouns.
1010Officially, we don't use the word "type" in Hoon. But if we had
1111to say "type," it would mean `span`.
1212
13−## Span and mold
13+## Type, span and mold
1414
1515There is no Hoon syntax for a span. The programmer never defines
1616a span explicitly. It is always produced as the inferred range
17−of an expression (twig).
17+of an expression (`twig`).
1818
1919But we still need simple, well-formed expressions that produce
2020regular and well-shaped ranges, for three reasons.
@@ -37,15 +37,13 @@ definition of a noun. Don't actually call a mold unless you're
3737actually validating untrusted foreign data. As a beginner,
3838hopefully you aren't!
3939
40−## The `span` mold (simplified)
40+## `span`: a set of nouns
4141
42−Usually in Hoon we define the semantics of a primitive by the
43−state the span of all nouns that implement that primitive. We
44−state this span as the icon of a mold. That mold is produced by
45−a kernel arm `span`:
42+Below is the mold for `span`. You haven't seen this syntax before,
43+and we haven't explained it yet; just treat it as pseudocode.
4644
47−This is a slightly simplified version of `span`. We'll undo and
48−explain the simplifications below.
45+This is a slightly simplified version of `span`. We undo and explain the
46+simplifications in the [advanced types](../advanced) section.
4947
5048```
5149++ term @tas
@@ -61,13 +59,11 @@ explain the simplifications below.
6159 ==
6260```
6361
64−This is a syntactically correct Hoon twig, but treat it as
65−pseudocode. If a span is an atom, it's either the atomic string
66−`noun` or `void`; if a cell, it's a tuple with one of the heads
67−`atom`, `cell`, `core`, etc. We'll go through each of these
68−cases below.
62+If a span is an atom, it's either the atomic string `noun` or
63+`void`; if a cell, it's a tuple with one of the heads `atom`,
64+`cell`, `core`, etc. We'll go through each of these cases below.
6965
70−### `$noun` and `$void`
66+### `?($noun $void)`
7167
7268`$noun` is the set of all nouns. `$void` is the set of no nouns.
7369
@@ -76,7 +72,7 @@ cases below.
7672`{$cell p/span q/span}` is the set of all cells with head `p` and
7773tail `q`.
7874
79−### `{$fork p/(set span)}
75+### `{$fork p/(set span)}`
8076
8177`{$fork p/(set span)}` is the union of all spans in the set `p`.
8278
@@ -89,17 +85,17 @@ the product when we compile `q` against subject `p`.
8985This is "manual laziness." Hoon is a strict language, so we have
9086to express
9187
92−### `{$face p/term q/span}
88+### `{$face p/term q/span}`
9389
9490A `{$face p/term q/span}` wraps the label `p` around the span
9591`q`. `p` is a `term` or `@tas`, an atomic ASCII string which
9692obeys symbol rules: lowercase and digit only, infix hyphen,
9793first character must be lowercase.
9894
99−See [`:limb`](twig/limb/limb) for how labels are resolved. It's
95+See [`:limb`](../twig/limb/limb) for how labels are resolved. It's
10096nontrivial.
10197
102−### `{%atom p/term q/(unit atom))}
98+### `{%atom p/term q/(unit atom))}`
10399
104100An `$atom` is an atom, with two twists. `q` is a `unit`, Hoon's
105101equivalent of a nullable pointer or a Haskell `Maybe`. If `q`
@@ -161,7 +157,7 @@ statically, by casting through the empty aura `@`. Hoon is not
161157dependently typed and can't statically enforce data constraints
162158(for example, it can't enforce that a `@tas` is really a symbol).
163159
164−### `{$core p/span q/(map term span)}
160+### `{$core p/span q/(map term span)}`
165161
166162A `$core` is a code-data cell. The data (or *payload*) is the
167163tail; the code (or *battery*) is the head. `p`, a span, is the
docs/hoon/syntax.md+1−1
@@ -9,7 +9,7 @@ title: Syntax
99Hoon's semantics are simple, but unusual. Hoon's syntax is
1010complex, and unusual. Sorry.
1111
12−## Motivation
12+# Motivation
1313
1414An excuse: the normal human brain doesn't have hardware support
1515for math, but it does have hardware support for syntax. Learning
docs/hoon/twig/atom.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 1
3−next: true
3+
44---
55
66# Atoms and strings
docs/hoon/twig/atom/knit.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 3
3−next: true
3+
44---
55
66# `:knit`
docs/hoon/twig/atom/rock.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 2
3−next: true
3+
44---
55
66# `:rock`
docs/hoon/twig/atom/sand.md+2−2
@@ -1,9 +1,9 @@
11---
22sort: 1
3−next: true
3+
44---
55
6−# `:sand``
6+# `:sand`
77
88`{$sand p/term q/@}`; a constant, warm atom.
99
docs/hoon/twig/bar-core.md+2−2
@@ -1,9 +1,9 @@
11---
22sort: 5
3−next: true
3+
44---
55
6−# Cores (`|` runes)
6+# Core, `|` ("bar")
77
88Core twigs are flow twigs. The compiler essentially pins a Nock
99formula, or battery of formulas, to the subject.
docs/hoon/twig/bar-core/cab-door.md+1
@@ -1,5 +1,6 @@
11---
22sort: 5
3+
34---
45
56# `:door |_ "buccab"`
docs/hoon/twig/bar-core/cen-core.md+1
@@ -1,5 +1,6 @@
11---
22sort: 1
3+
34---
45
56# `:core |% "barcen"`
docs/hoon/twig/bar-core/dot-trap.md+1
@@ -1,5 +1,6 @@
11---
22sort: 3
3+
34---
45
56# `:trap. |. "bardot"`
docs/hoon/twig/bar-core/hep-loop.md+1
@@ -1,5 +1,6 @@
11---
22sort: 4
3+
34---
45
56# `:loop |- "barhep"`
docs/hoon/twig/bar-core/tis-gate.md+1
@@ -1,5 +1,6 @@
11---
22sort: 2
3+
34---
45
56# `:gate |= "bartis"`
docs/hoon/twig/buc-mold.md+2−2
@@ -1,9 +1,9 @@
11---
22sort: 7
3−next: true
3+
44---
55
6−# Molds (`$` runes)
6+# Mold, `$` ("buc")
77
88A *mold* is a `gate` (function) that helps us build simple and
99rigorous data structures. (In fact, since "mold" sounds nasty,
docs/hoon/twig/buc-mold/base.md+2−2
@@ -1,11 +1,11 @@
11---
22sort: 1
3−next: true
3+
44---
55
66# `:base`
77
8−`{$base p/$@(?($noun $cell $bean $null) {$atom p/aura})}`: atom mold
8+`{$base p/$@(?($noun $cell $bean $null) {$atom p/aura})}`: trivial molds.
99
1010## Produces
1111
docs/hoon/twig/buc-mold/cen-book.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 4
3−next: true
3+
44---
55
66# `:book $% "buctis"`
docs/hoon/twig/buc-mold/col-bank.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 2
3−next: true
3+
44---
55
66# `:bank $: "buccol"`
docs/hoon/twig/buc-mold/hep-lamb.md+2−2
@@ -1,9 +1,9 @@
11---
22sort: 8
3−next: true
3+
44---
55
6−# `:lamb $-, "buchep"
6+# `:lamb $-, "buchep"`
77
88`{$lamb p/moss q/moss}`: mold which normalizes to an example gate.
99
docs/hoon/twig/buc-mold/ket-bush.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 6
3−next: true
3+
44---
55
66# `:bush $^ "bucket"`
docs/hoon/twig/buc-mold/pat-claw.md+2−2
@@ -1,9 +1,9 @@
11---
22sort: 5
3−next: true
3+
44---
55
6−# `:claw $@ "bucpat"
6+# `:claw $@ "bucpat"`
77
88`{$claw p/moss q/moss}`: mold which normalizes a union tagged by depth.
99
docs/hoon/twig/buc-mold/tis-coat.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 3
3−next: true
3+
44---
55
66# `:coat $= "buctis"`
docs/hoon/twig/buc-mold/wut-pick.md+2−2
@@ -1,9 +1,9 @@
11---
22sort: 7
3−next: true
3+
44---
55
6−# `:pick $? "bucwut"
6+# `:pick $? "bucwut"`
77
88`{$pick p/(list moss)}`: mold which normalizes a general union.
99
docs/hoon/twig/cen-call.md+6−8
@@ -1,16 +1,14 @@
11---
22sort: 6
3−next: true
3+
44---
55
6−# Make and call, `%`
6+# Call, `%` ("cen")
77
8−We've already covered the irregular-only twigs `$wing` and
9−`$limb`. These are simple forms of the *invocation* family of
10−twigs, `%`, whose general form is `$make`, `%=`.
8+We've already covered `$wing` and `$limb`. These are simple
9+forms of the *invocation* family of twigs, `%`, whose general
10+form is `$make`, `%=`.
1111
1212## Stems
1313
14−<list dataPreview="true" className="runes" linkToFragments="true"></list>
15−
16−<kids className="runes"></kids>
14+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/cen-call/cab-keep.md+1
@@ -1,5 +1,6 @@
11---
22sort: 2
3+
34---
45
56# `:keep %_ "cencab"`
docs/hoon/twig/cen-call/sig-open.md+1−1
@@ -2,7 +2,7 @@
22sort: 3
33---
44
5−# `:open %~ "censig"
5+# `:open %~ "censig"`
66
77`{$cnsg p/wing q/seed r/seed}`: call with multi-armed door.
88
docs/hoon/twig/col-cell.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 3
3−next: true
3+
44---
55
66# Cells, `:` ("col")
docs/hoon/twig/col-cell/ket-conq.md+1−1
@@ -2,7 +2,7 @@
22sort: 3
33---
44
5−# `:conq :^ "colket"
5+# `:conq :^ "colket"`
66
77`{$conq p/seed q/seed r/seed s/seed}`: construct a quadruple (4-tuple).
88
docs/hoon/twig/dot-nock.md+3−5
@@ -1,14 +1,12 @@
11---
22sort: 10
3−next: true
3+
44---
55
6−# Intrinsics (`.` runes)
6+# Nock, `.` (dot)
77
88Anything Nock can do, Hoon can do also.
99
1010## Twigs
1111
12−<list dataPreview="true" className="runes" linkToFragments="true"></list>
13−
14−<kids className="runes"></kids>
12+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/ket-cast.md+3−5
@@ -1,9 +1,9 @@
11---
22sort: 9
3−next: true
3+
44---
55
6−# Type manipulation (`^` runes)
6+# Cast, `^` ("ket")
77
88`$cast`, `$like`, and `$name` let us adjust spans without
99violating type constraints.
@@ -13,6 +13,4 @@ it never allows invalid nests, it sometimes rejects valid nests.
1313
1414## Twigs
1515
16−<list dataPreview="true" className="runes" linkToFragments="true"></list>
17−
18−<kids className="runes"></kids>
16+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/ket-cast/bar-iron.md+1−1
@@ -2,7 +2,7 @@
22sort: 5
33---
44
5−# `:iron ^| "ketbar"
5+# `:iron ^| "ketbar"`
66
77`{$iron p/seed}`: convert a gold core to an iron core (contravariant).
88
docs/hoon/twig/ket-cast/lus-like.md+1−1
@@ -2,7 +2,7 @@
22sort: 1
33---
44
5−# `:like ^+ "ketlus"
5+# `:like ^+ "ketlus"`
66
77`{$like p/seed q/seed}`: typecast by example (seed).
88
docs/hoon/twig/ket-cast/sig-burn.md+1−1
@@ -2,7 +2,7 @@
22sort: 6
33---
44
5−# `:burn ^~ "ketsig"
5+# `:burn ^~ "ketsig"`
66
77`{$burn p/seed}`: fold constant at compile time.
88
docs/hoon/twig/ket-cast/wut-lead.md+1−1
@@ -2,7 +2,7 @@
22sort: 4
33---
44
5−# `:lead ^? "ketwut"
5+# `:lead ^? "ketwut"`
66
77`{$lead p/seed}`: convert any core to a lead core (bivariant).
88
docs/hoon/twig/limb.md−1
@@ -1,6 +1,5 @@
11---
22sort: 2
3−next: true
43---
54
65# Limbs and wings
docs/hoon/twig/limb/limb.md+1−1
@@ -1,6 +1,6 @@
11---
22sort: 1
3−next: true
3+
44---
55
66# `:limb`
docs/hoon/twig/limb/wing.md+1−2
@@ -1,6 +1,5 @@
11---
22sort: 2
3−next: true
43---
54
65# `:wing`
@@ -25,7 +24,7 @@ Irregular: `a.b` finds limb `a` within limb `b` of the subject.
2524
2625It may be slightly hard to follow the formal definition above.
2726
28−Intuitively that Hoon wings are written in the opposite order
27+Intuitively, Hoon wings are written in the opposite order
2928from attribute dot-paths in most languages. Hoon `a.b.c` is Java
3029`c.b.a`; it means "a within b within c."
3130
docs/hoon/twig/sem-make.md+3−5
@@ -1,14 +1,12 @@
11---
22sort: 11
3−next: true
3+
44---
55
6−# Random macros (`;` runes)
6+# Make, `;` ("sem")
77
88Miscellaneous useful macros.
99
1010## Twigs
1111
12−<list dataPreview="true" className="runes" linkToFragments="true"></list>
13−
14−<kids className="runes"></kids>
12+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/sig-hint.md+3−5
@@ -1,15 +1,13 @@
11---
22sort: 12
3−next: true
3+
44---
55
6−# Hints (`~` runes)
6+# Hints, `~` ("sig")
77
88Twigs that use Nock `10` to pass non-semantic info to the
99interpreter.
1010
1111## Twigs
1212
13−<list dataPreview="true" className="runes" linkToFragments="true"></list>
14−
15−<kids className="runes"></kids>
13+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/sig-hint/fas-funk.md+2−1
@@ -1,7 +1,8 @@
11---
22sort: 1
3+---
34
4−# `:funk ~/ "sigfas"
5+# `:funk ~/ "sigfas"`
56
67`{$funk p/term q/seed}`: jet registration for gate with
78registered context.
docs/hoon/twig/tis-flow.md+3−5
@@ -1,9 +1,9 @@
11---
22sort: 4
3−next: true
3+
44---
55
6−# Subject flow (`=` runes)
6+# Flow, `=` ("tis")
77
88Flow twigs change the subject. (Or more precisely, a flow twig
99compiles at least one of its subtwigs with a different subject.)
@@ -30,6 +30,4 @@ There are many flow stems, all small variations on these three.
3030
3131## Twigs
3232
33−<list dataPreview="true" className="runes" linkToFragments="true"></list>
34−
35−<kids className="runes"></kids>
33+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/tis-flow/lus-pin.md+1−1
@@ -2,7 +2,7 @@
22sort: 3
33---
44
5−# `:pin =+ "tislus"
5+# `:pin =+ "tislus"`
66
77`{$pin p/seed q/seed}`: combine a new noun with the subject.
88
docs/hoon/twig/wut-test.md+2−5
@@ -1,9 +1,8 @@
11---
22sort: 8
3−next: true
43---
54
6−# Tests (`?` runes)
5+# Test, `?` ("wut")
76
87Hoon has the usual branches and logical tests. For pattern
98matching, it also has a `$fits` twig that tests whether a value
@@ -28,6 +27,4 @@ side is taken), it fails with an error.
2827
2928## Twigs
3029
31−<list dataPreview="true" className="runes" linkToFragments="true"></list>
32−
33−<kids className="runes"></kids>
30+<list dataPreview="true" className="runes"></list>
docs/hoon/twig/wut-test/gar-sure.md+1−1
@@ -2,7 +2,7 @@
22sort: 11
33---
44
5−# `:sure ?< "wutgar"
5+# `:sure ?< "wutgar"`
66
77`{$sure p/seed q/seed}`: positive assertion.
88
docs/hoon/twig/wut-test/hep-case.md+1−1
@@ -4,7 +4,7 @@ sort: 12
44
55# `:case ?- "wuthep"`
66
7−`{$case p/wing q/(list (pair moss seed))}` Switch against a
7+`{$case p/wing q/(list (pair moss seed))}`: switch against a
88union, with no default.
99
1010## Expands to
docs/hoon/twig/wut-test/pam-and.md+1−1
@@ -2,7 +2,7 @@
22sort: 8
33---
44
5−# `:and ?& "wutpam"
5+# `:and ?& "wutpam"`
66
77`{$and p/(list seed)}`: logical and.
88
docs/hoon/twig/wut-test/tis-fits.md+1−1
@@ -2,7 +2,7 @@
22sort: 6
33---
44
5−# `:fits ?= "wuttis"
5+# `:fits ?= "wuttis"`
66
77`{$fits p/moss q/wing}`: test pattern match.
88
docs/hoon/twig/zap-wild.md+3−5
@@ -1,12 +1,10 @@
11---
22sort: 13
3−next: true
3+
44---
55
6−# Special tools (`!` runes)
6+# Wild, `!` ("zap")
77
88## Twigs
99
10−<list dataPreview="true" className="runes" linkToFragments="true"></list>
11−
12−<kids className="runes"></kids>
10+<list dataPreview="true" className="runes"></list>
docs/using/install.md+6−7
@@ -7,13 +7,12 @@ navhome: /main
77
88# Install
99
10−<div class="row"><div class="col-md-8">
10+Urbit is designed to run on any Unix box with an internet connection. Debian
11+(jessie), OS X, FreeBSD and Fedora all work well.
1112
12−Urbit is designed to run on any Unix box with an internet connection. Debian, OS X, FreeBSD and Fedora all work well.
13−
14−Urbit is alpha software. It’s not yet completely stable, its crypto hasn’t been audited and there are plenty of rough edges. Urbit is lots of fun to play with, but not quite ready for your important or sensitive data. Just so you know what you're getting into.
15−
16−</div></div>
13+Urbit is alpha software. It’s not yet completely stable, its crypto hasn’t
14+been audited, and there are plenty of rough edges. Urbit is lots of fun to play
15+with, but not quite ready for your important or sensitive data.
1716
1817## Build from source
1918
@@ -80,4 +79,4 @@ Once your dependencies are installed the rest is easy:
8079 make
8180 curl -o urbit.pill https://bootstrap.urbit.org/latest.pill
8281
83−After running `make` your Urbit executable lives at `bin/urbit`. The `.pill` file is a compiled binary of Arvo that Urbit uses to bootstrap itself.
82+After running `make`, your Urbit executable lives at `bin/urbit`. The `.pill` file is a compiled binary of Arvo that Urbit uses to bootstrap itself.