9A Hoon expression is called a `twig`. A `twig` is an AST node:
10the noun that the Hoon compiler makes when it parses a source
13The definition of `twig` is the definition of Hoon. So let's
14define the syntax and semantics of Hoon, a twig at a time. But
15first, basic twig anatomy.
17## Twig anatomy and jargon
19A twig is a tagged union (`book`) with the form `{stem bulb}`,
20where the `stem` is an atomic symbol. The bulb for each stem has
21its own type, which varies by stem. (Compare with Lisp, where
22every AST node is a tag and a list of child nodes.)
24There are no user-level macros. All stems are built into Hoon.
25Most stems are implemented as internal macros, however.
27The bulb is usually a tuple, sometimes a list or map. An element
28of this structure is a *subexpression*.
30Usually a subexpression is itself a `twig`; sometimes it's an
31`@tas` (symbol) or a `wing` (reference path).
35Solely for clarity, we use the type alias `moss` for twigs whose
36product is used as a mold. A `moss` is just a twig, both in
37syntax and semantics; again, the difference is how we use it.
39Twigs are described as *mossy* (or *moldy*) and *seedy*; an
40example of X is the seedy form of X, a mold producing X is its
43For instance, `[%foo %bar]` is seedy: a twig producing the noun
44`[7.303.014 7.496.034]`. `{$foo $bar}` is mossy: a twig
45producing a function whose product is always `[7.303.014
50Fortunately, the twigs fit neatly into clear categories which
51match their rune prefix. Read forward by category:
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list