3 ms·
Ok, so, the digraph runes are the sticking point, for me, trying to read hoon code, so far (caveats very definitely necessary). I love the tall form indentation
by mst 11y ago
Ok, so, the digraph runes are the sticking point, for me, trying to read hoon code, so far (caveats very definitely necessary). I love the tall form indentation system, and I actually do know what $() is from reading the hidduc-posmeg stuff ('recur' is common sugar for a lisp continuation-based recurse-into-somewhere-often-the-current-function - please don't confuse that with me thinking it's plain recursion) - but, well, other than ?: which fits the hook operator thing (and ? and ?? which seem pretty clear), I've not got a good way to hang memories off the rest. Some sort of set of mnemonics, even very silly mnemonics, ala 'perldoc perlvar', might make things a lot easier for me.
Can you invent a just so story that explains why % is for apply, and : is for making tuples? It doesn't have to be particularly real, I could just do with something to hang the liveware memory structures off.
(note that I am -trying- to get my head around this stuff, but I've not quite got far enough in terms of reading code for creating an installation to seem worth the effort ... but I want to, so I'm trying to find constructive ideas that'll help other people trying to learn and incidentally also me as well ;)
- juped 11y agoIt's easiest for ? (conditionals) and ! (black magic), but it's not ever really completely arbitrary. (Some of this may just be stuff I made up rather than the actual etymology, but that's what you asked for and it's useful anyway - cf. traditional Chinese character "etymologies", which drive linguists mad but are great memory aids.) $, buc - construction of tiles (which I think we have since renamed to molds). This is type-system stuff, and I think the $ is supposed to evoke shell/Perl/&c. variable sigils, which are also type-system stuff. |, bar - construction of cores. I really think this one is just there because of the pseudo-box-drawingness of how a generic multi-armed core looks: |_ [a=@ b=*] ++ arm 42 ++ gate-arm |= a=@ (add a arm) -- something with a | at the root, and then ++ arms hanging off it like... arms. Cores really read more as layout than text to me. :, col - builds tuples. This is a punctuation mark that joins things, standing for some kind of consing operation. It's also seen in the second position in runes like $:, where it also tends to mean a consing operation. %, cen - evaluation. Everything here is a syntactic sugar on the most general operation, %=, which evaluates something from the subject with specified changes. I find this easy to remember because it's the most important one. It's also on Tlon's logo, for what it's worth. ., dot - Direct Nock. The vast majority of . runes in use are .=, test for equality, in its irregular form =(a b). Nock is the low-level target machine, and . is a pretty low punctuation mark (_ is probably lower, but never appears in the first position in a digraph rune). #, hax - Pretty printing. I don't think these are ever really seen in their regular form (just in string interpolation syntax, really), but pretty printing involves many hacks, and # is pronounced 'hax'. ^, ket - Type operations, chiefly casts. If you imagine types like superscripts on values, then the ^ character makes sense. ~, sig - Runtime hints, either debugging printfs or actual hints to the runtime. Imagine writing notes on some text, preceded with a squiggly line. ;, sem - Composers. Pretty much the only one you'll see in its regular form is ;~, for monadic composition, though ;: which promotes a binary gate to more arguments (say, for adding 3 numbers) might show up in tall form as well. The semicolon is a punctuation mark which composes related but somewhat standalone clauses together. =, tis - modification of the subject. Hoon is a language where the environment is first-class - other languages have variables and scoping and the like, Hoon just has the subject, with everything from your function's arguments to the Hoon compiler and kernel in it. = is a common assignment operator in programming languages, which is a special case of modifying the subject. ?, wut - conditionals. Pretty easy, fortunately! !, zap - black magic. Black magic deserves the ! - special honors go to !!, or "crash here". !: essentially turns on debugging mode for anything inside it - you'll often find it at the top of code files, given that Urbit is under construction. Thanks for the feedback - this sort of thing is the main value that we get out of posting things on the net. It's much appreciated.
- mst 11y agoI like most of those but here's some alternative stuff I made up that I think may work better for me (emphasis on may and me) - ~ -> it's a hint, so it's saying "hey, this is 'ish' that" or so (~ always kinda means 'ish' in my head). or maybe we use the fact that ~ is bitwise complement and say "it's info that complements the thing" # -> "format it for a comment" : -> ':' connects chunks of sentence together ; -> semi-:, so does half that and half something else as well, oh and also sem for 'sem'antic composition whereas col just 'col'lects stuff together ... actually that sem/col version really makes me happy. Glad you're finding this at least vaguely constructive, I'm rather enjoying it too.
- juped 11y agoSomeone also pointed out that people have called monads "programmable semicolons".