on master help sign in
Merge pull request #370 from urbit/tutorial-next
1b77a69David Kerschner
introduction/arvo-vs-azimuth.udon+3−3
@@ -8,8 +8,8 @@
8
8
9The Arvo network is composed of virtual machines running our software stack. Using a blockchain for this kind of computing is impossible: there's far too much data involved in an operating system to run on top of a distributed consensus mechanism. And you don't want your private information on a public ledger. The Arvo network is not a blockchain.
9The Arvo network is composed of virtual machines running our software stack. Using a blockchain for this kind of computing is impossible: there's far too much data involved in an operating system to run on top of a distributed consensus mechanism. And you don't want your private information on a public ledger. The Arvo network is not a blockchain.
10
10
11−However, being a decentralized system, we need some way to cryptographically secure and authenticate your identity on the Arvo network. What keeps track of who owns any given identity? Well, simply matching something to an address is a small piece of computing, and a blockchain are wonderful for such a purpose. That's where the Azimuth comes in.
11+However, being a decentralized system, we need some way to cryptographically secure and authenticate your identity on the Arvo network. What keeps track of who owns any given identity? Well, simply matching something to an address is a small piece of computing, and a blockchain are wonderful for such a purpose. That's where the Azimuth comes in.
12
12
13−We chose to build Azimuth on the Ethereum blockchain because smart contracts are well-suited for the peculiarities of the identities. Urbit identities are owned by Ethereum addresses.
13+We chose to build Azimuth on the Ethereum blockchain because smart contracts are well-suited for the peculiarities of the identities. Urbit identities are owned by Ethereum addresses.
14
14
15−Azimuth and the Arvo network are parallel systems. Azimuth isn't necessarily Arvo-related; it can be used as a generalized identity system for other projects. Azimuth is the equivalent of a bank vault that stores the deed to your house. The Arvo network is the neighborhood that you live in.
15+Azimuth and the Arvo network are parallel systems. Azimuth isn't necessarily Arvo-related; it can be used as a generalized identity system for other projects. Azimuth is the equivalent of a bank vault that stores the deed to your house. The Arvo network is the neighborhood that you live in.
learn/arvo/hoon/arms-and-cores.udon+2
@@ -421,3 +421,5 @@ You can now unbind `c` in the dojo -- this will help to keep your dojo subject t
421> c
421> c
422-find.c
422-find.c
423```
423```
424+
425+### [Next Lesson: Gates](../gates)
learn/arvo/hoon/atoms-auras-and-simple-cell-types.udon+3
@@ -778,3 +778,6 @@ Hoon pretty-prints them the same way, but can we be sure that they are the same
778```
778```
779
779
780They are indeed the same.
780They are indeed the same.
781+
782+
783+### [Next Lesson: Type Checking and Type Inference](../type-checking-and-type-inference)
learn/arvo/hoon/cores-again.udon+4−2
@@ -1,12 +1,12 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'26'
4+ sort/'28'
5 title/'Cores Again'
5 title/'Cores Again'
6 ==
6 ==
7;>
7;>
8
8
9−# 2.6 Cores Again
9+# 2.8 Cores Again
10
10
11In the last lesson you learned a bit about how to use cores as state machines. In this lesson you'll expand on that knowledge, in particular by learning how to use the `=^` rune. At the end of the lesson you'll learn how to write a generator that shuffles a 52 card deck and deals hands from it.
11In the last lesson you learned a bit about how to use cores as state machines. In this lesson you'll expand on that knowledge, in particular by learning how to use the `=^` rune. At the end of the lesson you'll learn how to write a generator that shuffles a 52 card deck and deals hands from it.
12
12
@@ -798,3 +798,5 @@ Save this as `carddeal.hoon` in `/gen` of your urbit's pier and run in the dojo:
798```
798```
799
799
800You get a different set of hands each time you run the generator.
800You get a different set of hands each time you run the generator.
801+
802+### [Next Lesson: Lists](../lists)
learn/arvo/hoon/cores.udon+3−1
@@ -6,7 +6,7 @@
6 ==
6 ==
7;>
7;>
8
8
9−2.7 Cores
9+# 2.7 Cores
10
10
11You learned what a core is in previous lessons. After a brief review, let's talk about how to use cores effectively in Hoon programming.
11You learned what a core is in previous lessons. After a brief review, let's talk about how to use cores effectively in Hoon programming.
12
12
@@ -397,3 +397,5 @@ Now run it in the dojo:
397Each of the `=.` expressions 'modifies' `num` by replacing the old `num` core with a different version of it. In this program we 'modify' `num` four times.
397Each of the `=.` expressions 'modifies' `num` by replacing the old `num` core with a different version of it. In this program we 'modify' `num` four times.
398
398
399For more on how to use cores as state machines see the next lesson.
399For more on how to use cores as state machines see the next lesson.
400+
401+### [Next Lesson: Cores Again](../cores-again)
learn/arvo/hoon/examples.udon+2−2
@@ -1,12 +1,12 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'30'
4+ sort/'33'
5 title/'Examples'
5 title/'Examples'
6 ==
6 ==
7;>
7;>
8
8
9−# 2.10 Examples
9+# Examples
10
10
11Let's look at two more examples of Hoon code: the Sieve of Eratosthenes (a naive prime sieve) and a tic-tac-toe engine.
11Let's look at two more examples of Hoon code: the Sieve of Eratosthenes (a naive prime sieve) and a tic-tac-toe engine.
12
12
learn/arvo/hoon/gates.udon+2
@@ -275,3 +275,5 @@ Write a gate that takes an atom, `a=@`, and which returns double the value of `a
275> (double 25)
275> (double 25)
27650
27650
277```
277```
278+
279+### [Next Lesson: Multi-gate Cores and Doors](../multi-gate-cores-and-doors)
learn/arvo/hoon/getting-started.udon+2
@@ -112,3 +112,5 @@ You'll see:
112```
112```
113
113
114You asked dojo to evaluate `17` and it echoed the number back at you. This value is a 'noun'. But what is a noun? Move on to lesson 1.2 for the answer.
114You asked dojo to evaluate `17` and it echoed the number back at you. This value is a 'noun'. But what is a noun? Move on to lesson 1.2 for the answer.
115+
116+### [Next Lesson: Nouns](../nouns)
learn/arvo/hoon/hoon-programs.udon+3
@@ -162,3 +162,6 @@ If not, line 7 uses the rune `:-` to produce a cell. Why is the program produci
162The product of the `$( )` call on line 8 is another list. It essentially says that the value of `count` is to be replaced by `(add 1 count)`, and that the code starting at `|-` is to be run again.
162The product of the `$( )` call on line 8 is another list. It essentially says that the value of `count` is to be replaced by `(add 1 count)`, and that the code starting at `|-` is to be run again.
163
163
164And that's it!
164And that's it!
165+
166+
167+### [Next Lesson: Hoon Syntax](../hoon-syntax)
learn/arvo/hoon/hoon-syntax.udon+2
@@ -591,3 +591,5 @@ A language lends itself to *feature/label confusion* (FLC) when it's difficult t
591The worst-case result of FLC is "DSL cancer". Every source file with this malady is effectively written in its own domain-specific language (DSL). Learning to read such a file is like learning a language. One can also describe the result as "write-only code". User-level macros, operator overloading, and even excessive use of higher-order programming, can all lead quickly to the tragedy of write-only code.
591The worst-case result of FLC is "DSL cancer". Every source file with this malady is effectively written in its own domain-specific language (DSL). Learning to read such a file is like learning a language. One can also describe the result as "write-only code". User-level macros, operator overloading, and even excessive use of higher-order programming, can all lead quickly to the tragedy of write-only code.
592
592
593Hoon largely avoids FLC by its use of runes. Hoon has no user-level macros or operator overloading. It does support higher-order programming; write-only Hoon can certainly be (and has been) written. However, with a little discipline one can write Hoon without inventing a DSL.
593Hoon largely avoids FLC by its use of runes. Hoon has no user-level macros or operator overloading. It does support higher-order programming; write-only Hoon can certainly be (and has been) written. However, with a little discipline one can write Hoon without inventing a DSL.
594+
595+### [Next Lesson: Simple One-Gate Programs](../simple-one-gate-programs)
learn/arvo/hoon/lists.udon+4−2
@@ -1,12 +1,12 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'28'
4+ sort/'29'
5 title/'Standard Library: Lists'
5 title/'Standard Library: Lists'
6 ==
6 ==
7;>
7;>
8
8
9−# 2.8 Standard Library: Lists
9+# 2.9 Standard Library: Lists
10
10
11In this lesson we'll review what a list is and then cover many of the list-related functions in the Hoon standard library.
11In this lesson we'll review what a list is and then cover many of the list-related functions in the Hoon standard library.
12
12
@@ -387,3 +387,5 @@ Run in dojo:
387> +snag [2 ~[11 22 33 44]]
387> +snag [2 ~[11 22 33 44]]
38833
38833
389```
389```
390+
391+### [Next Lesson: Trees, Sets, and Maps](../trees-sets-and-maps)
learn/arvo/hoon/multi-gate-cores-and-doors.udon+1−1
@@ -504,4 +504,4 @@ It's better simply to use the `~(arm rs arg)` syntax to replace the value of the
504
504
505## Conclusion
505## Conclusion
506
506
507−You've now reached the end of Chapter 1 of the Hoon tutorial. Ideally you should have a fair understanding of the fundamental concepts of subject-oriented programming: limbs, legs, faces, wings, arms, cores, gates, and doors. If you can master these concepts you should have little or no trouble learning to write substantial Hoon programs. Continue to [Chapter 2](../hoon-ch2-1) to get started.
507+You've now reached the end of Chapter 1 of the Hoon tutorial. Ideally you should have a fair understanding of the fundamental concepts of subject-oriented programming: limbs, legs, faces, wings, arms, cores, gates, and doors. If you can master these concepts you should have little or no trouble learning to write substantial Hoon programs. Continue to [Chapter 2](../hoon-programs) to get started.
learn/arvo/hoon/nouns.udon+2
@@ -486,3 +486,5 @@ That's it for our basic introduction to nouns. Hit `ctrl-d` to exit your comet,
486+ +14
486+ +14
487+ +15
487+ +15
488+ +31
488+ +31
489+
490+### [Next Lesson: The Subject and Its Legs](../the-subject-and-its-legs)
learn/arvo/hoon/simple-one-gate-programs.udon+2
@@ -889,3 +889,5 @@ $(x (dec x), y (dec y))
889?: (gth (mul c 2) a) &
889?: (gth (mul c 2) a) &
890$(c +(c))
890$(c +(c))
891```
891```
892+
893+### [Next Lesson: Atoms, Auras, and Simple Cell Types](../atoms-auras-and-simple-cell-types)
learn/arvo/hoon/structures-and-complex-types.udon+5−3
@@ -1,12 +1,12 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'25'
4+ sort/'26'
5 title/'Structures and Complex Types'
5 title/'Structures and Complex Types'
6 ==
6 ==
7;>
7;>
8
8
9−# 2.5 Structures and Complex Types
9+# 2.6 Structures and Complex Types
10
10
11In this lesson we'll talk a little about how type expressions become structures, and how these structures manifest in different ways in different parts of your Hoon code. We'll also talk about how to create your own custom-defined complex types from simpler ones.
11In this lesson we'll talk a little about how type expressions become structures, and how these structures manifest in different ways in different parts of your Hoon code. We'll also talk about how to create your own custom-defined complex types from simpler ones.
12
12
@@ -355,4 +355,6 @@ Often `$@` is used to define a type with a null or trivial case for the `@` case
355
355
356Now the `~` value is included as a possible value for `user`.
356Now the `~` value is included as a possible value for `user`.
357
357
358−That's all we have to say about types in this chapter. More on types in Chapter 3.
358+That's all we have to say about types in this chapter. More on types in [Chapter 3](../type-polymorphism).
359+
360+### [Next Lesson: Cores](../cores)
learn/arvo/hoon/the-subject-and-its-legs.udon+2
@@ -656,3 +656,5 @@ You can also use more complex wings and modify their values as well:
656```
656```
657
657
658At this point you should have at least a rough idea of what the subject is, and a fair understanding of how to get legs of the subject using wings. But legs are only one kind of limb -- we'll talk about arms in the next lesson.
658At this point you should have at least a rough idea of what the subject is, and a fair understanding of how to get legs of the subject using wings. But legs are only one kind of limb -- we'll talk about arms in the next lesson.
659+
660+### [Next Lesson: Arms and Cores](../arms-and-cores)
learn/arvo/hoon/trees-sets-and-maps.udon+5−3
@@ -1,12 +1,12 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'29'
4+ sort/'30'
5 title/'Standard Library: Trees, Sets, and Maps'
5 title/'Standard Library: Trees, Sets, and Maps'
6 ==
6 ==
7;>
7;>
8
8
9−# 2.9 Hoon Standard Library: Trees, Sets, and Maps
9+# 2.10 Hoon Standard Library: Trees, Sets, and Maps
10
10
11Along with lists, the Hoon standard library also supports trees, sets, and maps as data structures. A Hoon `tree` is the data structure for a binary tree. A Hoon `set` is the data structure for a set of values. A Hoon `map` is the data structure for a set of `[key value]` pairs.
11Along with lists, the Hoon standard library also supports trees, sets, and maps as data structures. A Hoon `tree` is the data structure for a binary tree. A Hoon `set` is the data structure for a set of values. A Hoon `map` is the data structure for a set of `[key value]` pairs.
12
12
@@ -321,4 +321,6 @@ You can use `run` of `by` to apply a gate to each value in a map, producing a ma
321{[p=%three q=6] [p=%one q=2] [p=%two q=4]}
321{[p=%three q=6] [p=%one q=2] [p=%two q=4]}
322```
322```
323
323
324−There are other map functions in the Hoon standard library we won't cover here.
324+There are other map functions in the Hoon standard library that didn't cover here.
325+
326+### [Next Lesson: Type Polymorphism](../type-polymorphism)
learn/arvo/hoon/type-checking-and-type-inference.udon+4−2
@@ -1,12 +1,12 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'24'
4+ sort/'25'
5 title/'Type Checking and Type Inference'
5 title/'Type Checking and Type Inference'
6 ==
6 ==
7;>
7;>
8
8
9−# 2.4 Type Checking and Type Inference
9+# 2.5 Type Checking and Type Inference
10
10
11As the Hoon compiler compiles your Hoon code, it does a *type check* on certain expressions to make sure they are guaranteed to produce a value of the correct type. If it cannot be proved that the output value is correctly typed, the compile will fail with a `nest-fail` crash. In order to figure out what type of value is produced by a given expression, the compiler uses *type inference* on that code. In this lesson we'll cover various cases in which a type check is performed, and also how the compiler does type inference on an expression.
11As the Hoon compiler compiles your Hoon code, it does a *type check* on certain expressions to make sure they are guaranteed to produce a value of the correct type. If it cannot be proved that the output value is correctly typed, the compile will fail with a `nest-fail` crash. In order to figure out what type of value is produced by a given expression, the compiler uses *type inference* on that code. In this lesson we'll cover various cases in which a type check is performed, and also how the compiler does type inference on an expression.
12
12
@@ -708,3 +708,5 @@ $(a +.a, b +.b)
708 a t.a
708 a t.a
709==
709==
710```
710```
711+
712+### [Next Lesson: Structures and Complex Types](../structures-and-complex-types)