on master help sign in
Hoon reorg
176afe1joshuareagan
docs/tutorials/hoon-ch1.udondeleted−20
@@ -1,20 +0,0 @@
1−:- :~ navhome/'/docs/'
2− next/'true'
3− sort/'2'
4− title/'Hoon Chapter 1'
5− ==
6−;>
7−
8−# Chapter 1: Fundamental Concepts of Subject-oriented Programming
9−
10−> Last major revision of this tutorial: September 2018
11−
12−Hoon is a high-level, statically typed, functional programming language, custom-designed for use with Urbit. For a functional language it has a surprisingly imperative style, and mastering it doesn't require knowing any advanced mathematics.
13−
14−Hoon is an unusual language in several respects, both in syntax and semantics. It uses runes (i.e., ASCII digraphs) in place of keywords, and the spacing rules are a bit strict. A great deal can be expressed in few lines, though excessively compressed code tends to be hard to read. Hoon has surprisingly simple semantics, but mastering it requires learning concepts that don't have close analogues in other languages.
15−
16−This multi-chapter tutorial series is designed to teach you Hoon without assuming you have an extensive programming background. In fact, you should be able to follow much of it even if you have no programming experience at all, though of course experience helps. We strongly encourage you to try out all the examples of each lesson. These lessons are meant for the beginner but they aren't meant to be skimmed.
17−
18−Chapter 1 introduces and explains the fundamental concepts you need in order to understand Hoon's semantics. Hoon is a 'subject-oriented' programming language -- every expression of Hoon is evaluated relative to a *subject*. The subject is a piece of data that represents the environment, or the context, of an expression. After reading Chapter 1 you should understand what the subject is, how to refer to its various parts, and how to carry out function calls using code in the subject. You'll also be able to write your own functions in Hoon, albeit only very simple ones.
19−
20−;list;
docs/tutorials/hoon-ch2.udondeleted−16
@@ -1,16 +0,0 @@
1−:- :~ navhome/'/docs/'
2− next/'true'
3− sort/'3'
4− title/'Hoon Chapter 2'
5− ==
6−;>
7−
8−# Chapter 2: Introduction to Writing Hoon Programs
9−
10−> Last major revision of this tutorial: September 2018
11−
12−In Chapter 2 we cover the basics of writing full programs in Hoon.
13−
14−Lesson 1 takes you through a simple Hoon program without explaining every detail. Lesson 2 covers Hoon's syntax rules. Lesson 3 covers some of the basic flow control and loop expressions. Lessons 4-6 introduce Hoon's type system. Lessons 7 and 8 show you how to use cores effectively in your Hoon programs, including how to use them as state machines. Lessons 9 and 10 cover some of the basic data structures commonly used in Hoon, such as lists, trees, and sets. Those lessons also introduce many of the standard library functions for use with those data structures. Lesson 11 includes a walk-through of two Hoon programs that are intended to reinforce everything taught earlier in the chapter: a prime sieve and a tic-tac-toe program.
15−
16−;list;
docs/tutorials/hoon.udonnew file+34
@@ -0,0 +1,34 @@
1+:- :~ navhome/'/docs/'
2+ next/'true'
3+ sort/'2'
4+ title/'Hoon'
5+ ==
6+;>
7+
8+# Learn Hoon
9+
10+Hoon is a high-level, statically typed, functional programming language, custom-designed for use with Urbit. For a functional language it has a surprisingly imperative style, and mastering it doesn't require knowing any advanced mathematics.
11+
12+Hoon is an unusual language in several respects, both in syntax and semantics. It uses runes (i.e., ASCII digraphs) in place of keywords, and the spacing rules are a bit strict. A great deal can be expressed in few lines, though excessively compressed code tends to be hard to read. Hoon has surprisingly simple semantics, but mastering it requires learning concepts that don't have close analogues in other languages.
13+
14+This series is designed to teach you Hoon without assuming you have an extensive programming background. In fact, you should be able to follow much of it even if you have no programming experience at all, though of course experience helps. We strongly encourage you to try out all the examples of each lesson. These lessons are meant for the beginner but they aren't meant to be skimmed.
15+
16+Chapter 1 introduces and explains the fundamental concepts you need in order to understand Hoon's semantics.
17+
18+Hoon is a 'subject-oriented' programming language -- every expression of Hoon is evaluated relative to a *subject*. The subject is a piece of data that represents the environment, or the context, of an expression. After reading Chapter 1 you should understand what the subject is and how to refer to its various parts. In this chapter you'll also learn about *cores*, which are an important data structure in Hoon. Once you get the hang of cores you'll be able to write your own functions in Hoon.
19+
20+Chapter 2 covers the basics of writing full programs in Hoon.
21+
22+The first three lessons take you through a simple Hoon program, explain Hoon's syntax, and explains basic flow control. The next three lessons introduce Hoon's type system. Lessons 7 and 8 show you how to use cores effectively in your Hoon programs, including how to use them as state machines. Lessons 9 and 10 cover some of the basic data structures commonly used in Hoon, such as lists, trees, and sets. Those lessons also introduce many of the standard library functions for use with those data structures. Lesson 11 includes a walk-through of two Hoon programs that are intended to reinforce everything taught earlier in the chapter: a prime sieve and a tic-tac-toe program.
23+
24+## Lessons
25+
26+;list;
27+
28+## Other Resources
29+
30+Consult the [Reference](link) to look up any unknown rune or standard library function you don't understand.
31+
32+As you work your way through these lessons you may want to work on example problems from the [Hoon workbook](link) for practice. Once you finish the lessons here you may want to write more versatile Hoon programs which can make use of more of your urbit's environment, in which case you'll want to check out the [Generators](link) documentation. Or maybe you'd like to learn how to write a [Gall app](link). Learn about [Udon](link), Urbit's stripped down version of Markdown. Or learn [Sail](link), a subset of Hoon used for generating XML nodes.
33+
34+> Last major revision of this section: December 2018
docs/tutorials/hoon-ch1/hoon-ch1-1.udon → docs/tutorials/hoon/hoon-ch1-1.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'1'
4+ sort/'21'
5 title/'1.1 Getting Started'
5 title/'1.1 Getting Started'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch1/hoon-ch1-2.udon → docs/tutorials/hoon/hoon-ch1-2.udonrenamed+2−2
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'2'
4+ sort/'22'
5 title/'1.2 Nouns'
5 title/'1.2 Nouns'
6 ==
6 ==
7;>
7;>
@@ -290,7 +290,7 @@ You can force Hoon to interpret an atom differently by using the aura symbols in
290
290
291The atoms in the examples above are all exactly the same value. Only they're interpreted and printed differently, depending on the aura.
291The atoms in the examples above are all exactly the same value. Only they're interpreted and printed differently, depending on the aura.
292
292
293−You'll learn more about atoms and auras in [lesson 2.4](../../hoon-ch2/hoon-ch2-4).
293+You'll learn more about atoms and auras in [lesson 2.4](../hoon-ch2-4).
294
294
295## Cells
295## Cells
296
296
docs/tutorials/hoon-ch1/hoon-ch1-3.udon → docs/tutorials/hoon/hoon-ch1-3.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'3'
4+ sort/'23'
5 title/'1.3 The Subject and Its Legs'
5 title/'1.3 The Subject and Its Legs'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch1/hoon-ch1-4.udon → docs/tutorials/hoon/hoon-ch1-4.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'4'
4+ sort/'24'
5 title/'1.4 Arms and Cores'
5 title/'1.4 Arms and Cores'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch1/hoon-ch1-5.udon → docs/tutorials/hoon/hoon-ch1-5.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'5'
4+ sort/'25'
5 title/'1.5 Gates (Hoon Functions)'
5 title/'1.5 Gates (Hoon Functions)'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch1/hoon-ch1-6.udon → docs/tutorials/hoon/hoon-ch1-6.udonrenamed+3−2
@@ -1,6 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3+ next/'true'
3− sort/'6'
4+ sort/'26'
4 title/'1.6 Multi-gate Cores and Doors'
5 title/'1.6 Multi-gate Cores and Doors'
5 ==
6 ==
6;>
7;>
@@ -503,4 +504,4 @@ It's better simply to use the `~(arm rs arg)` syntax to replace the value of the
503
504
504## Conclusion
505## Conclusion
505
506
506−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) 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-ch2-1) to get started.
docs/tutorials/hoon-ch2/hoon-ch2-1.udon → docs/tutorials/hoon/hoon-ch2-1.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'21'
4+ sort/'27'
5 title/'2.1 Hoon Programs'
5 title/'2.1 Hoon Programs'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-10.udon → docs/tutorials/hoon/hoon-ch2-10.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'30'
4+ sort/'36'
5 title/'2.10 Standard Library: Trees, Sets, and Maps'
5 title/'2.10 Standard Library: Trees, Sets, and Maps'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-11.udon → docs/tutorials/hoon/hoon-ch2-11.udonrenamed+1−1
@@ -1,6 +1,6 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3− sort/'31'
3+ sort/'37'
4 title/'2.11 Examples'
4 title/'2.11 Examples'
5 ==
5 ==
6;>
6;>
docs/tutorials/hoon-ch2/hoon-ch2-2.udon → docs/tutorials/hoon/hoon-ch2-2.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'22'
4+ sort/'28'
5 title/'2.2 Hoon Syntax'
5 title/'2.2 Hoon Syntax'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-3.udon → docs/tutorials/hoon/hoon-ch2-3.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'23'
4+ sort/'29'
5 title/'2.3 Simple One-Gate Programs'
5 title/'2.3 Simple One-Gate Programs'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-4.udon → docs/tutorials/hoon/hoon-ch2-4.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'24'
4+ sort/'30'
5 title/'2.4 Atoms, Auras, and Simple Cell Types'
5 title/'2.4 Atoms, Auras, and Simple Cell Types'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-5.udon → docs/tutorials/hoon/hoon-ch2-5.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'25'
4+ sort/'31'
5 title/'2.5 Type Checking and Type Inference'
5 title/'2.5 Type Checking and Type Inference'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-6.udon → docs/tutorials/hoon/hoon-ch2-6.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'26'
4+ sort/'32'
5 title/'2.6 Structures and Complex Types'
5 title/'2.6 Structures and Complex Types'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-7.udon → docs/tutorials/hoon/hoon-ch2-7.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'27'
4+ sort/'33'
5 title/'2.7 Cores'
5 title/'2.7 Cores'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-8.udon → docs/tutorials/hoon/hoon-ch2-8.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'28'
4+ sort/'34'
5 title/'2.8 Cores Again'
5 title/'2.8 Cores Again'
6 ==
6 ==
7;>
7;>
docs/tutorials/hoon-ch2/hoon-ch2-9.udon → docs/tutorials/hoon/hoon-ch2-9.udonrenamed+1−1
@@ -1,7 +1,7 @@
1:- :~ navhome/'/docs/'
1:- :~ navhome/'/docs/'
2 navuptwo/'true'
2 navuptwo/'true'
3 next/'true'
3 next/'true'
4− sort/'29'
4+ sort/'35'
5 title/'2.9 Standard Library: Lists'
5 title/'2.9 Standard Library: Lists'
6 ==
6 ==
7;>
7;>