on master help sign in
Merge remote-tracking branch 'origin/cleanorg' into cleanorg
commit5a8de882dbcfea31287b8b9f045ef53853fe15a7 authorPhilip C Monk <philip.monk@tlon.io> dateWed 13 Apr 2016, 19:24 (11 years ago) parent4ce05a64f9cbf6
3 files changed+31−26
docs/programming/core.md+8−10 docs/programming/core/demo.md+20−16 docs/using/install.md+3
docs/programming/core.md+8−10
@@ -4,21 +4,19 @@ sort: 1
44
55# Core Hoon
66
7−Hoon is strict, typed functional programming without math.
7+Hoon is strict, typed functional programming without category
8+theory.
89
910Hoon is named after a Wallace Stevens poem. Coincidentally, it
1011means "hooligan" in Australian. Practically, "Hoon" is a short
1112punchy name which search engines handle well.
1213
13−This manual defines a practical Hoon subset we call Core Hoon.
14−Some of the internal structures we present are simplified to
15−reflect the Core subset.
14+Hoon has simple principles and a lot of details. To keep the
15+details from getting overwhelming, we start out learning a
16+simplified subset called Core Hoon. (Note that some of the
17+internal structures we show are simplified to match the subset.
18+These simplifications are corrected under Advanced Types.)
1619
17−To read it for the first time, read these links in order:
20+To learn Hoon, traverse this tree in depth-first order:
1821
1922<list/>
20−
21−The Core manual is as terse as possible and written from a
22−top-down reference perspective. This will suit some and not others. For a
23−more narrative, bottom-up analysis, read [Deep Hoon](deep).
24−
docs/programming/core/demo.md+20−16
@@ -13,17 +13,18 @@ line is commented with its number:
1313:gate end/atom :: 1
1414:var count 1 :: 2
1515:loop :: 3
16−:if =(end count) :: 4
17− ~ :: 5
18−:cons :: 6
19− :if =(0 (mod count 15)) :: 7
20− "FizzBuzz" :: 8
21− :if =(0 (mod count 5)) :: 9
22− "Fizz" :: 10
23− :if =(0 (mod count 3)) :: 11
24− "Buzz" :: 12
25− (text :wrap(count)) :: 13
26−:moar(count (add 1 count)) :: 14
16+:cast (list tape) :: 4
17+:if =(end count) :: 5
18+ ~ :: 6
19+:cons :: 7
20+ :if =(0 (mod count 15)) :: 8
21+ "FizzBuzz" :: 9
22+ :if =(0 (mod count 5)) :: 10
23+ "Fizz" :: 11
24+ :if =(0 (mod count 3)) :: 12
25+ "Buzz" :: 13
26+ (text :wrap(count)) :: 14
27+:moar(count (add 1 count)) :: 15
2728```
2829
2930Can you understand this code by just looking at it? Hopefully,
@@ -40,16 +41,19 @@ Line 2 declares a variable, `count`, with initial value `1`.
4041
4142Line 3 begins a loop.
4243
43−Line 4 checks if `count` equals `end`. If so, line 5 (and the
44−whole loop) produces the value `~`, null. If not, line 6 begins
45−an ordered pair.
44+Line 4 casts the product of the loop to a list of `tape`
45+(string as a character list).
46+
47+Line 5 checks if `count` equals `end`. If so, line 6 (and the
48+whole loop) produces the value `~`, null, the empty list. If
49+not, line 7 begins an ordered pair.
4650
4751The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
48−respective tests hit. If not, line 13 wraps a runtime type
52+respective tests hit. If not, line 14 wraps a runtime type
4953around `count`, then prints the type-value pair to a string (like
5054C `sprintf()`). This string is the first item in the output list.
5155
52−The tail of the pair is line 14, which repeats the loop (like
56+The tail of the pair is line 15, which repeats the loop (like
5357Clojure `recur`), with `count` incremented. This list of strings
5458is the rest of the output list.
5559
docs/using/install.md+3
@@ -51,6 +51,9 @@ Which can usually be installed with the following one-liners:
5151 # FreeBSD
5252 pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
5353
54+ # Arch
55+ pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
56+
5457 # AWS
5558 sudo yum —enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
5659