on master help sign in
auras
commit285c4157e4f82d717a1eee16db08c6bdb89f6068 authordrbeefsupreme <drbeefsupreme@discordja.net> dateWed 10 Mar 2021, 15:01 (6 years ago) parentfc7a090
3 files changed+62
hoon/hoon-school/atoms-auras-and-simple-cell-types.md+2 hoon/reference/_index.md+4 hoon/reference/auras.md+56
hoon/hoon-school/atoms-auras-and-simple-cell-types.md+2
@@ -109,6 +109,8 @@ Aura Meaning Example Literal Syntax
109109
110110Some of these auras nest under others. For example, `@u` is for all unsigned auras. But there are other, more specific auras; `@ub` for unsigned binary numbers, `@ux` for unsigned hexadecimal numbers, etc.
111111
112+For a more complete list of auras, see [Auras](@/docs/hoon/reference/auras.md).
113+
112114## Aura Inference in Hoon
113115
114116Let's do more examples in the Dojo using the `?` operator. We'll focus on just the unsigned auras for now:
hoon/reference/_index.md+4
@@ -31,6 +31,10 @@ A simplified explanation of Hoon's type system.
3131
3232The full story on Hoon's type system.
3333
34+## [Auras](@/docs/hoon/reference/auras.md)
35+
36+A list of aura types for atoms.
37+
3438### [Runes](@/docs/hoon/reference/rune/_index.md)
3539
3640Syntax and semantics for Hoon's rune system.
hoon/reference/auras.mdnew file+56
@@ -0,0 +1,56 @@
1++++
2+title = "Auras"
3+weight = 70
4+template = "doc.html"
5++++
6+
7+```
8+Aura Meaning Example Literal Syntax
9+-------------------------------------------------------------------------
10+@ empty aura
11+@c Unicode codepoint ~-~45fed
12+@d date
13+ @da absolute date ~2018.5.14..22.31.46..1435
14+ @dr relative date (ie, timespan) ~h5.m30.s12
15+@f Loobean (for compiler, not castable) &
16+@i Internet address
17+ @if IPv4 address .195.198.143.90
18+ @is IPv6 address .0.0.0.0.0.1c.c3c6.8f5a
19+@n nil (for compiler, not castable) ~
20+@p phonemic base (ship name) ~sorreg-namtyv
21+@q phonemic base, unscrambled .~litsyn-polbel
22+@r IEEE-754 floating-point
23+ @rh half precision (16 bits) .~~3.14
24+ @rs single precision (32 bits) .6.022141e23
25+ @rd double precision (64 bits) .~6.02214085774e23
26+ @rq quad precision (128 bits) .~~~6.02214085774e23
27+@s signed integer, sign bit low
28+ @sb signed binary --0b11.1000
29+ @sd signed decimal --1.000.056
30+ @sv signed base32 -0v1df64.49beg
31+ @sw signed base64 --0wbnC.8haTg
32+ @sx signed hexadecimal -0x5f5.e138
33+@t UTF-8 text (cord) 'howdy'
34+ @ta ASCII text (knot) ~.howdy
35+ @tas ASCII text symbol (term) %howdy
36+@u unsigned integer
37+ @ub unsigned binary 0b11.1000
38+ @ud unsigned decimal 1.000.056
39+ @uv unsigned base32 0v1df64.49beg
40+ @uw unsigned base64 0wbnC.8haTg
41+ @ux unsigned hexadecimal 0x5f5.e138
42+```
43+
44+Capital letters at the end of auras indicate the bitwidth in binary powers of
45+two, starting from A.
46+
47+```
48+ @ubD signed single-byte (8-bit) decimal
49+ @tD 8-bit ASCII text
50+ @rhE half-precision (16-bit) floating-point number
51+ @uxG unsigned 64-bit hexadecimal
52+ @uvJ unsigned, 512-bit integer (frequently used for entropy)
53+```
54+Auras are non-coercive, but conversions may have to go via the empty aura, e.g.
55+`^-(@ud ^-(@ 'foo'))`.
56+