· 5 years ago · Feb 17, 2020, 06:02 AM
1~somlus Members: I promise to out-stupid you with stupid questions. This
2 is a chat room for people who have NEVER coded but want to learn
3 hoon, and the saints who flutter in to show them patience.
4
5 In a way I'm hoping that this uber basic lens of dialogue will
6 ultimately help create a set of hoon education documents for the
7 very very early coder.
8
9 If people get mad at the 'tards' i'll change it.
10
11 codiots was the competing name...
12
13~risruc that's for setting this up ~somlus. I was thinking of the need
14 for the same myself.
15
16 cheers!
17
18~somlus cool! let's hope to find a code saint on urbit help who can
19 answer questions here when we are posting. it seems like you
20 actually have a decent base in this? maybe we can come up with
21 a few very easy generators like the list one but also others
22 which are very simple and then learn the basics writing those
23 together.
24
25~tirlyn I can help a bit
26
27 I'm not always on but I read the scroll back.
28
29~somlus thank you very much tirlyn!
30
31~ribreg Visual Studio Code - Installed. home folder - mounted.
32
33 (this is a hoontard comet of somlus)
34
35 Hoontard questions, this is confirming the likely obvious.
36 Please tell me if these are correct: Is a 'natural number' an
37 integer? Is an unsigned number basically a positive number?
38
39~somlus hmm the hoontard comet is slow. switching back to somlus. is
40 a child sort of a highly variable concept, could be a few
41 characters, could be a few lines, could be a gigantic swath of
42 code, and only by knowing what the gate does can you have a
43 reasonable expectation as to what the child is going to look
44 like / consist of?
45
46~risruc yes, natural number means positive whole numbers.
47
48 unsigned means without sign
49
50 but 'positive' is close enough.
51
52 signed integers in Hoon take twice as many bits to define, since
53 every other one is negative.
54
55 it's worth looking at how negative numbers cast to ud
56
57~tirlyn a natural number is strictly 0 or greater whole numbers only
58
59 in urbit everything is a unsigned int at the bottom, any other
60 representation is an aura on top
61
62 basically a type that says "this is how this int should be
63 interpreted
64
65~risruc `@ud`-1
66
67 `@ud`-2
68
69 `@ud`-2
70
71~tirlyn ahh sorry risruc didn't mean to repeat what you said.
72
73~risruc nope, appreciated. the chat was a bit slow for a minute.
74
75~somlus This is super helpful. Can you clarify "is a unsigned int at
76 the bottom, any other representation is an aura on top" -
77 specifically "at the bottom" and "on top". And is an "aura"
78 just a way of representing an integer in one of many different
79 formats for integers?
80
81 or rather, a system of interpreting an input which could be
82 one value in one representation but would be another value in
83 another system? I.e. 110 means very different stuff in binary vs
84 decimal vs hex?
85
86~risruc yes, that's correct.
87
88 "at the bottom" -- in essence
89
90 "on top" -- as interpreted by the compiler.
91
92 which aren't technical hoon terms, by the way.
93
94 but yes, you got the point. many basic types are all 'actually'
95 integers
96
97 the compiler also infers (or is told) their aura, which it uses
98 to render them in more meaningful ways.
99
100 for example, ship names are @p.
101
102 ? ~somlus-savlev
103
104 but if you cast them to an unsigned decimal..
105
106 `@ud`~somlus-savlev
107
108~somlus Awesome!
109
110~risruc so really your address is 1838679296
111
112~tirlyn the example of unsigned integer versus signed gets at the
113 relationship. signed integers use a binary representation called
114 twos complent, this means if you cast an signed integer to a
115 unsigned integer there are many cases where you would get a
116 different value given the same bits
117
118 you correctly point out that the representation of binary and
119 hex express encode no extra data so you can freely cast between
120 them
121
122 for a really concrete example what happens if you cast an signed
123 in (like --3, that is positive 3) to binary and compare it to
124 the unsigned equivalent?
125
126 another interesting example is floating point numbers, if you
127 cast one to a unsigned int you will find that it is not the
128 number you may have expected, because the binary representation
129 of a float is very different then that of an int.
130
131~risruc that's just not as easy to remember as ~somlus-savlev
132
133~somlus can you clarify "casting" a signed integer to an unsigned
134 integer?
135
136~risruc to cast to a certain aura, use `@aura`atom
137
138~ronreg ~somlus: so, hoon compiles to nock, and part of the nock
139 specification is that the most fundamental units of computation
140 are natural numbers and ordered pairs of natural numbers
141
142 https://urbit.org/docs/tutorials/nock/definition/
143
144~somlus i did recall reading that ~ronreg, and got bogged down in a
145 simple program as to how a subtraction is done in nock. That's
146 another question on this forum for another day, but I think
147 someday I need to understand that at its core to get all this.
148
149 So then how does the computer know that one representation
150 is a negative number but another is a positive number (of a
151 completely different value), based on the binary representation
152 of those two numbers?
153
154~risruc in my opinion, you don't.
155
156~somlus good to hear.
157
158~risruc it's useful to understand as much as ~ronreg said... i.e., that
159 everything compiles down to nock operations on integers and
160 pairs of integers.
161
162 but you do not need to learn the nock codes.
163
164 i've tried studying them a bit, but don't have a grasp.
165
166 and that's at least loosely within my area of interest
167
168~somlus got it. note to self: create nocktard forum in 2021.
169
170~risruc hahaha
171
172~somlus There was one more question up there: is a child sort of a
173 highly variable concept, could be a few characters, could be
174 a few lines, could be a gigantic swath of code, and only by
175 knowing what the gate does can you have a reasonable expectation
176 as to what the child is going to look like / consist of?
177
178~risruc a child is always one hoon.
179
180 however....
181
182 ;)
183
184~somlus now yer just talkin' santa claus
185
186~risruc you're half way decent with excel, i take it.
187
188~somlus yes
189
190 to be literal.
191
192~risruc OK. good. it's easy to analogize.
193
194 in excel, every function takes a fixed number of arguments.
195
196 (most*, you know what i mean).
197
198~somlus yes definitely
199
200~risruc if you want to return X at max Y, you might do something like:
201
202~somlus and there is a very distinct structure with brackets, commas,
203 parentheses
204
205~risruc =max(b1:b1000) to get the max. maybe that's in C1.
206
207~somlus yup
208
209~ronreg ~somlus: physical commodity computers like x86 laptops don't
210 know whether a value in memory is a negative number, a positive
211 one, or something else, just from the bit pattern
212
213~risruc then you might =match(C1,B1:b1000,0) to index the max position
214 in that range.
215
216 (in C2)
217
218~somlus yes
219
220~ronreg other parts of the code will treat the same bit pattern
221 different if that part of the code knows its supposed to
222 represent a negative/positive/something else
223
224 nock is no different
225
226~risruc then you mgiht =index(b1:b1000,c2)
227
228 of course, you don't need to do that in 3 cells. you can do it
229 in one, with: =index(b1:b1000,match(max(b1:b1000),B1:b1000,0))
230
231 that maps almost perfectly to hoon.
232
233 the difference is in hoon, usually you dont have parenthases.
234
235~somlus Interesting ~roneg.. I will have to wrap my brain around the
236 code (which doesn't know the value/sign of the variable)
237 not needing to get this information from the computer that
238 theoretically does know the value / sign. (BTW risruc still
239 following your convo, just responding to roneg)
240
241~risruc so you have to know what your runes expect and imagine them
242 yourself.
243
244~ronreg ~somlus: someone used the term "casting" earlier. that's a term
245 of art in programming, that means, basically, to interpret the
246 same bit pattern a different way than was intended
247
248~somlus Ah! ok got it. It's nice that excel very quickly tells you the
249 expected formats. But I do appreciate the analogy to multiple
250 lines vs one line, and the one line makes the "children" super
251 explicit and easy to see all at once.
252
253~risruc i don't understand the whole language server system well, so
254 maybe someone else can fill in the blanks...
255
256~somlus thanks ronreg. I'm going to copy this whole chat and literally
257 start to make a set of orienting instructions for the non-coder.
258 I'm actually already in touch with the Tlon guys who have a
259 considerable interest in just that.
260
261~risruc but the hoon language server understands all of this, as you can
262 see by dojo barking at you when you try to type illegitimate
263 commands :)
264
265~somlus ah true!
266
267 that is actually comforting. I'd rather that then a 'syntax
268 error' of sorts at the end of all the effort.
269
270~risruc ~somlus, as a non-coder myself, i'm happy to help out with that
271
272~somlus cool risruc, BTW would have never guessed you are a non-coder.
273
274~risruc i believe if you use vim, you can access the hoon language
275 server
276
277~ronreg so, something that you can try typing in the dojo is: `@`-1
278
279~somlus sorry what is vim?
280
281~risruc well, i'm an engineer. and i've dabbled my whole life. but never
282 been a developer.
283
284~somlus sure enough ronreg, it's a 1
285
286~ronreg `` is hoon's syntax for doing a cast
287
288~somlus ok copy that.
289
290~risruc vim is the preferred cli text editor for most serious
291 developers. (i'm upsetting a minority of serious devlopers with
292 this comment)
293
294~ronreg the @ represents a natural number, but -1 is a signed number
295
296 so this means, take the bit pattern that represents a signed -1,
297 but pretend it's a natural number
298
299 brb gonna lose my internet connection for a bit
300
301~somlus got it. So I did this `@`-5 and got 9. I'll have to figure that
302 one out...
303
304~ronreg try `@`-1, `@`-2, `@`-3
305
306 and see if you can figure out the pattern
307
308~somlus ok I will look into VIM
309
310~ronreg also try `@`--1, --2, etc. -- is hoon's notation for + (it's -,
311 and then - again)
312
313~somlus yes, got the patterns. I think I will have to hand do this in
314 binary to understand the conversions. How do you represent
315 negative numbers in binary?
316
317~ronreg this is vim's website: https://www.vim.org/ . it's a text editor
318 that a lot of programmers like to use (I use it myself), but
319 your exact choice of text editor isn't super important
320
321 programmers care about it the same way I imagine professional
322 carpenters care about specific brands of hammer or circular saw
323 or something :)
324
325 ~somlus: there's actually multiple ways you can represent
326 negative numbers in binary
327
328 but one of the interesting things about nock is that it doesn't
329 actually have a primitive notion of binary numbers at all
330
331~somlus ok I've been using vscode and did install the hoon extension.
332
333~ronreg it just has natural numbers and pairs
334
335~somlus interesting...
336
337~ronreg so, hoon chooses the convention that -1 is underlyingly 1, --1
338 is underlyingly 2, -2 is underlyingly 3, --2 is underlyingly 4,
339 and so on
340
341 that obviously works, but nothing that says *only* that
342 particular convention of representing signed integers as natural
343 numbers works
344
345~somlus so if it is not binary that leads to the logic behind the
346 conversion of -1 to 1 and -2 to 3 and --2 to 4, then what is
347 the logic behind that? just a "convention" rule and not a
348 calculation?
349
350 unfortunately I am now at the point where my brain is whipped
351 around with the abstraction of negative numbers have alternate
352 representations. I'm trying to make it concrete so I can relate
353 to it, but perhaps that is not possible.
354
355~ronreg it's a pretty straightforward way of solving the problem
356 of representing signed numbers when you only have unsigned
357 primitives
358
359 another way you could do it is have a cell where [0 n] is
360 positive n, and [1 n] is negative n
361
362~somlus that is much more concrete to me. (and here we mean that 1 being
363 false in hoon represents negative?)
364
365~ronreg actually it's completely irrelevant that hoon treats 1 as false
366 for this
367
368 it's just a convention
369
370 I could also say [23 n] is positive n and [877 n ] is negative n
371
372 I just pulled those numbers from thin air they don't mean
373 anything specific
374
375~somlus oh ok
376
377~ronreg by the way, it's worth noting that a lot of what we're talking
378 about is sort of general computer science concepts, and not
379 things that are specific to hoon or to nock
380
381~somlus actually that is what I want - so that I can get oriented with
382 the specialist concepts and then apply them to hoon.
383
384~risruc correct, as mentioned earlier by ~tirlyn:
385
386 https://en.wikipedia.org/wiki/Two%27s_complement
387
388~ronreg I think I mentioned that I'm just a beginner at hoon myself,
389 but I've been a programmer and student of computer science for
390 a long time, so some of these things that come up when learning
391 hoon are things I've seen before in other contexts
392
393~risruc there are many ways to represent signed integers in binary
394
395 that wiki article gives a decent rundown
396
397~ronreg hoon uses a lot of idiosyncratic terminology for things that
398 have a "standard" technical terms in computer science
399
400~somlus ok thanks for that article, will read it carefully.
401
402~ronreg for instance, someone mentioned the concept of an "aura" earlier
403 - most people who study computer science will call that a
404 "type", and hoon is being sort of deliberately unusual in
405 picking another name for it
406
407~rabsef it does sound cool tho, one must admit
408
409~risruc that is a common enough critique, but i've come to think it's
410 not quite fair.
411
412 urbit makes no bones about auras being types
413
414~ronreg some people dislike the weird terms :)
415
416~risruc however an aura is a subset of all types
417
418 it is a very specific sort of type
419
420~somlus yes the confusion for me is that since it is all new it's hard
421 to know where to look to find the definitive explanation in
422 plain english.
423
424~risruc i.e., it is limited to atoms (numbers)
425
426 there are more complex types which are not auras
427
428~somlus ah yes. There are strings that are types as well, would that be
429 correct?
430
431~ronreg ~risruc-habteb: that's absolutely a fair point, the people who
432 work on hoon sometimes pick these unusual terms deliberately
433 because they don't want to pretend that the hoon concept is
434 exactly the same thing as a more traditional CS concept
435
436~risruc because they can't be represented by single numbers (they
437 require cells (binary trees of numbers)
438
439~rabsef like a tape?
440
441~ronreg ~somuls: there are two kinds of strings in hoon, a tape and a
442 cord
443
444 actually, I might've misremembered the name of the 2nd one
445
446~risruc i think that's correct. i've heard the same thing about saying
447 "cell" instead of "tuple"
448
449~rabsef I think that's right ronreg
450
451~risruc but a cell is a specific sort of tuple (it's a 2-tuple)
452
453~ronreg ~risruc: I htink you could argue that a "cell" and a "tuple" are
454 TECHNICALLY different concepts, just similar ones
455
456 anyway the nock documentation uses the word "cell"
457
458~somlus getting back to types, I was guessing that a string was a
459 non-natural number type of type. what is an example of a
460 non-natural number type in other computer science realms?
461
462~ronreg somlus: try typing `@`'a'
463
464 in the dojo
465
466~risruc an address book entry.
467
468 or a recipe...
469
470~ronreg a floating-point number
471
472~risruc or, the format that chat-store in urbit uses to save all chats,
473 including metadata about time sent, sender, recipient channel
474
475~somlus yes that's 97
476
477~ronreg that is, a number like 2.3 that can have a decimal point
478
479 somlus: are you familiar with ascii?
480
481~somlus indeed.
482
483~risruc no, actually floating points are still atoms.
484
485 /auras
486
487~somlus just typed in alt-97 and got a. so thanks that is clear
488
489~risruc a list is a type which cannot be cast to an atom
490
491~ronreg oh, non-natural-number type, I misunderstood
492
493~somlus ah yes.
494
495~ronreg anyway, at the dojo, something you put in 'single quotes' is a
496 cord, and this is also represented underlyingly as an atom
497
498~somlus I'd love to go back to the `@`--2 portion of things. that
499 is still too abstract for me. I understand it now to be a
500 naming convention, a non-calculated way to represent negative
501 numbers. But I do not understand why they are interpreted as non
502 absolute-value positive numbers.
503
504~risruc oh yeah, good example ~ronreg.
505
506~somlus I see the pattern but do not understand from what it derives.
507
508~ronreg specifically the atom you get by doing this is the ascii value
509 of each character concatenated together
510
511~risruc getting back to that in one second ~somlus.
512
513 and then a couple more threads i want to tie up before i check
514 out for the night.
515
516~ronreg which is why `@`'a' (casting the cord 'a' to an atom) is 97
517
518~somlus copy that
519
520~ronreg 'aa' is 97*256^`+ 97*256^0
521
522 which works out to be24.929
523
524~risruc here, let me make this simple ~somlus (too late? ^^)
525
526 the basic data type in hoon is the noun, *
527
528~somlus perhaps! But if I retain 50% of all of this then i'm that much
529 closer..
530
531~ronreg anyway, this is just like the `@`--2 thing - it's a convention
532 the people who implemented hoon chose because it made sense
533
534~risruc it can be either an atom (number) or a cell (pair of nouns)
535
536~ronreg the fundamental problem they were trying to solve was, how do
537 you represent a string of characters, or a signed integer, if
538 all you have are unsigned integers and cells
539
540 and ultimatley anything else. everything you can represent in
541 hoon is at the bottom some combination of atoms and cells
542
543~somlus ok I understand that there had to be some exotic solutions
544 / representation conventions to being constrained in the
545 fundamental representation of things.
546
547~risruc OK, let me give you a couple more things that will help
548
549~somlus I know you guys probably have to go and I should too. FYI I
550 did not understand how 'aa' is 97*256^`+ 97*256^0 works out to
551 be 24.929. My brain tries to work out that as a calculator and
552 doesn't quite knwo what goes where.
553
554 ok cool risruc
555
556~risruc `*`noun will cast any subject to an untyped noun
557
558 `@`atom will cast any atom to an untyped atom
559
560 `@ud`atom will cast any atom to an unsigned decimal
561
562 play around with those and see their effects.
563
564~somlus ok will do.
565
566~risruc in many cases, all 3 will give you the same results. however,
567 you CANNOT cast a cell to @.
568
569 there are two types of strings in urbit.
570
571 'tapes' are single numbers which represent all characters
572
573~master i'm late to the party here, but i'd like to correct ~tirlyn,
574 hoon's signed integers do not use two's complement
575
576~risruc SHIT. recall.
577
578 'cords'
579
580 "tapes" are lists of each individual character's ascii code.
581
582~master the nice properties of two's complement only hold for sized
583 integers, but ours are arbitrary-precision
584
585~somlus ok will disregard twos compliment
586
587 (still listening risruc)
588
589~risruc ahh, ~master. that makes a lot more sense. i was trying to make
590 sense of the two's complement page wrt urbit's implementation.
591
592 OK, so you can cast any atom aura to '@', including 'cords'
593
594 but try to cast a "tape"
595
596 `@`"tape"
597
598 that's because tapes are not atoms. they are lists of atoms.
599
600 we need to cast it up to raw noun.
601
602 `*`"tape"
603
604 `*`"tape"
605
606 now, you can see at least, the reason that an aura is not a
607 general "type", but a specific subset of "types"
608
609~somlus ok i'm going to copy this chat and study it a bit more and
610 try to come up with some good questions. I do appreciate this
611 conversation very much and many things are further along than
612 they were. There are some odd cloudy mental blocks still
613 - my mind isn't making the leap from concept to intuitive
614 understanding, but I do feel that much of it will click
615 eventually. Once it does, I will be able to put into a language
616 that a non-coder can understand a bit more efficiently than I
617 have been able to so far.
618
619~ronreg there's a sense in which -1 in two's compliment is sort of
620 "infinity", -2 is "infinity -1 ", -3 is "infinity -2", etc.
621
622 ~somlus: yeah, this stuff is not super-easy to wrap your head
623 around
624
625~risruc by the way, back to our metaphor with excel an nested formulas..
626
627~ronreg it takes time and practice
628
629 lots of things in computer science and programming make more
630 sense after you've written code and sort of have a feel for what
631 problems you need to solve to do it
632
633~risruc i had made this image to explain to another student, how the
634 code in walkthrough 1.3.1 is nested...
635
636 however, keep in mind that after i made this, it was realized
637 that the code was not in good form.
638
639 and it's been reformatted in the walkthrough.
640
641~somlus I actually copied that to my computer risruc, sensing that it
642 could help me understand things eventually!
643
644~risruc i should update that image with the properly formatted code.
645 forgot about that until now.
646
647~somlus when you originally posted it
648
649~risruc haha
650
651 well the funny thing is, for someone who's handy with excel.. i
652 think the excel metaphor is better.
653
654~somlus ok i'll check back here tomorrow. time for this tired brain to
655 turn in and ruminate a bit on this...
656
657~risruc didn't realize that until using it just tonight. lol.
658
659~ronreg cool, good night
660
661~somlus yes, what I really need is a point of reference I understand to
662 get to something that is new. That helps. I'm thinking of this
663 from a "casio calculator" point of view and it is not adding
664 up at all. I'll get there. Thanks again for your time risruc,
665 roneg, master!
666
667~risruc pax vobiscum
668
669~ronreg no problem
670
671 ~risruc: *tecum :)
672
673~risruc that would mean "peace is with you", which I do home. but I
674 meant "peace be with you" ^^
675
676 do hope*
677
678 admittedly, my latin is poor. my apologies if i got that wrong.
679
680 or, if you meant to respond rather than correct.. then i should
681 have just closed this window after my 'exit'. good night
682 friends.
683
684~ronreg good night!
685
686 ("vobiscum" is "with you (plural)", "tecum" is "with you
687 (singular)". catholic priests say "pax vobiscum" because they
688 are addressing the whole congregation, i.e. more than one
689 person)
690
691~risruc naturally I was addressing the lot of you!
692
693 but now that you spell it out, I see. gracias.
694
695~tirlyn ~master thank you for noting that, please enlighten me, what do
696 we use as an encoding for signed integers?
697
698~master hi ~tirlyn
699
700 atoms (ie, in nock) are arbitrary precision
701
702 unsigned atoms in hoon are just atoms @u, @ub, @ud, @uwhatever
703
704 signed atoms in hoon are also arbitrary precision, @s and
705 friends
706
707 two's complement is a scheme for fixed-with integers
708
709 instead, we encode the sign in the low bit
710
711 0 is positive, 1 is negative
712
713 so the positive-sign representation of any unsigned atom is just
714 (mul 2 x)
715
716 ie, (lsh 0 1 x)
717
718 and the negative sign representation is one less than that
719
720 i believe there's a name for this scheme, but i'm having trouble
721 finding it at the moment
722
723 hoon has syntactic support for signed atoms
724
725 --2 is positive, -2 is negative
726
727 the signed functions are in the +si core
728
729 2
730
731 (abs:si -2)
732
733 here's a gate (function) to test postive signed atoms:
734
735 |=(a=@sd =(a (mul 2 (abs:si a))))
736
737 and this will test negative signed atoms:
738
739 |=(a=@sd =(a (dec (mul 2 (abs:si a)))))
740
741 demonstrating the representation
742
743 our code examples in chat aren't working quite right, but you
744 can copy those and run them in :dojo
745
746 %.y
747
748 (|=(a=@sd =(a (dec (mul 2 (abs:si a))))) -81)
749
750 ^ like so
751
752 ah, i remember, this is the "zig-zag" encoding
753
754 notably used in protocol buffers
755
756 https://developers.google.com/protocol-buffers/docs/encoding#typ
757 es
758
759~tirlyn interesting! thank you.
760
761~timluc going insane with hoon build stuff atm
762
763 made a dev ship, then am doing a simple sanity check that keeps
764 failing
765
766 But let me switch that to a more productive question: how can I
767 interpret syntax errors in Hoon better?
768
769 For example, if I recursively call a function with something
770 like `$(j (dec j), a t.a)` and I forget the comma, I
771 get the error `ford: %hood: syntax error at [4 17] in
772 /~zod/home/0/gen/lists/hoon`
773
774 does that mean that my error is in the 17th element of line 4?
775
776~ronreg ~timluc: yeah that's what that [4 17] means
777
778 that's documented somewhere
779
780~timluc Cool thanks
781
782~risruc note that that's not always where your error is!
783
784 it's often the case that your error is before the indicated
785 point, but the compiler didn't catch it until then.
786
787 for an easy example, a ?& conditional can take any number of
788 arguments. therefore it needs to be closed with ==.
789
790 if you forget the ==, you'll see the end of the last line in
791 your error, because that's when the compiler gave up looking for
792 ==
793
794~timluc Yeah, I've been playing around some today and got a more
795 intuitive feel
796
797 for the error reporting--it's kind of growing on me
798
799~rabsef somlus - 2 invites accepted - 2 new urbiters - smart developer
800 types. Hope they make a splash
801
802 And your star bears fruit!
803
804~somlus wow if you get lean on invites and are bringing in those sorts,
805 just let me know. Plenty more where that came from for quality
806 invites like that.
807
808~rabsef Thanks - I'm trying to be discerning w/ the invites and get
809 people who will work on it or use it often. I have one other one
810 outstanding to a music producer for LoveCrypt records but he
811 hasn't started it up yet.
812
813 I sincerely appreciate you letting me invite people
814
815~somlus absolutely, please keep buildin' it up with them good folks.
816
817 No time right now to pursue actual coding training (schedule
818 will open up a few hours from now) Now taking suggestions for
819 ideas for very (*very*) simple generators we can make here that
820 show basic (*basic*) principles. Before you make suggestions,
821 please once again read the name of the chat channel. We are the
822 hoontards. I was thinking that one could be a simple generator
823 that takes two inputs (real numbers), makes them into negative
824 numbers regardless of original sign, adds them together and
825 outputs the correct answer (also would be a negative number of
826 course). Another might be to take a real number as an input
827 and then output it with a variety of auras. Any other ideas
828 for exraordinarily easy initial code projects? Imagine you are
829 trying to teach code to your smart 8-year old child who is just
830 getting started. What projects would you give him/her to teach
831 them the very basic principles of something?
832
833~rabsef Somlus - I have some hoon code I wrote previously walking
834 through the lessons online. These include flop (switching the
835 ordination of a list) and cypher (replacement cypher a=b, b=c,
836 and so on) and uncypher and I remember enough to be able to help
837 go back thru those.
838
839 let me know if that's interesting
840
841 My prior coding experience is Visual Basic and Excel formulas so
842 I'm definitely not "out there" in my comprehension
843
844~somlus Smart move rabsef - those are very good basic examples.
845
846~rabsef https://pastebin.com/0mXJntLe
847
848 That's flop - pretty easy to walk through
849
850 I added an additional "feature" that appends my ship name to it
851 lol
852
853 Also I like flop because it shows 3 uses of tis. bartis, input.
854 tis/ (forget name) standard declared constant. tisbar empty
855 output declared variable
856
857 my understanding of their function there may be a little limited
858 but it's functionally true
859
860 I would be down w/ like a discord session per week where we go
861 through those lessons w/ someone smarter than me.
862
863 I can take us through the first few but I get lost after the
864 cypher activity
865
866~somlus ok cool. that sounds great. I will add that to the list.
867
868~minder I have zero understanding of what in the world Hoon's purpose
869 is and/or how it connects to the experience of urbit. It's like
870 looking at math problems without understanding when/how I'd be
871 using the principles in the real world. Without understand that
872 relationship I'm totally lost.
873
874~somlus yes it's very hard. these hoonsaints go off and so something
875 magical with their runes and whatnot, and then change happens.
876 Meanwhile, I'm struggling with very basic syntax. Risruc and
877 rabsef were super helpful to help me understand that, at the
878 outset, you need to understand the basics of syntax. In my
879 opinion that is nearly completely left out of the documentation
880 (for the noob). I am going to go to the Urbit IRL event in SF
881 tonight and will talk to the head of documentation about how we
882 wrap our heads around teaching to the very new individual.
883
884 The good news is that, from what I understand, if you can make
885 your way around excel, you have the 'what goes where and what
886 it does' basic skills to code. Confirmed this with a masters in
887 Computer Science IRL yesterday too. So I think we should ask a
888 hoonsaint to take us ridiculously meticulously through basic
889 code until we understand what goes where and why. Then we can
890 start to expand into complex strcutures.
891
892 *confirmed this with someone who has masters in CD...
893
894 *CS (dammit)
895
896~minder "How does this Nock thing go from a tshirt to making urbit my
897 own Google Drive available on phone & laptop?" Simple question.
898 X^D
899
900~somlus just a simple question. Can someone please tweet the simple full
901 answer?
902
903~risruc sweet somlus. I'm still interested in helping with that project.
904 glad the excel metaphor helps.
905
906 let me know how those conversations go tonight
907
908~minder X^D
909
910~somlus will do! ~lodleb-ritrul is the head of docs and he will be
911 there. (only a bit more time left here until I gotta bounce,
912 but..) I am trying to wrap my brain around 1) identifying
913 basic CS terminology 2) drawing some parallels between such
914 terminology and Urbit-specific terms, and most importantly
915 3) figuring out how much to 'dumb down' these terms so that
916 they can be consumed by the common person without creating
917 misunderstandings later. The thing about CS terms is that they
918 need to be super precise in order to be accurate regarding the
919 tiny niche of the world they are trying to describe, otherwise
920 you make mistakes later. But if you have to convey the exact
921 precise nature of the exact definition & its nuances, you lose
922 the student. So somewhere is the sweet spot for dumbing down
923 the concepts to their core, but also providing the complete
924 definition so that people can dig deeper when they are ready...
925 at least that is what I have for now.
926
927~risruc I totally agree with your characterization of the problem and
928 the challenge. currently I am leaning towards less emphasis on
929 mapping to other CS terms, in favor of more of a blank slate
930 approach.
931
932 that will be most helpful for the total newcomer anyway. and
933 with proper explanation, should suit the convert developer as
934 well.
935
936 of course when you're speaking to a convert, it is helpful to
937 be able to explain at least the closest approximate mapping of
938 concepts and terms, with the required caveats.
939
940~minder Communicating complex ideas to non-understanders is my jam. I
941 love it. In terms of computer science, I had enough knowledge
942 with html to script-kitty my first site together. Been building
943 wordpress sites for a long time using page builders. Can do
944 DNS editing etc. So I'm competent to get things done if I have
945 a walkthrough to follow. But nothing in terms of creative
946 expression within any kind of computer input dynamic.
947
948~somlus ok cool we're pretty similar. maybe this weekend we can find a
949 few minutes to go through a simple "take two inputted numbers
950 and add them together and produce output" code so we can start
951 to get comfortable with the format and simple competency. We
952 might be creating Hoon 001!
953
954~risruc one really gets the feeling of putting the band back together
955 here.
956
957~minder Hoon 001; I love that.
958
959 I'm very much a 'why-first' kind of thinker vs a 'what-first.'
960 "What you do here is a + b = sammoflange hoopty bop" is what I
961 hear. But if you go "Why is it this way? Because we need X to Y
962 as a function of B" I'm on board.
963
964~risruc Hoon 001 -- The Blind Leading the Blind
965
966 alternate subtitle -- Getting the Band Back Together
967
968~lapfur Here is a cool talk by Richard Feldman, one of the
969 more prolific and engaging Elm programming educators:
970 https://youtu.be/G-GhUxeYc1U (Elm is like a functional
971 programmers' version of JavaScript) He basically summarizes
972 educational theory in easy steps for those that teach
973 programming.
974
975~risruc okay. I really need to not text and drive. lol. I'll talk to you
976 later.
977
978~lapfur Looking forward to following this chat while I learn^^
979
980~somlus cool thanks lapfur!
981
982~minder I read that as Richard Feynman and I was all "holy cow he did
983 programming TOO?!"
984
985~lapfur Lol
986
987~somlus Ok minder we'll mix what and why - that's good. Keep in mind
988 that there is a tendency with super complex stuff to let
989 discussion trail off in all sorts of interesting directions.
990 So as long as we can keep the what/why/how all focused I think
991 we'll be great here.
992
993 (interesting but educationally inefficient directions)
994
995~minder I'm 4 minutes into this video and I'm vibing so hard with what
996 he's saying. X^D
997
998~somlus cool will watch it soon
999
1000~minder His "HTML vs HTML msg" difference question/explanation
1001 experience is exactly what I feel when people talk about Hoon.
1002
1003 Frame the Goal: That's the why! Why do we do this. ~lapfur,
1004 thank you so much for posting this video.
1005
1006~somlus yeah that video is pretty much 1000% correct so far
1007
1008~risruc yeah I just started video. great so far. thank you.
1009
1010 n.b., not driving any more. lol.
1011
1012~minder ~risruc; I can't get landscape to load on my phone, so I can't
1013 drive&urbit. . . yet.
1014
1015~lapfur As I'm going through the docs, it would be cool to have a sort
1016 of mnemonic translator to help us learn the different kernels
1017
1018 For example, (these are guessses that I"m ma
1019
1020 I think the original designers made when naming things:
1021
1022 Behn = Big Ben, like the famous clock that is the timer vane
1023
1024 Nock = nocking on the binary tree
1025
1026 Ford = the assembly line build system like the Ford cars
1027
1028 etc.
1029
1030 Well, better written than that, but hopefuly you get the idea
1031
1032~minder https://www.amazon.com/dp/0982370849
1033
1034 A short book I wrote about mnemonic techniques like linking &
1035 peg systems. X^D
1036
1037 Having associations to stuff you already know is a great way of
1038 making new information 'sticky'
1039
1040~lapfur You weren't kidding when you said 'this is my jam'^^
1041
1042~minder =^D
1043
1044~ronreg ~minder-folden: in the 80s richard feynman was involved with his
1045 son's computer startup
1046
1047 as a technical consultant
1048
1049 https://www.youtube.com/watch?v=EKWGGDXe5MA[embed]
1050
1051 ~minder-folden: in the 80s richard feynman was involved with his
1052 son's computer startup
1053
1054 feynman was a smart guy
1055
1056~somlus This question is pretty simple so I will put it here. Can
1057 someone explain the basics to me about |mount and |commit %home
1058 ? 1) What is it about linux structure or working within linux
1059 (Ubuntu) that makes it necessary? 2) when you do the |mount
1060 command, is it basically copying the files from the working
1061 / operating format to a regular file directory format, but
1062 then also retaining the original data unchanged in the working
1063 format? and 3? when you |commit %home are you basically doing
1064 the opposite, with a program that has been watching for changes
1065 in the mounted directory and then re-injects the changed files
1066 into the live operational format? Please set me straight on any
1067 misunderstandings of this supposition. thanks!
1068
1069~master ~somlus, short answers:
1070
1071 |mount sets up an external mirror of some %clay desk
1072
1073 |commit injects the files in that external mirror back into
1074 %clay, resulting in a new revision of the relevant desk if any
1075 of those files have changed
1076
1077 so, yes
1078
1079~somlus Cool, makes sense to me now. Is this a common thing in Linux or
1080 fairly specific to urbit?
1081
1082~master the internal structure (%clay's state) and external structure
1083 (linux filesystem) bear no resemblance to each other, so
1084 transformations are needed in both directions
1085
1086 our implementation is very basic, the simplest thing that could
1087 work
1088
1089 it used to be automatic, but there were subtle bugs
1090
1091 filesystems are hard ...
1092
1093~somlus and critical. Ok that makes complete sense to me thank you.
1094
1095~master the details are specific to urbit, but exposing some data
1096 through a filesystem interface is very unix-y
1097
1098 linux exposes it's process true through something called procfs
1099
1100 and FUSE is a general-purpose way to expose arbitrary data as if
1101 it were a filesystem
1102
1103 urbit used to have a FUSE implementation for browsing the
1104 namespace
1105
1106 just a demo, but it'd be nice to bring it back and make it real
1107
1108 that should be "process tree"
1109
1110~somlus which should be "process tree" (much of this is new to me). Also
1111 I'm going to ask a f/u question on u-h because it might benefit
1112 from multiple eyes on it /responses. Thank you for this info!
1113
1114~risruc s/"process true"/"process tree"
1115
1116~somlus ~rabsef-bicrym if you have a link to the cypher program you
1117 wrote can you post it here?
1118
1119 This outstanding notes index for Hoon school was recently
1120 posted. I can't remember by whom! Anyone who can, please post
1121 that ship name here
1122
1123 https://www.notion.so/Hoon-School-Notes-Index-e84498f0f38f4948b1
1124 6d5bab4fd5dece
1125
1126 Also helpful for people super comfortable with Windows but new
1127 to Linux, article which is a friendly read on how unix/linux
1128 works: https://neilkakkar.com/unix.html
1129
1130~rabsef https://pastebin.com/gGqMK0Wm
1131
1132 If I'm reading that right, it's after the second step where
1133 you're supposed to shift twice.
1134
1135 I need to pick that back up. I'm going to start tomorrow - thank
1136 you for inspiring
1137
1138 I'm going to finish the Hoon School 101 that I'm in - I stopped
1139 because I couldn't get to the dang notebook but that's been
1140 resolved for weeks
1141
1142 I can get it done and then I'll share my full note set from that
1143 and start going back through the tutorials
1144
1145 I also want to map all the potential error flags you can see in
1146 urbit - I'll try to fit that in
1147
1148~somlus wow!
1149
1150 that's a lot
1151
1152~rabsef I'm going through the hoon school notebooks and taking notes
1153 on each reading. Almost done w/ week one (which I already
1154 completed, but then got locked out so I gave up)
1155
1156 If it would be nice to share I would be happy to - a lot of it
1157 is covered on teh website but maybe my repetition of it would be
1158 helpful
1159
1160~master ~somlus, those are ~fabled-faster's notes
1161
1162~fabled feel free to copy them if you use notion - i think you can
1163 actually rip the entire directory of notes
1164
1165 if you don't, I'm 90% sure the text you can copy turns into
1166 markdown
1167
1168~somlus I thought it might be fabled. thank you - those are brilliant!
1169 It give me new verve to go make another attempt.
1170
1171~rabsef Can I try sayin hi to one of u using : ?
1172
1173~somlus Yes you bet - should I just watch the dojo?
1174
1175 FYI I'm going to try to change a bios setting on my computer, so
1176 I'm doing a restart.
1177
1178~risruc i'm looking at cli now, ~rabsef
1179
1180 if you want to hi me.
1181
1182 ; ~rabsef-bicrym is your neighbor
1183
1184 hi ~rabsef-bicrym successful
1185
1186 |hi ~rabsef-bicrym
1187
1188~rabsef sorry - I stepped away for a second
1189
1190 lol
1191
1192~somlus I'm back.
1193
1194 that's what happens if you try to |hi in chat
1195
1196~rabsef trying now - yes somlus
1197
1198 risruc - it should just have sent
1199
1200 sweet
1201
1202 I'm doin something other than |hi tho - I'm using : and in the
1203 form of :@p/app &helm-hi @t
1204
1205 so like :~rabsef-bicrym/hood &helm-hi 'hi'
1206
1207 dot poast
1208
1209~somlus I see nothing special in chat-cli.
1210
1211 -------[15.635] showed up after you said you sent it
1212
1213 other than that looks like normal stuff
1214
1215~risruc welcome back ~somlus.
1216
1217 with your wax, i wane.
1218
1219 time to get ready for bed.
1220
1221~rabsef didja get that som?
1222
1223~somlus Nope. What's it supposed to look like?
1224
1225~rabsef I crashed
1226
1227 It should look like a hi
1228
1229 I seg faulted tho - let me try again
1230
1231 I just tried - it read 'test test one two three'
1232
1233~somlus Nothing. Have the window open in chat-cli, not message of that
1234 sort received.
1235
1236~rabsef isruc
1237
1238 That was supposed to read "I was able to do it with our friend
1239 risruc
1240
1241 it may just be latency or i may be doing it wrong
1242
1243 I'll try a normal hi
1244
1245~somlus I saw this is a normal hi
1246
1247 oh i see test test one two three up there after all
1248
1249 it has your ship name then colon then the text
1250
1251~rabsef NICE!
1252
1253~somlus saw this is the other way
1254
1255~rabsef that's using format :~sampel-palnet/hood &helm-hi 'text'
1256
1257 in that I'm sending a &helm-hi message with that tape to your
1258 hood rather than relying on Hi to do it
1259
1260~somlus Great, got both
1261
1262~rabsef I don't really understand &helm-hi but it's cool
1263
1264~somlus very cool. Ok won't be super close to the screen for the rest of
1265 tonight. Great that it worked. Gnite all.
1266
1267~ronreg ~somlus-savlev: thanks for posting the hoon school notebook
1268
1269~somlus Wish we could pin posts - I would definitely pin one with that
1270 in it.
1271
1272~fabled yeah, pinning would be nice
1273
1274~rabsef ~somlus if toure doung a call this weekend jd love tk join.
1275 aorey typos on phone and just wome up. fingers no work
1276
1277~somlus will have you in for sure rabsef...
1278
1279~rabsef I'm excited. Need voip for urbit!
1280
1281 and sorry for double post in 2 contexts - I have resolved to try
1282 better w/ separation of chats in the new year
1283
1284~somlus No worries - I did the same! I'd say post away we all know this
1285 is a challenging interface in terms of remaining current, etc.
1286
1287~fabled ~rabsef - i too, am excited for most communication types to be
1288 afforded for in urbit
1289
1290 it’ll be further out but we’ll get there eventually
1291
1292~risruc one thing i don't understand, perhaps because i dont understand
1293 enough how computers work...
1294
1295 is how will urbit handle real-time/continuous tasks
1296
1297 like voip, video chat, live gaming
1298
1299 since it is necessarily single-threaded computing.
1300
1301 e.g., if you ask your urbit to calculate something (say
1302 1,000,000 factorial) and it hangs for some number of seconds
1303
1304 does that mean you can't be sending or receiving any packets in
1305 the mean time?
1306
1307 again, perhaps the question is silly..
1308
1309~rabsef I /think/ that though it's single stream, there is currently
1310 some need to 'try again' for a period of time, but I see your
1311 point. Additionally, it may be that urbit is just the identity
1312 layer to a product like voip that sits at a higher layer?
1313
1314 I don't miss traffic when I crash, to the best of my knowledge.
1315 It is delivered next time my urbit is available
1316
1317~fabled we need someone like ~palfun to explain how this is possible
1318
1319 all I know is that VoIP and streaming to a degree will be
1320 possible, but I forgot by what mechanisms it'll be possible
1321
1322 you're correct in thinking that at the present time, tasks of
1323 that sort are not possible
1324
1325 i forget if we have any urbit engineers/infrastructure team in
1326 here
1327
1328 nvm, there are a few in the backscroll
1329
1330~risruc will repost in /u-h, now that california is waking
1331
1332~somlus Yes it does seem that something will have to sit on top of
1333 urbit ~risruc. I had never though of this until now but i seems
1334 self-evident. It will request data from the ship but not have
1335 access to it without permission.
1336
1337 because for live chat it doesn't need to go through the urbit.
1338 The ship can set up a P2P and only be used for the key that sets
1339 up the connection, I think?
1340
1341~nidsyp That's a good question ~risruc. How is multiprocessing
1342 implemented. I like to think of moons being used to that. But
1343 I'm not sure that's practical because they are rather heavy
1344 height.
1345
1346 But maybe arvo will have something similar but much lighter
1347 weight.
1348
1349~hastuc https://github.com/urbit/proposals/blob/master/005-asynchronous-
1350 multiprocessing.md
1351
1352~risruc thanks hastuc. that's an interesting read.
1353
1354~nidsyp thanks ~hastuc.
1355
1356~somlus Wow hastuc, that is a real commitment to an idea. Well done.
1357 Immediately when you stated the problem it resonated with me. I
1358 am assuming they can create moons with different requirements
1359 from the traditional 2GB of memory
1360
1361 Or they could create a category of ship called a satellite that
1362 is specifically suited to computational tasks, that the planet
1363 can auto-spawn and auto-destroy, and can only communicate with
1364 the planet or perhaps with one outgoing authorized entity,
1365 and the results of that "life" are then incorporated to the
1366 deterministic data set, somewhat akin to closing out a block on
1367 a blockchain (but only loosely so - just describing the keeping
1368 of data in a larger record here).
1369
1370 The only benefit of creating a new type is that everyone knows
1371 it is only for competition, is expected to be destroyed, and has
1372 zero authority.
1373
1374 computation (not competition). needs coffee.
1375
1376 Also, I should read the thread next time since I see that about
1377 5 1/2 hours ago you mentioned something very similar.
1378
1379~risruc haha, not a problem. good minds, et c.
1380
1381~hastuc hey don’t thank me, thank ~rovnys-ricfer next time you see him,
1382 he wrote it
1383
1384 ~solmus I didn’t write it haha ~rovnys-ricfer did
1385
1386~somlus ah!
1387
1388 misunderstood.
1389
1390~nidsyp thanks for sharing it though
1391
1392~ronreg I like hte idea of calling a computation-specific moon a
1393 sattellite
1394
1395~somlus I regretted saying it had zero authority. It has the specific
1396 level of authority and data access that the planet gives it. It
1397 can only see a very narrow slice of the ship's file sert.
1398
1399 set.
1400
1401~rabsef thst is your joint learnign sesh
1402
1403 somlus did i miss it?
1404
1405~somlus no sir! I sent a message for you in minder's party and told
1406 you that today got away from me. When works for you tomorrow
1407 (sunday)?
1408
1409 I'm guessing you will be going to church some of the day, but
1410 I'm 100% flexible so I'll plan it around your schedule.
1411
1412 Just let me know good times and time zone and I'll work it
1413 around your schedule.
1414
1415~risruc if I'm able to be around, I'd love to. but family party tomorrow
1416 evening. not free until later night. more free after Christmas
1417 for the next Meetup.
1418
1419~somlus Ok we'll figure it out!
1420
1421~hanwed Testing a moon (I will likely use moons when we are learning
1422 code - you'll know it's me because it ends in ~somlus-savlev
1423
1424 Obviously if I trash a moon I"ll use another
1425
1426~somlus .
1427
1428~risruc wow, ~somlus, brutal.
1429
1430 I know you have 4 billion of them
1431
1432 but think of the children.
1433
1434~somlus haha! oh, man. I didn't think of the kids! what have I done??
1435
1436~rocted moon testing (will code from this moon later)
1437
1438~waldev or this one
1439
1440~risruc i absolutely love the devmoons
1441
1442 i'll ahve to set some up.
1443
1444 much nicer than comets or fakezods
1445
1446~somlus yeah, It's nice to know you have a fully working urbit that you
1447 are testing. No need for waiting for comet mining, and a fakezod
1448 is of course not updated.
1449
1450 What I do is just |moon over and over again like 10-20 times,
1451 then copy that whole section, remove the \/ and the xtra spaces
1452 and you voila, you have like 10-20 urbits ready to spawn. I use
1453 the -G setting and copy/paste the keys in there and they spin
1454 up. Easy, peasy.
1455
1456~rabsef sorry I didn’t see your other message. we need DMs. i have
1457 tickets to a show at (all times mountain) 2pm today, and
1458 assuming it lasts 2 hours and drive time probably 6PM I’d be
1459 available conservatively.
1460
1461 test
1462
1463 what are you thinking of covering today? I was thinking about
1464 it and I think maybe just reviewing the noun chapter from the
1465 guides and do the first banal assignment from Hoon school. it
1466 covers the absolute basics of input and output in Hoon programs
1467
1468 those took forever to post. sorry
1469
1470~somlus Totally cool le
1471
1472 let's plan on 5pm PST 6PM MST to get started. I think you will
1473 be shocked at how early of an understander I am for hoon. I
1474 need to begin at the beginning beginning, meaning that I do
1475 not fully even understand the syntax. Fortunately I know excel
1476 to an intermediate level, so I can easily have excel metaphors
1477 as examples. Actually i was thinking of creating super simple
1478 spreadsheet "programs" in excel and then trying to do the
1479 same thing in hoon. TBH I can't even understand the syntax of
1480 variables, user input and (now using hoonspeak) children. So a
1481 simple "let the user input two numbers and then tell them the
1482 sum of those numbers" would be where I would begin. And then
1483 from there I think we go through the hoon components of the
1484 exercises, like the create list exercise and so on.
1485
1486~rabsef I'm going to try to write that quickly and see if I can be
1487 prepared and then I'll know what elements we need to refer to
1488
1489~somlus Cool. Also I cannot recall who posted this video (maybe
1490 it was you rabsef?), but the first 8 minutes accurately
1491 spell out the dilemma and the beginning of the approach for
1492 simple, directed learning at the orientation level of things:
1493 https://www.youtube.com/watch?v=G-GhUxeYc1U&t=729s
1494
1495~rabsef in fact that example is in the syntax of the correct rune
1496
1497 so it's pretty easy lol
1498
1499 shit yah I did it
1500
1501 lol
1502
1503 Hey - I did it - and my |commit took forever
1504
1505~somlus yeah!!!
1506
1507 interesting that your commit took forever. had a long time
1508 passed between your |mount and |commit?
1509
1510~rabsef test
1511
1512 yayaya im workig and i got the function programmed for later.
1513 recommend all do a |commit %home before we go just in case you
1514 have as much uncommitted as i did
1515
1516 took a long time
1517
1518 somlus, about to start my thing but - are you familiar eith
1519 editing files in linux? because to make a generator thst is
1520 effectively a named function in hoon, its much esdier to do it
1521 in a text editor then commit thsn to do it in dojo directly
1522
1523 forgive typos - big thumbs and small phone
1524
1525 in dact i basically dont do work in dojo cuz you need to be
1526 accurate which isnt my forte
1527
1528~risruc also, ~somlus, i assume that you're not working from the machine
1529 that runs your urbit.
1530
1531 if so, are you working from mac or pc?
1532
1533 is that correct?
1534
1535 you'll want to know how to post files with scp.
1536
1537 if you're on windows, you can use pscp (comes with PuTTY)
1538
1539~tocref Hello Friends –– I finished hoon 101 and am starting on hoon 201
1540 –– I have previous programming experience and I can def try to
1541 help out w any questions anyone here might have
1542
1543~somlus ok got it.
1544
1545 Can you simply re- mount? I'm sure I don't have too much in the
1546 mounted directory that is relevant and I'm ok with overwriting
1547 it.
1548
1549~rabsef mountint puts files in unix, commiting reads them from unix to
1550 ship
1551
1552 so remounting isnt what we want. intermission
1553
1554 this might be slightly longer than i thought...
1555
1556 unexpected - because its a children friendly program. steange
1557 choice to make it like 3 hours
1558
1559~somlus how odd to make it 3 hours, for kids? That seems like a bit out
1560 of touch of them. Unless it's a holiday classic...
1561
1562 ~rabsef I think the easiest solution until we understand this
1563 further is to launch moons and hoon off of them?
1564
1565 (BTW I know you won't reply until some time later b/c you're at
1566 the event)
1567
1568~tocref IIRC There's a way to launch a testnet comet that you can use
1569
1570 Gonna try to find it in the docs
1571
1572~somlus Question tocref - on https://packages.ubuntu.com/bionic/i3 there
1573 are lots of architectures to choose from. I recall that often
1574 things in ubuntu are downloading amd64 even though the hardward
1575 is actually an intel processor. Can you tell me whether I should
1576 download the amd64 or the i386 version to use?
1577
1578~tocref https://urbit.org/using/develop/#creating-a-development-ship
1579
1580 One of these isn't actually connected to the broader urbit
1581 network but you can still run hoon in it
1582
1583 Which is convenient because it's still technically possible to
1584 break a ship trying to run a broken hoon program
1585
1586~somlus ~tocref check out my post from almost exactly 5 hours ago.
1587 I like moons and spawn a ton of them and then use those for
1588 development. You can also comment as your moon and people will
1589 still know it's you since they are connected.
1590
1591~tocref somlus –– I'm not 100% sure on how to run a linux VM on windows
1592 because I currently use a mac and previously just used linux for
1593 like 7 years lol
1594
1595~rocted Still somlus here....
1596
1597~somlus good to know, no worries tocref.
1598
1599~tocref If you're trying to download a copy of ubuntu, unless your setup
1600 is really weird I'd download the latest LTS image from here
1601
1602 https://ubuntu.com/download/desktop
1603
1604~somlus No i'm trying to download i3 from within ubuntu. There are lots
1605 of choices and it must be the i386 one
1606
1607~tocref Ah, is apt-get not working?
1608
1609 Normally apt-get is supposed to figure out this stuff out for
1610 you
1611
1612~somlus good point. I should just do it that way, thank you for the
1613 reminder.
1614
1615~rabsef ok I’m out and heading home. cutting it marginally close but
1616 will be there by six Denver shit traffic bloody allowing
1617
1618~somlus please take your time. it's pretty much you and me and i'm in
1619 for the night. will standby
1620
1621~rabsef I'm here finally!
1622
1623~somlus Kaboom! I think for now we should be fine with just us. If
1624 we get into questions that are hard to answer, then we will
1625 announce in urbit-help we are doing this and see if any good
1626 knowledgeable souls show up to help us out. Sound good?
1627
1628~rabsef I made, in advance, a documented hoon to add two atoms and
1629 explain everything going on - it's very rudimentary but it's how
1630 I started to understand what creating hoon files does and how to
1631 do it
1632
1633 Sounds good - how do you want to start?
1634
1635 I think we should talk about the specific problem you're trying
1636 to solve (add two numbers) and what that means in urbit
1637
1638~rocted ok cool. let's start with that! I'm going to talk from my moon
1639 from now on. will quickly mount it
1640
1641~waldev oops wrong moon. that one doesn't have access to minder's party
1642 so I'll use this one.
1643
1644~rabsef this covers 1) what is a number 2) how does urbit handle numbers
1645 3) how do you create hoon files and 4) what runes are relevant
1646
1647~waldev Cool. ready!
1648
1649~rabsef I'm going to pretend like I know what I'm talking about and that
1650 will help me solidify the knowledge ify the knowledge I already
1651 have
1652
1653~waldev How would you like to share it?
1654
1655~rabsef had a stroke there - you get the point
1656
1657 https://urbit.org/docs/tutorials/hoon/nouns/
1658
1659 we should start here. Everything, it turns out, is a number in
1660 urbit
1661
1662 all text and so on are numbers. Any output that isn't a number
1663 (save tapes and cords but we'll get there) can be freely "cast"
1664 into a different aura
1665
1666~waldev got and printed as well.
1667
1668~rabsef but first lets talk about how the numbers are stored
1669
1670~waldev fortunately that part I understand already.
1671
1672 Great!
1673
1674 I need that.
1675
1676~rabsef ah ok well then lets move on. Do you feel comfortable w/ the
1677 binary tree notation and concept?
1678
1679~waldev yes I do except for one question on that. I can't fully
1680 understand why such a complex system was required. I think that
1681 overall it will be easiest for me to use excel as an analogy. In
1682 excel, it's so easy to see where data is, and where data can be
1683 inputted and outputted because of the grid. Items are in cells,
1684 that are right there in front of our, A5, C2 and so on. Is this
1685 binary tree a means of naming different components to a one-line
1686 depiction of code, which must be depicted in the text of a
1687 terminal? Or why would they come up with something so complex?
1688
1689~rabsef The important part to remember is that all cells are read from
1690 the "right"
1691
1692~waldev yes fortunately I also understand that and also how the system
1693 will remove excess brackets.
1694
1695~rabsef That's a good question - and yes. Because everything is read
1696 from the right when not explicitly bracketed, you're able to
1697 give a numerical value to the specific position in a tree
1698
1699 e.g. +1:[22 [33 44]] as in the example, shows the whole thing
1700
1701~waldev (incidentally one thing we might consider is documenting the
1702 'take away' messages like that one somehow so that future peeps
1703 can skip to the take home messages.
1704
1705 yes indeed
1706
1707 and +2 is 22, +3 is [33 44} correct?
1708
1709~rabsef all the way down the number-names are consistent no matter if a
1710 specific branch of the tree exists
1711
1712~waldev +6 would be 33
1713
1714 I think.
1715
1716~rabsef and +5 is nonexistent because 22 is a leaf
1717
1718 precisely
1719
1720~tocref Think the main reason it's so unique (most other programming
1721 languages don't store everything as a binary tree lol) is to
1722 allow it to handle state in a purely functional context (correct
1723 me if i'm wrong)
1724
1725~waldev good new vocabulary. ok so leaf means a "dead end" in the
1726 bracketing system?
1727
1728 welcome tocref!
1729
1730~rabsef I'm sure you're right ~tocref - I have a limited understanding
1731 anyway so please don't take me as the expert
1732
1733 A "leaf" is technically a noun that doesn't have any "children"
1734
1735~tocref It's hard to explain what this means without writing a couple
1736 paragraphs on how other programming languages work and I'm not
1737 experienced enough to articulate it lol
1738
1739~rabsef so yes, but also we should use that language I think
1740
1741~somlus interesting tocref.
1742
1743 ok cool. we'll use that language, but part of what I need as
1744 a beginner is boundaries on these definitions. I need to know
1745 both what they are and what they aren't. I'll probably keep
1746 describing in common terms until the hoon terms become more of a
1747 second nature.
1748
1749~rabsef Yes - sorry - didn't mean it as a correction, just trying to use
1750 the language to again solidify it for me
1751
1752~tocref Hoon's terms are like, also different from a lot of the usual
1753 terms, which is helpful sometimes and absolutely baffling in
1754 others
1755
1756~somlus copy that, rabsef
1757
1758~rabsef So, what we want to do is add two "nouns" which are "atoms"
1759 (because it's more complex to add cells). There's technically
1760 already a function that does this
1761
1762 our atoms will be leafs, as (I think) all atoms are leafs
1763
1764~somlus ok good rabsef thanks.
1765
1766~rabsef i.e. trivial (non complex) holders of space in a binary tree
1767
1768 w/ values
1769
1770 if you try (add 2 3) in dojo, it should give you 5
1771
1772 we want to recreate that behavior
1773
1774 Are you familiar w/ the runes at all?
1775
1776~waldev ok grate done, and thanks.
1777
1778 yes I have them printed out and flashcards to learn the
1779 phonetics. But I do not at all understand how they work. I try
1780 to think of them like excel commands
1781
1782~rabsef they are, sort of, incidentally I'm super into excel so this
1783 will work well
1784
1785~waldev where you have a certain number of things you can separate
1786 by commas and put in the parentheses in excel, each of those
1787 separable things being "children" here
1788
1789 ok great. i'm a lower intermediate level user of excel
1790
1791~rabsef Let's just jump to what we need - I happen to know, but we need
1792 a core
1793
1794 We want a core that allows us to do two things - take input and
1795 act on it
1796
1797 thankfully there is that core, bartis
1798
1799~tocref I'm about to disappear for a little bit; I'm going to start on a
1800 hoon 201 assignment (again, as my HD got wiped a while back)
1801
1802~waldev so is a core like a command in excel?
1803
1804~rabsef The syntax for bartis is (bartis) <specification of input> <hoon
1805 to act against it>
1806
1807 lol toc you should be teaching this
1808
1809~waldev ok got it
1810
1811 uderstood toc thanks
1812
1813~rabsef Explaining what a core is (battery paylod) is a little beyond my
1814 understanding. Basically I /think/ the battery is what to do and
1815 the payload is what to do it with
1816
1817 so yes
1818
1819 that definition comports w/ our "syntax" for bartis |= a=spec
1820 b=hoon
1821
1822~rocted ok thanks. Got it.
1823
1824 (switched moons sorry)
1825
1826~rabsef considering that other hoon runes are part of hoon, I think a
1827 core could have a core inside of it so like excel again
1828
1829 so, we know we need |= and we know we have (add a b) already as
1830 a function in hoon
1831
1832~rocted ok i'm with you
1833
1834~rabsef that gives us |= <a=spec> (add x y) where x and y are somehow
1835 going to come from a spec
1836
1837 recalling that |= requires a=spec b=hoon, add is our b
1838
1839 We already also know what specification we want to give to our
1840 inputs
1841
1842 They aren't dates or hexidecimal or anything, they're just atoms
1843
1844~rocted ok hold on just a sec there. Can you tell me what <a=spec> is
1845 and why it is there?
1846
1847~rabsef for arguments sake, lets say we want to give the computer a cell
1848 to be added [asub1 asub2]
1849
1850 yes sorry
1851
1852 a=specification meaning a is input values specified in a type
1853
1854~rocted ok thanks. so it tells you whether x and y are going to be in a
1855 binary, decimal or other notation, even though no matter what
1856 they are going to be real numbers?
1857
1858~rabsef just like in excel, like suppose the right argument =RIGHT(cell
1859 (a),starting point)
1860
1861~tocref Before I leave, when you get some sort of code written make sure
1862 to put into a pastebin or a github gist and drop the link in the
1863 chat, easiest way for me to critique IMO (Don't think urbit chat
1864 lets you post code snippets)
1865
1866~rabsef right is b=hoon, a is the interior of the parens
1867
1868 I will post the pastebin for sure
1869
1870 let me ask palfun something quickly
1871
1872~rocted ok
1873
1874 going to study this a bit anyway
1875
1876 thank you tocref will do
1877
1878 rabsef, I know you have issues with your ship, so no rush, but
1879 when you come back:
1880
1881~rabsef ok back to this
1882
1883 let's talk about how to access hoon that we write
1884
1885 When we write hoon in unix, we can save it in the /gen folder of
1886 home, commit it , and then use it in dojo w/ + (lus) before the
1887 name of the hoon
1888
1889 I don't know if you've read the Dojo getting started thing but
1890 that means effectively /home/gen/nameofgen/hoon
1891
1892 in Urbit you don't use . (dot) to denote file extensions, it's
1893 just another fas (/)
1894
1895 test
1896
1897~rocted Ok I think I'm getting the hang of this BECAUSE I'm drawing the
1898 analogies to excel and it's finally making sense for me. I still
1899 cannot tell how the user input plays into this, but it sounds
1900 like your created program might give us an example of that. Feel
1901 free to teach more (this is great) or share the pastebin of that
1902 program (er...generator) and I'll check it out
1903
1904 oh sorry. great!
1905
1906~rabsef Are you comfortable w/ writing code to your unix environment for
1907 your moon, using vim?
1908
1909~rocted yes, ok got it.
1910
1911~rabsef I know vim /ok/ so that's what I use
1912
1913~rocted not with vim but I use vscode. for now that is best fo rme
1914
1915~rabsef have you mounted your moon?
1916
1917~rocted for me
1918
1919 yes sir!
1920
1921 I have the /gen directory open in vscode
1922
1923~rabsef nice - ok lets review what we want to do
1924
1925 we want to create a gen that uses bartis |= to take in 2 atoms
1926 (@) and does add x y to them
1927
1928 in what context would we normally see 2 atoms in hoon, recalling
1929 our original starting point
1930
1931~rocted correct, with the atoms being submitted by the user correct?
1932
1933~rabsef that's right -user submitted atoms
1934
1935~rocted [2 4] - that context?
1936
1937~rabsef well let's put that slightly differntly. bartis |= will /expect/
1938 values that we tell it to expect, so it could come from other
1939 hoon, too
1940
1941~rocted in a cell?
1942
1943~rabsef but yes - in this case user input
1944
1945 ok - pastebin - one sec
1946
1947~rocted when you say 'come from other hoon' - what is the "hoon" you
1948 mean here?
1949
1950~rabsef https://pastebin.com/1r5mBUdW
1951
1952 any hoon, suppose we fed values to our new program from another
1953 program
1954
1955 hoon talks to hoon and contains hoon
1956
1957 that is confusing but it's all reflexive to "the state"
1958
1959 in the case of the program calling our new program, lets say,
1960 the input would not come from a user
1961
1962 that's all I meant
1963
1964~rocted ok i have copied that into vscode. going to rearrange my windows
1965 so I can see everything at once.
1966
1967~rabsef one more rune we need to discuss ::
1968
1969 :: allows comments
1970
1971 also from a syntactic position, completely UNLIKE excel, hoon
1972 cares about spacing
1973
1974 double space between rune and <contents>
1975
1976~rocted copy that.
1977
1978 thank you. did I read somewhere that double space and line feed
1979 are semantically equivalent?
1980
1981~rabsef We can try that to see - I don't understand tall form sometimes
1982 tho because the spacing still matters
1983
1984 I like long form
1985
1986 oh big note here
1987
1988 when you get errors in hoon that you write, you get [x y] which
1989 is always the row, column where the error happened
1990
1991~rocted ok got it
1992
1993~rabsef so if we fuck this up you'll be able to know
1994
1995 where
1996
1997~rocted interesting, and what is the column then? row is easy, but
1998 column?
1999
2000~rabsef the # of chars to the right
2001
2002~rocted (oh and also incidentally, I recall that someone said in u-h
2003 that sometimes it tells you where it discovered the error, but
2004 not where the error actually began).
2005
2006 ok got it
2007
2008~rabsef so for instance, bartis in my code is located at [8 1]
2009
2010 yah that's right but u can trace it back
2011
2012 so lets look at bartis and what it's saying there |= [a=@ b=@]
2013
2014~rocted ah got it
2015
2016~rabsef here a and b are arbitrary, they could be foo and bar, or crap
2017 and hat
2018
2019 they're faces
2020
2021 a "face" is a variable name
2022
2023 or a constant name
2024
2025 it's a name lol
2026
2027~rocted ok cool.
2028
2029~rabsef I like abcd because it's easy for me to remember
2030
2031~rocted face. so in excel what would a 'face' analogue be?
2032
2033~rabsef so - create a file in /gen that you call something other than
2034 add, and let's have just lines 8 and 14 in there
2035
2036 a named range
2037
2038 are you familiar w/ named ranges?
2039
2040~rocted no unfortunately.
2041
2042~rabsef or, specifically A1 would be teh face of the contents of that
2043 cell
2044
2045 A1 is not the cell, nor the contents (except in weird cases) but
2046 it is the name of the cell
2047
2048 Does that make sense?
2049
2050~rocted not entirely because the binary tree provides addresses for each
2051 item, so those would be the best analogues to A1, B2
2052
2053~rabsef A named range just allows you to give a cell or set of cells a
2054 funny name like "foo" or "a"
2055
2056 well then go w/ the named range example - I have named the range
2057 of A1:A1 a
2058
2059~rocted ah! ok.
2060
2061~rabsef and B1:B1 b
2062
2063~rocted copy that.
2064
2065~rabsef Incidentally, those are very helpful in excel so you should try
2066 it out
2067
2068~rocted oh can you actually do that in excel? Give a name to a range and
2069 then use that name over and over again? wow. could have saved me
2070 an hour of my life knowing that
2071
2072~rabsef ok - so lines 8 and 14 in a file in gen called something.hoon -
2073 where something /isnt/ add because that already has a name
2074
2075 and we can't unname add
2076
2077~rocted got it
2078
2079~rabsef yes, you can, and it does save a ton of time. You can even make
2080 them dynamic so they expand as the range gets more data, using
2081 offset function
2082
2083 For instance, on the file name, my file is named testadd.hoon
2084
2085 once I've saved that I need to commit home bar commit cen home
2086
2087 or |commit %home
2088
2089~rocted incidentally I also have the add item in the standard library
2090 also open
2091
2092~rabsef You know, it would have been smart of me to look @ that
2093
2094 lol
2095
2096 when you commit home on your commet it will take a second and
2097 then it should show you that it read that file into the state
2098
2099 lmk when done
2100
2101 it will explicitly name your file in dojo
2102
2103 ere moon
2104
2105~rocted ok going to commit
2106
2107~rabsef sorry to denegrate your moon
2108
2109~rocted ok now how do we use this new +testadd program?
2110
2111~rabsef in dojo but let's think about what we said we were going to give
2112 the program
2113
2114~rocted commit complete (pretty quickly)
2115
2116~rabsef I just spammed myself testing something that was wrong to see
2117 whta it would do
2118
2119 knowing that we call a generator and knowing what our a=spec
2120 was, what do you think we should do
2121
2122 (point of my spam message was i just cleared the screen so don't
2123 see anything above pretty quickly)
2124
2125 also - let's talk about number format in hoon/urbit while you
2126 think about it
2127
2128~rocted I think we should do +testadd [2 3] and it will output 5
2129
2130~rabsef you're familiar w/ the number format? Like roman numerals,
2131 nothing greater than 3 numbers together
2132
2133~rocted nope!
2134
2135~rabsef ok - so 300 is fine
2136
2137~rocted sorry nope was because I caused an error
2138
2139~rabsef that should work actually lol
2140
2141 one sec
2142
2143 what do you get when you try that
2144
2145 to be clear you did name your function testadd.hoon
2146
2147 ?
2148
2149~rocted let me check, I thought so
2150
2151 yes, testadd.hoon, located in gen
2152
2153 got an error at [20 68]
2154
2155 I think it needs a final LF
2156
2157 aha it worked!
2158
2159 needed a final LF
2160
2161~rabsef oh so you have the full thing w/ comments
2162
2163 sorry - i just was thinking lines 8 and 14, meaning only 2 rows
2164 and Iw as like [20?~
2165
2166~rocted ok great!!
2167
2168~rabsef LF = carriage return?
2169
2170 yah nice right? So let's make our function slightly more
2171 interesting. Let's add in a value unseen to the user that is
2172 also added
2173
2174 let me write that really quickly and test it - probably 2 min
2175
2176~rocted yes LF = carriage return but specifically the LF type, not the
2177 CRLF type
2178
2179 ok cool. this is fun
2180
2181~rabsef got it - one min
2182
2183 ok - wrote it - going to commit but I'm concerned it might take
2184 a second
2185
2186 so brb
2187
2188 I have no eyebrows - somlus can you fix me?
2189
2190 ok I wrote it and committed it and we're good
2191
2192 We need to learn a new rune to do this
2193
2194 tislas
2195
2196 https://urbit.org/docs/reference/hoon-expressions/rune/tis/
2197
2198 find tislas in there and look @ the first example of the syntax
2199
2200~rocted reading...
2201
2202 I'm glad we're doing this be cause this means of describing is
2203 beginning to get confusing for me.
2204
2205~somlus there are a number of things I do not understand in this tis
2206 text:
2207
2208 "some old subject p" - really? old subject from where? and
2209 what's a subject to be exact?
2210
2211 "So to pin 12 with the face a" - where did the face a come from
2212 in this example?
2213
2214~rabsef that first example looks a lot like what we're doing
2215
2216 wouldn' tyou say
2217
2218 which means - so I'm clear. Me?
2219
2220 Read only "discussion" - that's all we need to know
2221
2222 the rest of it is obnoxiously dense
2223
2224 dotpost
2225
2226 .
2227
2228~somlus ok
2229
2230 got a lot all at once, will read the discussion
2231
2232~rabsef p, the value given to tislas can be of two types. It can have a
2233 type, or it can have no type
2234
2235 recall =| a=@ <- this is typed
2236
2237 ere |= rather
2238
2239 tislas unlike bartis can get typed or not typed. Let's do typed
2240 for our sake
2241
2242~somlus sorry sir there are a lot of discussions because there are a lot
2243 of uses of tis, so I'm a bit lost.
2244
2245~rabsef note the syntax of the second line of the example under
2246 discussion
2247
2248 Discussion
2249
2250 p can be either a name or a name=type. If it's just a name, =/
2251 ("tisfas") "declares a type-inferred variable." If it has a
2252 type, =/ "declares a type-checked variable."
2253
2254 I'm saying it wrong it's tisfas, sorry
2255
2256~somlus ok will find that.
2257
2258 np
2259
2260~rabsef I'm trying to use the spoken names so I learn them
2261
2262~somlus no problem. i'm getting a bit into a confused state so I'm going
2263 to take a bit and try to absorb this discussion section...
2264
2265~rabsef well let's just do one thing before that
2266
2267~somlus ok
2268
2269~rabsef you don't need to know much but this - bartis lets user input
2270 values, tisfas declares a value in the hidden hoon
2271
2272 we have bartis already taking in a cell. We want to add lets say
2273 2 to it covertly, behind the scenes
2274
2275 new pastebin coming
2276
2277 https://pastebin.com/jD5SabXA
2278
2279 I've used 1 instead of 2 but it's the same difference. Find line
2280 14, I've given 1 a face of c
2281
2282~somlus ok cool
2283
2284~rabsef also my add syntax is redundant and I could have just (add a b
2285 c) but my way works too
2286
2287 damned transitive property
2288
2289 tbh i didn't realize add could take n values
2290
2291~somlus ok I added that file. what will you call it so that we have same
2292 names? I'll save and commit
2293
2294~rabsef I re-saved it as testadd
2295
2296~somlus no worries we are learning together.
2297
2298~rabsef since we don't need consistency or persistence of our original
2299 function
2300
2301~somlus ok I'll call it testadd2.hoon because I might want to go through
2302 the entire chat again on my own.
2303
2304~rabsef roger that - so if we resave as such (not sure how numbers work
2305 in the name incidentally, probably ok)
2306
2307 if we +testadd2 [1 1] what should we get?
2308
2309~somlus ok cool, got it, it adds 1 in addition to the items
2310
2311 should be 3
2312
2313~rabsef what do we get?
2314
2315~somlus boom it worked
2316
2317 3
2318
2319~rabsef f'in a man
2320
2321 right?
2322
2323 pretty cool
2324
2325~somlus yeah!!! mothef-er!
2326
2327 awesome.
2328
2329 ok so question
2330
2331~rabsef let me pull up hoon school activity week 2 - I'm going to get
2332 that done this week and we can go thru that next
2333
2334~somlus can I also say that =/ will set the value of a variable? or is
2335 that not specific enough in CS terminology
2336
2337~rabsef I'm getting close to my termination point - need to eat dinner
2338 at some point
2339
2340 hit me w/ ur question
2341
2342~somlus yeah me too, but this is f-ing awesome. so fun.
2343
2344~rabsef So I think technically =/ sets a constant
2345
2346 right?
2347
2348~somlus yeah ok.
2349
2350 right
2351
2352~rabsef because we're not changing 1 by the rest of our hoon
2353
2354~somlus I think I should not burn my brain out but, in addition to the
2355 learning, we have also figured an awesome conversation flow and
2356 work flow to get this done. This is great!
2357
2358~rabsef but yah a variable is just a changing constant or rather a
2359 constant is a trivial variable
2360
2361~somlus correct, unless we rename it later with another constant, so yes
2362
2363~rabsef Yah I really like this - I learn a lot by telling
2364
2365~somlus I figured that might be a side benefit, but on my end this is
2366 just fantastic.
2367
2368~rabsef trivial is a term they use a lot - it means the dumbest case of
2369 something
2370
2371 a leaf is a trivial branch
2372
2373 an atom is a trivial noun
2374
2375~somlus ah got it that is helpful
2376
2377~rabsef perhaps a commet is a trivial @p (name of ship aura)
2378
2379~somlus makes sense, for sure.
2380
2381 ok I think i actually have enough to go on here that I want
2382 to review the whole conversation and code again on my own. If
2383 you're ok with it we can call it a night, I'll do my review and
2384 we can pick up if you like at some convenient time that works
2385 for us down the road. This is really great!
2386
2387 Thanks!
2388
2389~rabsef one more thing - let me check that assignment and give a
2390 prospectus as to where we're going
2391
2392 ok - next time we are going to make a hoon that checks if an
2393 incoming noun is a cell or atom, that then outputs that and then
2394 finally checks, if atom, whether it is odd or even
2395
2396~tocref The assignment looks lovely!! I recommend giving constants and
2397 variables more descriptive names ususally, but in something like
2398 this it's a bit self-explanatory so it's not necessary
2399
2400 The longer names are for your sake, as it's easier to figure out
2401 what everything means coming back to it after a week or so ––
2402 It's also a massive help to anyone else who reads your code
2403
2404 This applies to every modern programming language, not just hoon
2405
2406~somlus awesome rabsef, looking forward. I will solidify what we covered
2407 today so I am not deadweight as we move forward.
2408
2409~rabsef that is a very good call toc
2410
2411 Next week we will have complex names
2412
2413 meaningful ones
2414
2415 not dead weight at all - the questions draw attention to what I
2416 do not understand
2417
2418 which is great compared to that which I do
2419
2420~somlus understood tocref, so you are referring to the a, b, and c we
2421 used, and do you have any suggestions as to what cultural norms
2422 make sens for naming variables?
2423
2424 ok great! so glad this has value. Had loads of fun by the way.
2425
2426~rabsef likewise
2427
2428 this was a great idea
2429
2430~somlus And thanks for the outstanding comments on the two programs!
2431
2432~tocref Here you're literally adding 3 numbers so it's hard to be more
2433 descriptive lol
2434
2435~rabsef ok boys I got the dinner bell, and don't call me late
2436
2437~tocref Especially because you also comment a line-by-line description
2438 of how it works
2439
2440 num-1, num-2, and num-3 would work well (hoon styleguide likes
2441 all lowercase with dashes as spaces for variable names)
2442
2443~rocted ok understood lowercase, dashes, and just a shortened version of
2444 exactly what it is. thanks.
2445
2446~rabsef be on later boys - probably
2447
2448 join ~rabsef-bicrym/lbsandkilos if you're into fitness - I feel
2449 I get a free plug for all that typing
2450
2451 lol
2452
2453~somlus ok will do!
2454
2455 I'm going to close out for the night. thanks for all the help!
2456
2457~bannum dot
2458
2459~ronreg ~rasbef-bicrym: that's an interesting idea and I gave it a shot
2460 myself
2461
2462 but I don't know why my solution isn't compiling
2463
2464 ( https://pastebin.com/eW1bxbNR )
2465
2466 I'm not sure if you were suggesting doing this in some kind of
2467 structured way
2468
2469~somlus I say we do it whenever and ongoing. I've just been on a 10 hour
2470 flight so I was quiet
2471
2472~rabsef ~ronreg-ribdev - I haven't finished yet so I don't want to look
2473 @ your solution but I will once I've finished coding mine
2474
2475 terribly sorry
2476
2477~risruc https://pastebin.com/tPRPkgrP
2478
2479 here's what i got
2480
2481~filsur /leave ~paldev/nopub
2482
2483 chats;
2484
2485~ronreg ~risruc-habteb: looking at your solution, I think my problem was
2486 something involving types
2487
2488 I was trying to use %odd-atom %even-atom and %cell as the thing
2489 I returned, but I suspect that doesn't actually type-check
2490
2491~risruc I'm not sure what is the proper way to do what you were trying.
2492
2493 above my pay grade!
2494
2495~happyl test
2496
2497~fabled test works
2498
2499~ronreg ~risruc-habteb: your solution involves returning one of three
2500 strings to indicate which of the three possibilities the input
2501 was, whereas I was trying to do this by returning one of three
2502 %symbols
2503
2504 but I think that might be a type error, to have multiple
2505 branches of a conditional return different %symbols
2506
2507 on the other hand, `?: =(1 1) %hella %brah` works in the dojo
2508 (it returns %hella)
2509
2510 so maybe I'm still misunderstanding some finer point about
2511 %symbols :)
2512
2513~rabsef I'm ready to do next week
2514
2515 https://pastebin.com/1rnWp8nt
2516
2517 Let's (~somlus when you're ready and back stateside?) plan
2518 another sesh - I really enjoyed that
2519
2520 ~ronreg - this fixes your solution. You weren't using wuttis
2521 correctly (I think that takes p type q hoon)
2522
2523 https://pastebin.com/SY3GNipp
2524
2525 but also that's not technically a naked gen, that's a %say
2526 generator
2527
2528~ronreg ah okay
2529
2530 ah okay so ?= was just totally the wrong rune to use
2531
2532 so it was a type error, not just the one I thought it was :)
2533
2534~rabsef you can use ?= in a dofferent context tho as the head of wutcol
2535
2536 but yah :)
2537
2538~somlus totally I'm in for another sesh for sure next week or if I can
2539 work out my schedule over here even sooner
2540
2541~rabsef Assignment 3 today - I did fibonacci sequence previously so this
2542 one should be pretty easy, but the tail recursion is still a
2543 little confusing
2544
2545 so I did it but I can’t get the error checking right
2546
2547 sick - that's at least 2 pieces of content we can work thru
2548
2549 Got it
2550
2551~somlus I'm impressed with your persistence rabsef! Will dive back in,
2552 in the next few days and keep you posted.
2553
2554~rabsef I’m going to make something in this before I die. I will, with
2555 my will.
2556
2557 maybe I should say explicit children - they can be discrete but
2558 needn’t be
2559
2560 the best part of Hoon is discrete children of operations,
2561 meaning you never get an excel “you forgot a close paren
2562 somewhere” thing
2563
2564~ronreg yeah the syntax of hoon is very interesting
2565
2566~rabsef speaking of, ~somlus - you should check out the 1.5 Lists
2567 walkthrough and familiarize yourself w/ the basic concepts, as
2568 well as 1.4.1 Recursion - we can go through both of those and do
2569 all the exercises together for next session
2570
2571~somlus Trying to work out the international time zone thing. It looks
2572 like unless you keep odd hours, the only reasonable period to do
2573 this is your morning, my later afternoon. Was hoping to get some
2574 things down on my own though before our next hoontards sesh.
2575 Would your preference to be to charge ahead tomorrow (Sunday),
2576 or New Years' eve or New Years' day (morning) or just wait a
2577 week or so until I return to the states?
2578
2579 ~rabsef
2580
2581~rabsef I am happy to do it when you feel ready. It sounds like that
2582 would be maybe when you return? Giving you time to forge ahead
2583 and gather questions - absolutely no rush
2584
2585 lol
2586
2587 just wrote fibonnaci in 1 try - I feel learning happening
2588
2589 fibonacci*
2590
2591~socsen Hi! I'm not officially apart of hoon school but I've been going
2592 through the documentation on my own...... Is there a link to the
2593 assignments? Would like to give them a shot.
2594
2595~rabsef ~socsen - join ~borlyt-salnus/file-exchange
2596
2597 I posted them there for someone else
2598
2599~socsen I tried joining but got: permission-hook failed subscribe on
2600 /chat/~borlyt-salnus/file-exchange/read
2601
2602~rabsef I've asked the owner of that if they'll invite you
2603
2604 I can post it here later, or make another forum, but I don't
2605 want to spam if I can avoid
2606
2607 Apropos of hoon school, I just finished lesson 4 - 2 more and 6
2608 hasn't been posted yet. I'm going to catch up this weekend.
2609
2610~socsen Thank you :)
2611
2612~somlus Testing a post from beneath the english channel on a bullet
2613 train.
2614
2615 Testing a post from beneath the english channel on a bullet
2616 train.
2617
2618 Testing a post from beneath the english channel on a bullet
2619 train.
2620
2621 Testing a post from beneath the english channel on a bullet
2622 train.
2623
2624 Testing a post from beneath the english channel on a bullet
2625 train.
2626
2627 Testing a post from beneath the english channel on a bullet
2628 train.
2629
2630 Testing a post from beneath the english channel on a bullet
2631 train.
2632
2633 Testing a post from beneath the english channel on a bullet
2634 train.
2635
2636 Testing a post from beneath the english channel on a bullet
2637 train.
2638
2639 Testing a post from beneath the english channel on a bullet
2640 train.
2641
2642 Testing a post from beneath the english channel on a bullet
2643 train.
2644
2645 Testing a post from beneath the english channel on a bullet
2646 train.
2647
2648 Testing a post from beneath the english channel on a bullet
2649 train.
2650
2651 Testing a post from beneath the english channel on a bullet
2652 train.
2653
2654 Testing a post from beneath the english channel on a bullet
2655 train.
2656
2657 Testing a post from beneath the english channel on a bullet
2658 train.
2659
2660 Testing a post from beneath the english channel on a bullet
2661 train.
2662
2663 Testing a post from beneath the english channel on a bullet
2664 train.
2665
2666 Testing a post from beneath the english channel on a bullet
2667 train.
2668
2669 Testing a post from beneath the english channel on a bullet
2670 train.
2671
2672 Testing a post from beneath the english channel on a bullet
2673 train.
2674
2675 Testing a post from beneath the english channel on a bullet
2676 train.
2677
2678 Testing a post from beneath the english channel on a bullet
2679 train.
2680
2681 Testing a post from beneath the english channel on a bullet
2682 train.
2683
2684 Testing a post from beneath the english channel on a bullet
2685 train.
2686
2687 Testing a post from beneath the english channel on a bullet
2688 train.
2689
2690 Testing a post from beneath the english channel on a bullet
2691 train.
2692
2693 Testing a post from beneath the english channel on a bullet
2694 train.
2695
2696 Testing a post from beneath the english channel on a bullet
2697 train.
2698
2699 Testing a post from beneath the english channel on a bullet
2700 train.
2701
2702 Testing a post from beneath the english channel on a bullet
2703 train.
2704
2705 Testing a post from beneath the english channel on a bullet
2706 train.
2707
2708 Testing a post from beneath the english channel on a bullet
2709 train.
2710
2711 Testing a post from beneath the english channel on a bullet
2712 train.
2713
2714 Testing a post from beneath the english channel on a bullet
2715 train.
2716
2717 Testing a post from beneath the english channel on a bullet
2718 train.
2719
2720 Testing a post from beneath the english channel on a bullet
2721 train.
2722
2723 Testing a post from beneath the english channel on a bullet
2724 train.
2725
2726 Testing a post from beneath the english channel on a bullet
2727 train.
2728
2729 Testing a post from beneath the english channel on a bullet
2730 train.
2731
2732 Testing a post from beneath the english channel on a bullet
2733 train.
2734
2735 Testing a post from beneath the english channel on a bullet
2736 train.
2737
2738 Testing a post from beneath the english channel on a bullet
2739 train.
2740
2741 Testing a post from beneath the english channel on a bullet
2742 train.
2743
2744 Testing a post from beneath the english channel on a bullet
2745 train.
2746
2747 Testing a post from beneath the english channel on a bullet
2748 train.
2749
2750~rabsef lol received
2751
2752 also that’s awesome
2753
2754~rivmep spam test
2755
2756~somlus wow! I wonder why it spikes a ton of echoes like that when I'm
2757 on a weak signal. Well, there you have it. at least it worked!
2758
2759 If anyone was wondering, that was a 46 item echo from a single
2760 post.
2761
2762~rabsef How was the train, m8?
2763
2764~somlus wow we humans are badasses. What wonderful technology that was
2765 to zip along, comfortably swaying at a fast clip, and then dip
2766 beneath the ocean (holy cow) and pop up in Great Britain.
2767
2768~rabsef how long and did you have a sleeper/couchette?
2769
2770 I remember taking train trips with my grandfather and getting to
2771 sleep in the like drop down bed from a bulkhead in the sleeper
2772
2773~hanryc lol
2774
2775~rabsef ~socsen - you should have gotten an invite to file-exchange
2776
2777 ~borlyt (owner) said they would get it to you
2778
2779~somlus Sorry for the delay. No sleeper needed! Paris to London in just
2780 over 3 hours. The scenery was interesting and fast enough to
2781 keep us captivated. We did travel in premium seats which came
2782 with a pretty good meal!
2783
2784~rabsef nice - rail travel is p. dope
2785
2786~ronreg one of the things I'm finding in the process of trying to learn
2787 hoon
2788
2789 is that I have trouble keeping straight lots of concepts
2790 pertaining to cores
2791
2792 exactly what a battery, sample, payload, etc. are
2793
2794 and what the semantics of core arms/legs are wrt the subject
2795
2796 I can conceptualize a core as a collection of functions that are
2797 either grouped together for organizational reasons or because
2798 they operate on shared data - that is pretty similar to a
2799 classic OOP class
2800
2801~rabsef I think that stuff is complex too. battery = operations and
2802 payload = sample + context, which is the totality of the subject
2803 as far as I can tell. except, the core itself is either part of
2804 the context or sample and therefore seemingly the battery is in
2805 the payload
2806
2807 lol
2808
2809~socsen ~rabsef I believe I've joined but the chat is not showing up on
2810 my chats menu and I'm not receiving any messages :(
2811
2812~rabsef ~socsen - does it show in ;what from chat-cli?
2813
2814 I assume this means you're still pulling the backlog and it's
2815 taking a while
2816
2817 this is normal - and may take a little longer
2818
2819~somlus How is it now worsen?
2820
2821 Sorry autocorrect. meant socsen
2822
2823~socsen Still no luck. My chat cli is
2824 :chat-cli[~borlyt-salnus/file-exchange]
2825
2826 I see what you're asking....... after typing ;what that chat
2827 isn't showing up
2828
2829 I've inspected the network calls and the array that comes back
2830 says I have permissions to join so I'm not sure.
2831
2832~rabsef You appear to be in it
2833
2834 try binding it - I think it's ;bind glyph chat
2835
2836 also try |hi-ing the host ~borlyt-salnus
2837
2838 Also, I did just repost it there so when you do get access, you
2839 should see it.
2840
2841~socsen Still no luck grrr..... I tried |hi-ing the host ~borlyt-salnus
2842 that came back succesful.......... i also tried |hi-ing ~borlyt
2843 but this just hangs for me
2844
2845~rabsef https://cdn.discordapp.com/attachments/502183430583484418/661239
2846 661863108628/Welcome_to_Hoon_School_101.docx
2847
2848 ~borlyt was kind enough to provide this
2849
2850 https://cdn.discordapp.com/attachments/502183430583484418/661239
2851 666279841812/Welcome_to_Hoon_School_101.pdf
2852
2853~socsen <3
2854
2855 Thank you I'm sorry this has been so much trouble
2856
2857~rabsef do ;bind <a glyph you haven't used yet in ;what> ~borlyt-salnus
2858 in chat-cli
2859
2860~somlus Hey were you doing that so you could get the hoon school
2861 assignments? I forgot the purpose
2862
2863 Here are two other versions that might help:
2864
2865 https://www.dropbox.com/s/bre7oib2qasd519/Hoon%20101%20Course%20
2866 Materials.pdf?dl=0
2867
2868 https://www.dropbox.com/s/d4vguf42q17t6om/Hoon%20101%20school%20
2869 posts%20%28updated%20version%20with%20links%29.docx?dl=0
2870
2871 Hey question guys - when I posted "Testing a post from beneath
2872 the english channel on a bullet train." - did you also see it
2873 like 40+ times in a row or was that just on my end? Submitted a
2874 github issue and they asked me.
2875
2876~socsen Yes that was the purpose! Thank you!
2877
2878 I saw it like 40 times^^
2879
2880~rabsef likewise
2881
2882~somlus thanks for that info.
2883
2884 socsen I updated the word document file with week 6 stuff so if
2885 you need that one please download it again. Should be the same
2886 link as the filename is the same.
2887
2888~ronreg hoon exercise that might be interesting
2889
2890 (that I just did)
2891
2892 take the code in :
2893 https://urbit.org/docs/tutorials/hoon/libraries/
2894
2895 and edit it such that the value of a playing card is an actual
2896 playing card value (ace, 2, 5, king, etc.) rather than just an
2897 integer
2898
2899~minder ~ronreg, this is the content I'm here for.
2900
2901~somlus Sir rabsef! How's it going today, and how are your synapses
2902 reorganizing around hoon these days?
2903
2904 Just read in Minder's party that you did week 5 of hoon school -
2905 impressive.
2906
2907~rabsef I am beginning to awaken
2908
2909 i feel it percolating up from the subject of my mind to the
2910 operational arms as samples and context
2911
2912 i would call myself a beginner now, after being a nothing
2913
2914 I am excited to do some more with you.
2915
2916~somlus That is truly inspiring. I love the moment in learning when
2917 the head fog (and insecurity) starts to clear. Slowly becomes
2918 focus/understanding/power, which rocks.
2919
2920~rabsef I will get there - I will not give up on this
2921
2922 I'm going to make something, so help me lol
2923
2924~somlus How's your Sunday ~rabsef? I could do some hoontarding later
2925 this morning or later afternoon (PST).
2926
2927~rabsef we can do after church, around 9:30 mountain so 8:30 your time
2928
2929 i need to write first edition of 52 Sundays so I’ll be taking
2930 notes
2931
2932 Build a naked generator that takes a noun and checks if that
2933 noun is a cell or an atom. If that input noun is an atom, check
2934 if it’s even or odd. The output should be of the tape type. A
2935 tape is a string.
2936
2937 https://urbit.org/docs/tutorials/hoon/hoon-syntax/
2938
2939 https://urbit.org/docs/tutorials/hoon/conditionals/
2940
2941 lets look at this assignment and these articles
2942
2943 we didn’t do that yet right?
2944
2945~somlus Cool. I have gym time at 10am so that's a good hard stop right
2946 before that.
2947
2948~rabsef heading back mow
2949
2950~somlus ?
2951
2952~fogdeg Ready as moon
2953
2954 (i think)
2955
2956 I booted this moon and it's taking a long time to sync the chat,
2957 but I can see that these messages are sending so we're pretty
2958 good.
2959
2960 test
2961
2962~rabsef hey I'm here
2963
2964 sorry about taking so long
2965
2966 Hey ~somlus-savlev - I am here
2967
2968~fogdeg no worries!
2969
2970 Just setting up my wife's ship again, had to breach
2971
2972 how are you? How was the holiday? Looks like you remained fired
2973 up and excited to work on hoon.
2974
2975~rabsef Nice. And yah - I actually got a lot of the work done. I'm on
2976 the last week and if I complete it today (iffy) then I will
2977 actually be submitting it on time, I think.
2978
2979~fogdeg unbelievable! That's quite an achievement.
2980
2981~rabsef I feel more comfortable than I have before in hoon and the
2982 assignments are coming w/ less and less help
2983
2984~fogdeg Since we only have an hour or so, maybe it would be a good use
2985 of time to cover some "wish you had known" things - what do you
2986 think?
2987
2988 I'm sure you have had lots of epiphanies in the last few weeks.
2989
2990~rabsef Yes - that sounds good. I think the first thing to note is that
2991 there's a difference between a gate and a door. And, generally,
2992 what a gate is
2993
2994 Are you familiar w/ gates at all so far?
2995
2996 we made a gate last time when we asked for a noun (an argument)
2997 and cast it as a different type of noun
2998
2999~fogdeg correct.
3000
3001 What I should do is take more notes and review them before we
3002 meet again. I'll start doing that.
3003
3004~rabsef Well I could have been more communicative about a plan but I
3005 think just following hoon 101 for now is probably pretty smart
3006
3007~fogdeg oh that's great. I'll reinvigorate my verve to do that.
3008
3009~rabsef So a gate and a door. A gate is a "core". A core is a battery
3010 payload cell [battery payload]. The battery an "arm" (some cores
3011 can have multiple arms using barcen, we'll get to that later)
3012
3013 An arm is effectively an operation as part of a function. To
3014 review the "mathematical" definition of a function, a function
3015 is an operation where, given the same arguments, you get the
3016 same result, always
3017
3018 this is big in hoon and urbit - it's why we have a deterministic
3019 system and why they say urbit and hoon are referentially
3020 transparent
3021
3022 all operations, giv en the same steps, lead to the same rome as
3023 it were
3024
3025~fogdeg yes. As you might recall I often find Excel comparisons helpful
3026 so if that applies here, feel free to make those analogies.
3027
3028 Will read the above carefully.
3029
3030~rabsef so back to gate qua core. A gate is a core w/ an arm (battery)
3031 and a payload. A payload is another cell [sample context]
3032
3033 Ah yes in excel, a gate is effectively like this [=excel
3034 function [arguments to excel function - the whole rest of your
3035 worksheet]
3036
3037 ^]
3038
3039~fogdeg Battery is something that is done to something?
3040
3041~rabsef yes
3042
3043~fogdeg got it, i'm back on track now
3044
3045 payload is like a type of output but in the format of a cell?
3046
3047~rabsef [Excel Function [Arguments - Worksheet]] to clarify my typing
3048 there. So "worksheet" - this is why they call this a subject
3049 oriented programming language - this is something a little
3050 beyond my comprehension but basically, the entirety of the
3051 operating environment is always considered in your operations -
3052 if it is not necessary it is ignored but it is there to be used
3053 if you want
3054
3055 payload is the arguments - so if we have say =sum, right? We
3056 might say the core would be like [=sum [(1, 2) (everything else
3057 on the worksheet)]]
3058
3059 we would get 3 from this because sum only uses "the sample"
3060
3061~fogdeg why even include the (everything else in the worksheet)?
3062
3063 if it is to be ignored?
3064
3065~rabsef because it often is not ignored. In this way you needn't
3066 reprogram (mul) the hoon multiply program in every program you
3067 write
3068
3069 the standard library of programs available to you , and indeed
3070 any programs you write become part of the context
3071
3072 [battery [sample context]]
3073
3074~fogdeg ok got it
3075
3076~rabsef ok so when you create a gate, you need to provide an argument
3077 (mostly) or else it's a door (I think). Doors can trip w/o
3078 samples. But let's focus on gates.
3079
3080 And this will make context more clear
3081
3082~fogdeg ok
3083
3084 perfect
3085
3086~rabsef You can do this in dojo. You can create a bound value in the
3087 context "=b 10"
3088
3089~fogdeg done
3090
3091~rabsef now if you create a gate, you can use b indiscriminately, even
3092 if you unbind b
3093
3094 so lets make that gate as this "=tenlus |=(a=@ (add a b))"
3095
3096 what should that do?
3097
3098 if we operate it
3099
3100 Incidentally, I think it is called kicking a gate, and slamming
3101 a door when you operate them
3102
3103 Let's go throug heach part. =tenlus just gives us the name of
3104 the function
3105
3106~fogdeg ok
3107
3108~rabsef |= is how you call the gate and a=@ tells us we have what sort
3109 of argument?
3110
3111~fogdeg got it
3112
3113~rabsef or rather that tenlus expects what sort of sample?
3114
3115~fogdeg understood, since we used that before
3116
3117~rabsef right so that's a noun that is an atom in this case, with no
3118 further context (typing)
3119
3120 then add is fairly clear, so =tenlus will give us a + b where a
3121 is our sample and b comes from the context
3122
3123 [battery [sample context]]]
3124
3125 let's try it (tenlus 15) should result in 25
3126
3127~fogdeg got it, so in plain english you created a function to add 10 to
3128 a real number that is input in the dojo
3129
3130 bingo
3131
3132~rabsef technically we're not saying a real number I guess - we're
3133 saying an atom which could be an @p or any number of types, save
3134 a cell or a tape or other types that are non-atomic
3135
3136 but yes - otherwise. Just bear in mind that it could be
3137 something strange and non numeric
3138
3139 the reason for that is that all values in hoon are effectively
3140 numbers in nock
3141
3142 if you were to `@ud`~somlus-savlev in dojo you will get your
3143 planet number
3144
3145~fogdeg got it. In a way I'm still "translating" to my pre-hoon way of
3146 describing things. That's why I do that. I know that eventually
3147 I'll need to use this new vocabulary because it is more precise
3148 for this environment
3149
3150 yes, got it.
3151
3152~rabsef I think it's important to make referential comparisons tho -
3153 believe me when I say I'm trying that too lol
3154
3155~fogdeg Agreed - it's a temporary crutch that we both hope to graduate
3156 from.
3157
3158~rabsef ok - so important note. You can not only modify your sample
3159 (e.g. (tenlus 25)) but you can modify your context - they call
3160 this making a mutant version of teh core w/ a mutant version of
3161 the context
3162
3163~fogdeg can you explain context further?
3164
3165~rabsef oh first - let's prove that the context is bound into the core
3166
3167~fogdeg ok
3168
3169~rabsef unbind b 1) first hit b in dojo and enter, and you should get 10
3170
3171 then 2) =b with nothing following and enter unbinds it
3172
3173 3) b again should give you a find.b error
3174
3175 now try (tenlus 10) and you will still get 20
3176
3177 this is also part of something important about hoon - I don't
3178 quite understand it but basically dependencies get rolled into
3179 cores by ford when they are compiled using |commit (or just as
3180 part of dojo actions which ford also manages)
3181
3182~fogdeg interesting.
3183
3184 so the value stored in b survives the existence ofb in a way
3185
3186~rabsef the entirety of the "state" is rolled in, as needed, yes.
3187
3188 "state" is something like operating environment at the time of
3189 creation, e.g. worksheet
3190
3191~fogdeg perhaps it's a bit like 'commit' in that it is stored in two
3192 places and changing it in one does not necessarily change the
3193 other
3194
3195 got it
3196
3197 at the time of creation...
3198
3199~rabsef now let's mutate tenlus
3200
3201~fogdeg ok
3202
3203~rabsef (tenlus(b 15) 10)
3204
3205 will give us what
3206
3207~fogdeg 25
3208
3209 because b is now zero?
3210
3211~rabsef and to restate what it's doing when it does that is recreating
3212 the core at runtime w/ a fake context. B is now 15 using the (b
3213 15) part of the above
3214
3215 25 is right but b is either 10 in the normally defined tenlus,
3216 despite being unbound, or 15 in the mutant variet
3217
3218 y*
3219
3220~fogdeg ah I thought it was adding b and 15 and then adding 10, to get
3221 25
3222
3223 it was defining b as 15
3224
3225~rabsef correct - to the latter
3226
3227 ok - what next lol
3228
3229~fogdeg I do not fully understand "mutant variety" - is it not confusing
3230 to have two states to one thing?
3231
3232~rabsef ok - good question. tenlus will forevermore (until we unbind it
3233 and rewrite it completely) have a state where b=10
3234
3235 it is so written, it will be so done - hoon is just like that
3236
3237~fogdeg ah! thank you for explaining that
3238
3239~rabsef "mutating" - imagine you have a program that you want to test
3240 new values against - this would be the mutant case
3241
3242~fogdeg got it.
3243
3244~rabsef "Ford" is a vane that does that work for us - when it compiles
3245 a program of hoon, it takes the context into consideration,
3246 looks @ the relevant parts, and binds them into the program
3247 permanently
3248
3249~fogdeg ok
3250
3251~rabsef I /think/ that's actually a tiny bit misleading. Ford can also
3252 do something where, if the context changes (in a non mutant way)
3253 e.g. if you rebind b to something else now, it will know to
3254 recompile tenlus, but that's a little beyond our means right now
3255
3256 Ted B. (~rovnys) did a good talk about leafs and recompiling but
3257 I don't really understand all of it
3258
3259~fogdeg very interesting. Is there a 'big picture' way to describe why
3260 it is so important to do it this way? I am guessing because this
3261 system lives in a networked world that changes over time, so
3262 it's important to be able to calculate what was true in a prior
3263 time...
3264
3265~rabsef it is enough to know, now, that a program uses the bound state
3266 at time of compile and that you can poke values in the context
3267
3268~fogdeg ok I'll take a look at that talk. It's a link in the hoon school
3269 assignments?
3270
3271 ok got it
3272
3273~rabsef that's exactly it - if the context is important and if
3274 ford knows the context, it can recompile efficiently when
3275 dependedencies change
3276
3277 e.g. when =b is rebound to lets say 15. In larger programs let's
3278 say chat-cli is dependent on ames, and ames changes, chat-cli
3279 will be recompiled by ford automatically
3280
3281 this is how OTAs are done
3282
3283 I'll find that talk and post it here.
3284
3285~fogdeg ok that is helpful. how interesting and complex to create
3286 something like that.
3287
3288~rabsef right?!
3289
3290 lol
3291
3292~fogdeg amazing.
3293
3294~rabsef for the sake of brevity I'm going to give us the program for the
3295 assignment and we can quickly talk throug hit
3296
3297~fogdeg cool
3298
3299~rabsef The assignment again was to make a "naked generator" (i.e. a
3300 core w/ no special properties) that tells us if an incoming
3301 values is a cell, or an atom and if an atom, if odd or even
3302
3303 as follows
3304
3305 |= a=*
3306
3307 ?: ?=(@ a)
3308
3309 ?: =(0 (mod a 2))
3310
3311 "atom-even"
3312
3313 "atom-odd"
3314
3315 "cell"
3316
3317 there are several important things going on here
3318
3319~fogdeg I'm following.
3320
3321~rabsef First, remember that wutcol, the conditional (basic) always
3322 takes two children
3323
3324 that's why we don't need to close paren around arguments as
3325 withexcel
3326
3327~fogdeg got it
3328
3329~rabsef ok so from top to bottom - we ask to form a gate, where the
3330 argument is * (a noun of any kind)
3331
3332 second, we ask "is this noun an atom?" If so, we do the next
3333 3 lines, if not we output "cell" because there are only two
3334 options
3335
3336 atom or cell
3337
3338 we know we jump down to cell because, again, wutcol takes 2
3339 arguments (and for the second wutcol they are "atom-even" and
3340 "atom-odd")
3341
3342 not arguments - something like conditional outputs
3343
3344 one for %.y and one for %.n
3345
3346 %.y and %.n are the booleans for yes and no, true and false,
3347 just as in excel
3348
3349 they can also be abbrv. & for %.y and | for %.n
3350
3351 are you familiar w/ the math operation modulo?
3352
3353~fogdeg I am not
3354
3355~rabsef I was not either. Modulo is important in programming, I guess,
3356 but it just means give me the remainder
3357
3358 3 mod 2 is 1
3359
3360 it goes in 1 time with 1 remaining
3361
3362~fogdeg got it ok
3363
3364~rabsef thus 5 mod 2 is also 1
3365
3366~fogdeg got it ok
3367
3368~rabsef so our second conditional says IF (a - our atom - mod 2)=0, then
3369 %.y, else %.n
3370
3371 and wutocol ?: says if yes, do my first output if no do my
3372 second
3373
3374 thus ?: =(0 (mod a 2)) "atom-even" "atom-odd" says what
3375
3376~fogdeg ah!
3377
3378~rabsef it becomes so clear as you learn it but it is hard to learn imo
3379 lol
3380
3381~fogdeg so if there is no remainder, then of course it's even. if there
3382 is a remainder then it's odd
3383
3384 yeah i am feeling that. Part of my goal is to continue to
3385 work on this so that I can eventually explain it very well to
3386 non-coders.
3387
3388~rabsef Thus our formula in excel would be similar to this {bear in mind
3389 that there is no comparison to cell and atom in excel, really}
3390 =IF(a="atom",IF((a mod 2)=0,"even","odd"),"cell")
3391
3392~fogdeg wow that's cool. and you're right we'd have t come up with a way
3393 of defining a cell in excel for that to work.
3394
3395~rabsef we could say something like isnum or something
3396
3397~fogdeg That excel reference actually really helps me.
3398
3399~rabsef but that's still not right really - but for our purposes it's
3400 fine
3401
3402 we must just remember that an atom is a leaf in a tree and a
3403 cell is a complex branch
3404
3405~fogdeg yeah good point.
3406
3407~rabsef an atom is a trivial branch of a tree, a leaf
3408
3409~fogdeg that much I've got! thankfully
3410
3411~rabsef yes great. Where to next
3412
3413 let me think
3414
3415~fogdeg good question. Maybe I should focus on this one example for a
3416 while. I have to leave for the gym in 15 mins anyway.
3417
3418~rabsef yes - good - do you want to guide me through any parts you're
3419 having issue w/?
3420
3421~fogdeg This is actually a very good exercise to learn more basics and
3422 also some logic language.
3423
3424~rabsef It's extremely helpful to me to restate it
3425
3426 lol
3427
3428~fogdeg yes
3429
3430 ok
3431
3432~rabsef It's like studying only not boring
3433
3434~fogdeg so ?: has two children but ?= is a simple question that
3435 immediately follows?
3436
3437 that immediately follows ?=
3438
3439 would that be correct?
3440
3441~rabsef Yes - we might say ?: checks a condition and then outputs based
3442 on the boolean output of the condition first %.y and then %.n,
3443 while wuttis (?=) gives us either %.y or %.n
3444
3445~fogdeg but either way there is a 'yes' and a 'no' option that follows
3446 right after that?
3447
3448~rabsef Not exactly. Some wut commands give outputs that are just
3449 boolean. So ?= just outputs either the boolean true or the
3450 boolean false - it is unlike excel's if
3451
3452 it can never give us something other than %.y or %.n
3453
3454 wutcol on the other hand reads the boolean output of a condition
3455 (like wuttis) and then does operations based on that - this is
3456 far more like excel's if
3457
3458 wuttis is like =IF(condition, TRUE, FALSE)
3459
3460 and you could imagine =IF(IF(condition, TRUE, FALSE), True
3461 output, False output)
3462
3463 see the difference there?
3464
3465~fogdeg you mean wutcol or wuttis for that last comparison?
3466
3467 oh yeah, ignore that question
3468
3469~rabsef =IF{wutcol}(IF{wuttis}(condition, TRUE, FALSE)
3470
3471 the important part is that the outputs of wuttis can not be
3472 changed to be other hoon or other outputs like "atom-even"
3473
3474~fogdeg got it.
3475
3476~rabsef while wutcol can be made to do more hoon
3477
3478~fogdeg ok awesome, I have that now.
3479
3480~rabsef Here is one more thing we will need soon - the rune kethep ^-
3481
3482 kethep can be used in a gate to define the output type
3483
3484 in our case we could have ^- tape
3485
3486 because "atom-even" "atom-odd" and "cell" are tapes
3487
3488~fogdeg However in your code I do not see that you used either %.y or
3489 %.n - it seemed to just follow the code, which was to produce an
3490 output.
3491
3492~rabsef but since we "" around them, they are already typed
3493
3494~fogdeg ok got it. I will look into kethep too then
3495
3496~rabsef consider this - ?: (hoon that results in either a %.y or %.n),
3497 %.y condition output, %.n condition output
3498
3499 we could have done other hoon in the parenthetical insertion
3500 outside of ?= but we did something easier this time
3501
3502~fogdeg yes but we used ?= and it theoretically would have just
3503 outputted %.y, and then presumably you would have used that %.y
3504 to output some text on condition %.y
3505
3506~rabsef for instance, we could have done 'not (mod a 2) = 0)' and
3507 switched our output lines
3508
3509~fogdeg but it went ahead and outputted the text so it seems that is
3510 more like ?:
3511
3512~rabsef that is exactly what we did - your first assertion. The ?: uses
3513 the %.y to trigger "atom-even" and the %.n (of ?=) to trigger
3514 "atom-odd"
3515
3516 ?= has no children - if we just had ?= there we would get a
3517 "nest fail" because the lines "atom-even" and "atom-odd" would
3518 not accurately nest under the other hoon present
3519
3520 If we did that - if we just had ?=, the program would read - if
3521 a is an atom, then give me a yes or no as to whether a modulo 2
3522 is 0, else print "atom-even"
3523
3524~fogdeg ok. I'll spend some more time making sure i have this down. It's
3525 nice to have it all here. I have to bounce to the gym (scheduled
3526 gym time) but will check in later for sure.
3527
3528~rabsef and then "atom odd" and "cell" would be errors
3529
3530~fogdeg ok I will look close a that soon to be sure I understand it.
3531
3532~rabsef absolutely - let mek now if you have questions after thinking on
3533 it - I'l lbe online a lot today, ideally
3534
3535~fogdeg Thanks again - this is very fun. Ok cooo, will do.
3536
3537 cool
3538
3539~rabsef have fun at gym :)
3540
3541 ttyl
3542
3543 I had something backwards when I was talking earlier. A gate
3544 is a special case of a door - I thought they were potentially
3545 distinct but I 've just learned and been corrected by the text.
3546 To clarify, a CORE is [battery payload], a DOOR is a core where
3547 the [payload] is [sample context], and a GATE is a door where
3548 [battery] is one arm named $, and [payload] is [sample context].
3549 that is to say a gate is a very simple door which could have
3550 multiple arms (like the %math standard library door) and each of
3551 the arms could potentially be a gate
3552
3553 And, battery and payload are always battery -> the operation(s)
3554 to be done, payload -> the data required to complete those
3555 actions
3556
3557 so potentially there are some cores that are not doors nor
3558 gates, but instead do not require a sample, or do not require
3559 the context
3560
3561~somlus Thanks for this follow-up info - the chat did not autoupdate
3562 until i refeshed. I will take this into account when I dig
3563 deeper into those particular gates / arms. I am at the time of
3564 day when jet lag is the worst and I feel cognitively like I'm at
3565 the very end of an evening of drinking. Hopefully in a few hours
3566 / tomorrow I'll be back to sharp again! I guess it's good that
3567 we did our session in the morning, since I'm pretty useless at
3568 this very moment.
3569
3570~ronreg I'm not clear on the distinction between cores and doors
3571
3572 I'm still thinking of a gate as being analogous to a bare
3573 function and a core as being analogous to an object or struct
3574 with methods or something with a `self` pointer
3575
3576~rabsef Yah I need to see more non door cores to be able to understand.
3577 I lack sufficient other programming knowledge to understand
3578 fully rn I think
3579
3580~somlus In any case thanks for the sesh and for the patience with
3581 explaining. I'll be digging in more over the next week.
3582
3583~rabsef we should do another one next sunday maybe - I like this
3584
3585~somlus ok I'm in for sure. Same time?
3586
3587 I can give you more time to get home so there's no rush. 9am
3588 PST?
3589
3590~rabsef That sounds good, yes!
3591
3592~somlus Great! penciled that in
3593
3594~rabsef https://pastebin.com/ac3Yc1ky
3595
3596 let's walk through the assignment to comment this code.
3597
3598 https://urbit.org/docs/tutorials/hoon/recursion/
3599
3600 This gives it away but we'll frequently need to know how to use
3601 recursion in our programs so you might look @ it too
3602
3603~somlus yes perfect.
3604
3605~hanryc man, i love this channel
3606
3607~rabsef I'm so stumped on Week 6 of hoon school
3608
3609 so we may have a stumbling block lol - I will surmount
3610
3611~hanryc Well, maybe I can help sometime this week. Which assignment is
3612 it? Ahh still generating hands of cards?
3613
3614~rabsef yes
3615
3616~hanryc Cool, I can probably help, although I am not sure if I can
3617 explain things as well as you do. ;) I'll hit you up tomorrow as
3618 I am off to bed now. Goodnight!
3619
3620~rabsef The errors I get are inscrutable to me and that gets frustrating
3621
3622 I feel like I'm close to at least generating a deck of cards and
3623 then I have an idea using snag and oust to generate a hand but I
3624 can't get there w/ the deck
3625
3626 and I absolutely do not want to type out all 52 cards in a list
3627 - that's obviously against the spirit.
3628
3629 that would be awesome ~hanryc, thank you!
3630
3631 got a little closer - I can make a deck of cards
3632
3633 https://pastebin.com/MP7r5uQm
3634
3635 My issue was not understanding that generators have to be gates
3636 (or doors?)
3637
3638 the correct answer is gate. the concept of a door still is
3639 elusive to me, but I get cores and gates now and how a core can
3640 have arms that are gates
3641
3642 and importantly that a generator produces one output from all
3643 its payload, and that is the battery action of one arm, called
3644 buc
3645
3646~hanryc To be honest, I don't think I quite understand doors yet ;) Your
3647 solution is looking good so far
3648
3649~rabsef So I think the only differentiation I have for a door so far is
3650 that they're opened w/ |_ (barcab) and have a sample of their
3651 own there that can either be a bunt value or have a method using
3652 buccab e.g. b=_7 or whatever where that would be an @ud of 7
3653 (inferred).
3654
3655 like I'm not saying that's the right distinction but I do think
3656 that's a distinction lol. Also you slam a door and kick a gate
3657 but I have no clue what that means lol
3658
3659~hanryc Someone described what slam/kick difference was, but i think
3660 it's just how you use them
3661
3662~rabsef Yah - but palfun was trying to tell me why my gen wasn't working
3663 because it wasn't a gate that is kicked the same way and I was
3664 like "yes."
3665
3666 lol
3667
3668~hanryc Anyway, thanks to you i re-read the doors docs (which have been
3669 updated) and I think the biggest difference is that doors have a
3670 sample (state) that is accessible to all the arms
3671
3672 If I recall correctly, I couldn't get it working with hoon 101
3673 week 6 so I just used a core instead.
3674
3675~rabsef I follow you on door definition and that's what I was trying to
3676 express in my limited way. Also, I am going to get this damned
3677 gen to work and then we can tear it apart here eventually
3678
3679~hanryc Looking good so far. I had some weird issues trying to get the
3680 nested trap `|-` working the first time so it took me way longer
3681 than it should have.
3682
3683 Looking good so far. I had some weird issues trying to get the
3684 nested trap `|-` working the first time so it took me way longer
3685 than it should have.
3686
3687~rapfyr is there a reason ya'll don't wanna ask these kinds of things in
3688 the hoon-school chat?
3689
3690~hanryc i either a) didn't know hoon-school existed or b) couldn't get
3691 in when i tried to join
3692
3693~rapfyr i mean presumably some people aren't enrolled. just trying to
3694 figure out if we're doing something wrong.
3695
3696~rabsef This room is really for trying to make the information even
3697 more basic that hoon-school allows for; and also to allow me to
3698 solidify some of my thinking by helping pass the knowledge to
3699 others. I hope that's not frustrating to your purpose
3700
3701 I don't think you're doing anything wrong - I think that hoon
3702 is very complex for people with 0-very little programming
3703 knowledge, and this is a room where we wont annoy other people
3704 by reviewing and reviewing and remediating and reviewing
3705
3706 Actually - I think the lessons could have more readings
3707 associated w/ them and spoon feed the user more but I suspect
3708 that's something I'd like for me, and others wouldn't like, so
3709 it's hard for me to say if that's better or just my preference.
3710
3711 For instance - I think I need a random number generator to
3712 use mod my list length for the card selector, and while your
3713 areology video covered it, I think I need more review - reading
3714 the magic 8 ball text has helped. Unfortunately, one other place
3715 that's used has cards in it so I had to ignore that page because
3716 I don't want to cheat at all - I want to actually learn rather
3717 than just copy
3718
3719 I can draw x number of random cards
3720
3721 now to figure out how to make y sets of x number of random cards
3722
3723~minder I think if all the assignments & instructions were about playing
3724 cards, I'd understand it. X^D
3725
3726~rabsef lol ~minder :)
3727
3728~somlus hi rapfyr - the main reasons I created hoontards are that I
3729 felt my questions were so incredibly basic that my questions
3730 were derailing other more sophisticated conversations by being
3731 inserted into them. People would respond to my simple questions
3732 with a simple explanation that might have spawned another
3733 question or was not even simple enough for me. So this is a much
3734 more dialogue-intense chat with lots of back and for and "wait,
3735 but why?" questions. Perhaps it is simply impostor syndrome but
3736 I did not feel like I belonged in the hoon-school or urbit help
3737 chats and wanted a free space to ask truly basic questions.
3738 Also, though we are using hoon school exercises, the idea was to
3739 do activities that were outside of that scope and perhaps simple
3740 and similar to hoon school exercises, but not at all the same
3741 exercise.
3742
3743~rabsef i fugging did it. lol I made a card generator and I mostly know
3744 what's going on
3745
3746~somlus ????
3747
3748~hanryc nice work!
3749
3750~rabsef https://pastebin.com/v13RdXsR
3751
3752 look @ this ugly bastard
3753
3754 thanks hanryc. I’d like it if we could come up with some other
3755 challenges to keep moving forward with this. I’m at a loss
3756 tonight but I’m going to think of some and start again tomorrow
3757
3758 also thanks somlus :)
3759
3760~rapfyr ayyyyye great work!
3761
3762~rabsef ok I have a challenge for myself. I want to make an ask gen w/ a
3763 loop to play war w/ 1 deck against the computer, w/ x number of
3764 cards
3765
3766 since war doesn't really have any strategy, it should just play
3767 itself based on the cards you play
3768
3769 That's not quite right - that wouldn't be an ask - there's
3770 something there tho. I want to be able to simply allow the user
3771 to select 1 of n cards from their hand and play them against the
3772 computer
3773
3774 and the computer will try to do the same back, w/ higher value
3775
3776 eventually I'd like to make a game
3777
3778~somlus That's a great basic goal. Did you see the landscape tile apps
3779 that came out of some people's hoon 202? Not that you're that
3780 far along but they are cool
3781
3782~risruc ~rabsef, have you read cryptonomicon?
3783
3784 you could build a solitaire cipher
3785
3786 https://en.wikipedia.org/wiki/Solitaire_(cipher)
3787
3788~rabsef I have read the first part of cryptonomicon several times, but
3789 didn't finish
3790
3791 I'll look @ that
3792
3793 good call
3794
3795~risruc you should read it again. it's a blast.
3796
3797~rabsef I loved Anathem - read that?
3798
3799~minder Oh man, that was my favorite sci-fi book until I read the Three
3800 Body Problem.
3801
3802~risruc have not yet, ~rabsef
3803
3804~rapfyr would having a hoon 0 week have been helpful for those of you
3805 who are in 101?
3806
3807~rabsef What would that look like?
3808
3809 For me, having more weeks generally would have been helpful. The
3810 jump from week 1 to even week 2 is quite a bit of intellectual
3811 ground to cover. In my experience, also, week 5->6 was a big
3812 jump. Supposing there were maybe 12 weeks the material could
3813 be further spaced out. Also, the documentation used as class
3814 material is a little over my head at times. I think a less
3815 skilled programmer could rewrite it w/ a view towards people w/
3816 less experience. At the same time I recognize that there are
3817 a ton of skilled programmers who need the documentation to be
3818 precise and deep so they can get started faster.
3819
3820 TBH I just want to keep doing it - I want to do 201 or 202 or
3821 whatever and then more thereafter. I want to do this with you
3822 people.
3823
3824~rapfyr mostly probably a crash course into more basic programming ideas
3825 to help people with little to no experience.
3826
3827 thanks for the feedback on those two spots
3828
3829~rabsef I think there would be a lot of value in the crash course
3830 element. Reviewing basic existing generators and walking through
3831 each part (like is done w/ some of the walkthroughs), first at
3832 a high level (what they do) and then down to how they do it.
3833 It's sometimes confusing that the demonstrative pieces in the
3834 texts reference doing things in dojo but the same code in a gen
3835 doesn't work - you must figure out how to do it in-gen.
3836
3837 I would be really interested in doing the Week 0 class, still,
3838 actually. I think that I'm learning a lot but I still lack some
3839 of the fundamental ideas of programming that underlie the things
3840 that I'm doing - like I don't really understand what a state
3841 machine is; while the hoon syntax page is really good, there
3842 are some things I didn't get, like (list @) is actually a type
3843 generator, while +$ type ?(@) is also a type generator and you
3844 needn't do both (e.g. +$ type ?(list @)) in one line if you just
3845 mean list. It's hard to explain where the lack of knowledge is
3846 tho - and I'm sure its different for everyone.
3847
3848 One more thought - I would really like to have some
3849 introductions into the existing vanes of urbit so that I could
3850 start making things that interact w/ them (for better or worse).
3851 I think I'm going to have to do a lot of learning about the
3852 language before I can read hoon effectively so as to read the
3853 vanes and make something
3854
3855 That solitaire cipher looks cool and someone has done the math
3856 to make it more secure so obviously I have to implement that
3857 version
3858
3859 gonna finish work and then read that and start
3860
3861 thank you.
3862
3863 I just practiced that cipher like 3 times to make sure I
3864 understood it
3865
3866 I don't think this will be terribly hard - and it will help me
3867 learn map functions better - I have trouble w/ the map functions
3868
3869 https://pastebin.com/psWsCtci
3870
3871 here's that trouble I was talkin about - I do not understand how
3872 to call and draw from a map at all
3873
3874 I can copy the way it's done elsewhere but (lesson 5) but I
3875 don't get why this doesn't work. I also tried declaring =/
3876 test=(map @t @ud) alphamap to no avail
3877
3878~rovpec test
3879
3880~rabsef rcvd somlus noon
3881
3882 moon*
3883
3884~somlus grazie!
3885
3886 Rabsef, I copied the initial hoon walkthrough text from the
3887 website and commented on it. I'd like to cover the yellow
3888 highlighted portions of the comments with you. The other
3889 comments are just suggestions I will eventually submit. Can we
3890 do this on Sunday too? Or casually here?
3891
3892 https://docs.google.com/document/d/1mqkbPVYLPjBwsYPUkdGeDDX2eQgz
3893 yZvy-H-zUpLwUPY/edit?usp=sharing
3894
3895 (or you can actually comment in the document with that link)
3896
3897 I went through and did some commenting - I think you bring a lot
3898 of great questions to the table and I'm excited to speak w/ you
3899 Sunday.
3900
3901 I have a phone call I have to make at 2PST on Sunday but I can’t
3902 imagine well go that long
3903
3904~somlus oh cool! Should we just begin as planned at 9am and cover this
3905 and then go through some code together? I'll check out your
3906 comment responses. That was fast!
3907
3908~rabsef Yah let's do this first then we can comment the other code I was
3909 talkin about above and then we'll see what happens
3910
3911 oh and ~palfun just answered re: =/ p q r. r is everything to
3912 do w/ the subject from there, where =/ creates a face for an
3913 element q of the subject that is then and thereafter pinned as
3914 that face for r the program
3915
3916 that dude is a sincerely nice dude - he obliges my incessant
3917 questioning
3918
3919~somlus ok we can look at =/ in the list example and go from there. I am
3920 still behind on vocab such as 'face' but will work on it.
3921
3922 glad to hear he's so helpful! and thank you again for getting to
3923 that so fast. that's kind of amazing.
3924
3925~rabsef I like engagement and this is engaging. I feel helpful and it’s
3926 helpful to me. I really enjoy this space. second to /weird maybe
3927 :)
3928
3929~somlus /weird is pretty damn high value, that's for sure. What a gem!
3930
3931~ronreg where is /weird hosted?
3932
3933 ~rabsef-bicrym: based on some conversations in u-h, I think the
3934 developers aren't satisfied with the documentation for how types
3935 work
3936
3937 i.e. it's genuinely unclear
3938
3939~rabsef ~litmus-ritten/weird
3940
3941 I will always be supportive of more documentation - I feel like
3942 I’m getting there but through trial and error sometimes.
3943
3944 ~ronreg-ribdev, do you understand how to use a door to make a
3945 "state machine" as described in the bank account example
3946
3947 Basically I'm to the point where I need to code transformations
3948 against a deck to allow for the solitaire cipher
3949
3950 but I don't really understand how to make an arm that maintains
3951 the state of "deck" given an initial starting condition of like
3952 a sorted deck (eventually it will be either a default deck or
3953 one entered by the user as an argument
3954
3955 https://pastebin.com/PBsysWTF
3956
3957 ^you can see the rest of what I've done so far here if u want
3958
3959~somlus Hey ronreg, top of the 'mornin to you.
3960
3961 ~rabsef, always a solid presence, good morning as well. I envy
3962 you the mountain morning air.
3963
3964~ronreg ~rabsef-bicrym: not exactly, I've been looking at that very
3965 example when I've had time over the past few days though
3966
3967~rabsef re: stateful gen - I may be using the wrong term. What I want
3968 to do is, based on certain conditions, take a starting list,
3969 modify it, and return it to the gen, then depending on further
3970 conditions either be done or repeat the modification
3971
3972 re: Solitaire Cipher
3973
3974~ronreg that model of repeatedly calling a function on your state that
3975 returns a possibly-modified version of your state is pretty
3976 common in functional languages
3977
3978 btw were people aware of https://github.com/yosoyubik/hoonschool
3979 ?
3980
3981 ah yeah, the 1.8 bank account example is using =~, which
3982 composes an arbitrarily long list of expressions
3983
3984 but I"m not sure what that means
3985
3986 something about modifying the subject each time?
3987
3988~rabsef I need to think more about how to do it. I have an arm that
3989 gives me a starting state, then I want to have an arm with
3990 transformations that I call based on whether or not something
3991 else has happened, but the part I have trouble with is how to
3992 store the modified state as the new starting state for the
3993 modifier
3994
3995 Yah like, I could use that if I understood how to start w/ the
3996 balance after the transformations on the next go-round
3997
3998 I tried a few times to no avail and now I'm just working on a
3999 blogpost
4000
4001 Yah - I mean it takes the arm newaccount, gives it from the bunt
4002 value of balance 100, 100, -50, then produce resulting balance
4003
4004 but I want to then come back to that and go "ok so I want to
4005 next time call this as balance = 150, do again.
4006
4007 i.e. 300 output
4008
4009 further, I want to allow for an optional card list given at the
4010 beginning of the gen to set your own starting state, but I'd be
4011 ok w/ the default state only if I could figure this other part
4012 out
4013
4014~ronreg I'm looking at the 1.8 code now trying to figure this out
4015
4016 I believe there's a way to set a non-bunt value as the initial
4017 value of the door sample
4018
4019 lets see, the whole thing is in a =<
4020
4021 that's backwards =>
4022
4023 [%tsgr p=hoon q=hoon]: compose two expressions. Produces the
4024 product of q, with the product of p taken as the subject.
4025
4026~rabsef I'd thought about using a counter outside to arbitrarily count
4027 the first cycle and use that as an argument going into my other
4028 door/arm but that seems really lazy/wrong
4029
4030 and, by that argument, ?: to either a first transformation or a
4031 second one, and so on.
4032
4033 where first transformation reads from default and subsequent
4034 read from an "output state"
4035
4036~ronreg it makes sense to me that you should be able to do something
4037 analogous to the bank account door example, only setting the
4038 initial value from a user-supplied input, and then repeatedly
4039 updating it
4040
4041 without any kind of counter magic
4042
4043 https://urbit.org/docs/tutorials/hoon/bank-account/
4044
4045 "We've chosen here to wrap our door in its own core to emulate
4046 the style of programming that is used when creating libraries."
4047
4048 I don't think tha'ts what you're doing in your linked code
4049
4050~rabsef I'm not, yet at least.
4051
4052~ronreg so that might be the trick, have one of the arms of your outer
4053 core return a door that has some additional arms on it
4054
4055 I'm trying to figure out exactly how the bank acct works
4056
4057~rabsef Let's say I have starting list ~[1 2], I want to start there
4058 then maybe flop it and add 1 to each. Then the next time I call
4059 that arm, I'm confused as to how I'd say - don't use starting
4060 list
4061
4062 without something counting how many times it has operate before
4063
4064~ronreg so your starting list ~[1 2] is analogous to the starting
4065 balance in the door that new-account returns
4066
4067~rabsef yep
4068
4069 oh and importantly, once I do a transformation, I need to
4070 operate on a nother part of the subject, before I do the
4071 transformation again
4072
4073~ronreg and then, in the docs example, =~ makes it so all the subsequent
4074 invocations of deposit and withdraw are changing the state of
4075 that starting balance
4076
4077~rabsef so we have to come out of that arm, then go back in
4078
4079~ronreg I'm still not clear how that is guaranteed
4080
4081~rabsef maybe that's where I'm wrong - we don't need to come back out
4082 if I do all the operations there and output form that arm,
4083 including the transformations to other parts of the subject
4084
4085~ronreg maybe you need a more complicated sample, like with multiple
4086 copies of the list, and you're only working on one at a time?
4087
4088~rabsef that's interesting too
4089
4090 possibly lol :)
4091
4092~ronreg this syntax seems important: +>.$
4093
4094 "+> is wing syntax. This particularly wing construction looks
4095 for the the tail of the tail (the third element) in $, the
4096 subject of the gate we are in, which is the entire new-account
4097 door. We change balance to be the result of adding balance and
4098 amount and produce the door as the result. withdraw functions
4099 the same way only doing subtraction instead of addition."
4100
4101 lol typo in the docs :)
4102
4103~rabsef yah so I thought maybe I could like set +>.armname but I tried
4104 it and it didn't like it
4105
4106 I may have fucked it up tho
4107
4108 I could try again
4109
4110~ronreg ah yeah so the syntax here is $(variable-name new-value)
4111
4112 so each call to withdraw/deposit is calling $ but with balance
4113 (the name of the sample) updated to something else
4114
4115 except it's not $ it's calling but the +> child of $
4116
4117 still not sure what that does
4118
4119~rabsef Somehow, $ refers to newaccount and +>.$ is balance
4120
4121 I can't for the life of me figure out how that's determined. It
4122 doesn't look like the tail of the tail to me
4123
4124 It looks like the head of the tail, if the head is |_
4125
4126 remember the wing notation is - or < alternating for head and +
4127 or > alternating for tail
4128
4129~ronreg ah okay I think that makes sense
4130
4131~rabsef Do you understand how balance is tail of tail? I can't get it
4132
4133~ronreg new-account is an arm of the outer cell, so anywhere within it $
4134 should be valid
4135
4136 $ is the "self" of new-account, not the door... i think
4137
4138 it would be good to check the exact definition of a core arm
4139
4140 https://urbit.org/docs/tutorials/hoon/arms-and-cores/ might be
4141 helpful
4142
4143 Cores, Gates, and Traps
4144
4145 so maybe it's the other way around - $ is a special name created
4146 by the door, not the core. and the core is the +> child of the
4147 door's subject?
4148
4149~rabsef tbh that section and 1.8 were hard for me to understand
4150
4151 like the part about modifying a core and having to save it back
4152 to itself was pretty hard to understand imo
4153
4154~ronreg yeah I don't quite grok it yet either
4155
4156 I think that it's not so much "saving it back to itself", as
4157 creating a new subject where the same name points to a modified
4158 copy of itself
4159
4160 that's a common functional programming pattern
4161
4162 there's like an implicit stack of states
4163
4164~rabsef that makes sense - that's what they're trying to tell us in
4165 recursion
4166
4167 ~palfun says ~palfun-foslup. you'll want your arms to produce
4168 the updated thing, ~14.47.01
4169
4170 probably. (or the updated core, if there's many things
4171
4172 you want to change). look at code that uses =^
4173
4174~ronreg I need to go grab some food but afterwards I'm gonna look at
4175 this again
4176
4177~rabsef yah my laptop died and I’m going to hit some chores. talk to you
4178 soon. thanks for thinking thru this with me
4179
4180~hanryc In that example `new-account` is the door
4181
4182 And the $ refers to the gate of the say generator `|= *` which
4183 has a head `*` and a tail which starts with the `:-` rune
4184
4185 .
4186
4187 The `:-` rune is a cell that has a head `%noun` and a tail which
4188 is the rest of the code (produces the door). So, the tail of the
4189 tail of the generator $ is the door itself, `new-account`
4190
4191 the expression `+>.$` is `new-account` door and so the arm
4192 is returning the door with a modified subject `(balance (sub
4193 balance amount))`
4194
4195 Similar to "Modifying a core's payload" section on the arms and
4196 cores page. There's an example `c(a 99)`
4197
4198 Thanks for talking this through, btw. I didn't understand this
4199 the first time, but I think I understand it much better now that
4200 I read your conversation. lol
4201
4202~somlus First we will go through some of the annotations & discussion
4203 on:
4204
4205 https://docs.google.com/document/d/1mqkbPVYLPjBwsYPUkdGeDDX2eQgz
4206 yZvy-H-zUpLwUPY/edit?usp=sharing
4207
4208 and then we'll do whatever simple code that rabsef created. FYI
4209 ~rabsef I no longer have scrollback, so you will have to re-post
4210 the paste.bin for us to go by...
4211
4212~rocted .
4213
4214~rovpec .
4215
4216 (prepping my moons, please disregard)
4217
4218 Ok rabsef, no rush. LMK when you're up and running.
4219
4220~rabsef I'm here - your planet just doesn't like it when I talk - this
4221 will show up momentarily
4222
4223 I arrive!
4224
4225~rovpec haha!
4226
4227 welcome
4228
4229 Moons and also my planet can be quirky
4230
4231 I got a laptop with a full Ubuntu install now, and it screams.
4232 Somlus doesn't live on it but moons do.
4233
4234 Do you want to look at the document Q&A first?
4235
4236~rabsef It happens. I saw you posted some surreplies to my replies.
4237 Should we just start at the top?
4238
4239~rovpec perfect.
4240
4241~rabsef just to remember me, you've successfully made generators before
4242 right?
4243
4244~rovpec yes, well you and I made the list together and also added some
4245 numbers. pretty basic stuff.
4246
4247 Oh and also as a reminder, we should try to focus as much as we
4248 can on each concept, without (for now) explaining something with
4249 lots of hoon terms.
4250
4251~rabsef Ok so let's start at that top line w/ bartis. We have an
4252 explanation of a later question right in the definition of
4253 bartis in the reference
4254
4255~rovpec cool
4256
4257 |=
4258
4259~rabsef That is |=
4260
4261 https://urbit.org/docs/reference/hoon-expressions/rune/bar/
4262
4263 "The product of |= is [a hoon function] where p defines the
4264 gate['s input] and q is [the rest of the gate resulting in
4265 output]
4266
4267~rovpec Aha now I see where $ is mentioned.
4268
4269 It is the work product, of the bar cores
4270
4271~rabsef yep - "A gate is a core w/ one arm named $. I'm not sure I know
4272 exactly what a core is outside of saying a gate is a form of a
4273 core, a door is a form of a core, and a core is something like a
4274 collection of things to do
4275
4276~rovpec ok that's helpful actually.
4277
4278~rabsef And to clarify p and q, the spec for |= is |= p q
4279
4280 also you're right about the double space - that gets me a lot in
4281 my coding
4282
4283~rovpec Let's dig into that 'the product of' line a bit.
4284
4285 oh! was just about to ask that
4286
4287 do you have a link to that spec?
4288
4289~rabsef nearly everything in "tall form" meaning not using irregular
4290 form or long form in ()s has 2 spaces between operant pieces
4291
4292 |= a=spec b=hoon
4293
4294 it's in the hoon-expressions link above - did that come thru?
4295
4296 yah I see it
4297
4298~rovpec spec means "gate's input"?
4299
4300 yes it did, stand by
4301
4302~rabsef That's a good question. I think it actually means specification
4303 of argument - some things that are not 'input' can still be
4304 specifications
4305
4306 an argument can some from somewhere else or be declared if that
4307 makes sense
4308
4309~rovpec sorry had to scroll down a lot, got to the bartis section.
4310
4311 yes it makes sense
4312
4313 looking at bartis now
4314
4315~rabsef if you look @ the examples, check out how one is in long form
4316 and has single spacing, while the tall form has double
4317
4318~rovpec what is "AST"?
4319
4320~rabsef long means like it sounds - across rather than down
4321
4322~rovpec yes will do, ok just a sec.
4323
4324~rabsef "Abstract Syntax Tree"
4325
4326 I'm not sure how that is intended to be different from the
4327 regular, frankly
4328
4329~rovpec ok will disregard that.
4330
4331 looking at long versus tall form
4332
4333 ...
4334
4335~rabsef I unfortunately lack some of the required cs knowledge for
4336 interpretation
4337
4338~rovpec no worries. I do not see a discrete example there of a long /
4339 tall form comparison, so let's move on and I will look closer at
4340 long and tall form equivalencies later
4341
4342 Thanks for pointing me there. I now see that $ is just the end
4343 of |= as defined by the |= function
4344
4345 I was wondering about $.
4346
4347~rabsef we can do that quickly |=(a=@ +(a)) means give me an atom and
4348 increment it by one
4349
4350~rovpec ok
4351
4352~rabsef so tall form it would be |= a=@ <carriage return> +(a)
4353
4354 the first being long form
4355
4356~rovpec ok. I expected two spaces between @ and +
4357
4358~rabsef Yes - in tall you have effectively 2 spaces insofar as you have
4359 a carriage return (confusing) but in long, within the ()s only
4360 one
4361
4362 anyway, let's talk about children - |= takes two, can you
4363 identify what they are?
4364
4365~rovpec ok, got it. long, one space only. tall, two spaces or <CR>
4366
4367~rabsef precisely
4368
4369~rovpec yes I now finally can. the first chile is defining the end=@ (or
4370 naming variable "end" with the user input, interpreted as a real
4371 number)
4372
4373~rabsef (incidentally, somewhere in the documentation they say that hoon
4374 only cares about two types of spaces - either 1 space or more
4375 than 1 space)
4376
4377~rovpec and the other "child" is actually multiple lines of code up to
4378 and including the line that begins with $
4379
4380 (got it on the space comment)
4381
4382~rabsef (so I think you could do 10 or a cr or whatever, but I haven't
4383 tried it)
4384
4385 right - now that will be relevant when we get to :- in the
4386 formula we're looking at
4387
4388~rovpec ok
4389
4390~rabsef let's make a note about "faces" - a face is just a name for a
4391 part of hoon, it can resolve to data (leg) or more code (arm)
4392
4393~rovpec a defined part, or an arbitrary part that is used for some
4394 discussion of an overall code?
4395
4396~rabsef end is the face of our input, or the name of it, which is, in
4397 this case, data
4398
4399~rovpec "part of hoon" seems ambiguous since it could be part of a
4400 program, or part of the overall hoon language
4401
4402~rabsef a defined part - ti's really a part of the subject. But all hoon
4403 is part of the subject as is all data.
4404
4405~rovpec hmm, not following that
4406
4407~rabsef ok - it's not incredibly important. The important part is that a
4408 name (face) can mean a static data point, or more code to run
4409
4410~rovpec ok
4411
4412 perfect, thanks - plain english is super helpful for my stage
4413
4414~rabsef ok so we're basically thru line one. Let's look @ 2. 2 children
4415 here too =/ specification value
4416
4417 And this is where it gets more tricky but also very important
4418
4419~rovpec barfas
4420
4421 ok
4422
4423 tisfas
4424
4425~rabsef Since hoon expressions have determinate numbers of children - we
4426 can read where an expression ends by knowing how many children
4427 it takes
4428
4429 whereas in excel, we must close things with )
4430
4431~rovpec yes, as long as we fully understand what defines a child.
4432
4433 but at the beginning, that is not crystal-clear
4434
4435~rabsef agree - but now that we've established some of that we can start
4436 trying to read teh code by its expected children
4437
4438~rovpec But I am definitely following you
4439
4440 yes agreed.
4441
4442~rabsef Ok - so this next line, line 3, this is where I got into trouble
4443 early on. In a lot of code I've dealt with, you can have a
4444 binary distinction - if x do y if not x, end.
4445
4446 but hoon doesn't just let a decision branch to /end/. You have
4447 to always produce / do something
4448
4449~rovpec yes, that's what I am comfortable with also
4450
4451~rabsef The |- takes one argument, being again everything beneath it,
4452 and (we know now) must result in some production of a value or
4453 action to take
4454
4455 the action to take, in turn, must always result in eventually
4456 some product
4457
4458~rovpec got it.
4459
4460 Can you elucidate "you have to always produce / to do
4461 something"?
4462
4463 never mind
4464
4465~rabsef We know here that our example will result in the production of a
4466 count of numbers, but it becomes more complex later
4467
4468~rovpec I thought that you meant you literally have to produce forward
4469 slash
4470
4471 sorry
4472
4473 yes, still following
4474
4475~rabsef ah gotcha - but let me give an example quickly. In some part
4476 of code I made, I had a ?: (branch on %.y or %.n [true false]
4477 of some other code to a or b action). I was using that inside
4478 something that needs a terminator (some runes have indeterminate
4479 children, and you have to end w/ ==) I tried to make it ?:
4480 condition == other code
4481
4482 where if the condition were true, the program would just
4483 terminate
4484
4485 that is failure to produce. == is not an action/product
4486
4487~rovpec got it, thanks for explaining that. so in that case how did you
4488 work in a termination?
4489
4490~rabsef I rewrote the formula to not have that there - I don't remember
4491 exactly - I think I put the indeterminate member inside of the
4492 ?: but I don't recall exactly
4493
4494~rovpec no worries, but now I understand that the children must do or
4495 produce something
4496
4497~rabsef ok so |- just takes code that will recurse back to itself - the
4498 instant problem we should see and understand is that if we don't
4499 have a defined end to that recursion we will make an infinite
4500 loop
4501
4502~rovpec correct.
4503
4504~rabsef Also, I think technically =/ and |- are the only parts of q of
4505 |= if that makes sense, since everything below |- is part of |-
4506
4507 which might be helpful to think of so you don't overlap what
4508 children are whose
4509
4510~rovpec actually yes that's really helpful.
4511
4512~rabsef I think most technically, the hproduct of the completion of |-,
4513 considering =/ and the input value are the q term
4514
4515 but that's 6 of 1
4516
4517~rovpec I'm even adding more notes to the google doc, to see if this
4518 helps them do this right in the next edition
4519
4520~rabsef Ok, so we have a declared input, a declared constant, and a
4521 process that should, taking into consideration those things,
4522 result in a value for |= so it may terminate
4523
4524~rovpec yes, a rose by another name so they say.
4525
4526 ok
4527
4528 yes.
4529
4530~rabsef So - one problem w/ hoon, or maybe not a problem, but a reality,
4531 is that its not always sure what it's producing if you don't
4532 tell it
4533
4534 basically, since as you rightly state anything is just an
4535 increasingly long string of numbers, sometimes the types are
4536 non-obvious to the compiler
4537
4538~rovpec really? that seems odd
4539
4540~rabsef this results in problems if you don't tell it what you're doing
4541
4542 I have faith that they know why they do that :) lol
4543
4544~rovpec yeah! some of this you just tell youself "yeah but it's a
4545 deterministic computer that's why"!
4546
4547~rabsef But this brings us to line 4. ^- which declares a type for that
4548 below it
4549
4550~rovpec ok thanks for spelling that out. Honestly I didn't know why they
4551 needed to do that
4552
4553~rabsef here is something I'm still struggling with ^- does not have to
4554 be a type for a product. You can declare a type of function with
4555 it too, if your hoon below that results in some sort of function
4556 to run.
4557
4558 I don't really understand what that means but just know that ^-
4559 is not only for "values"
4560
4561 early onhowever, we will use it for values
4562
4563~rovpec ok thank you. super helpful for me to read what you also
4564 understand and what you do not
4565
4566 (incidentally I have to tell you that this particular session is
4567 sort of breakthrough-y for me)
4568
4569~rabsef ^- in our case here gives us a form for our output of |- which
4570 should be, pursuant to our goals, a list of numbers counting up
4571 and terminating in our input value
4572
4573 fuck yah dude. that's great
4574
4575 a list of numbers here is just a list of atoms, which is
4576 theoretically not the greatest 'cast' (identification of type)
4577 because I mean 'thisisanatom' is as much an atom as 3 or 0b1001
4578
4579 or whatever.
4580
4581~rovpec (expounding a bit more, the issue for me is "rules" and "flow" -
4582 the documentation presupposes that you already understand those
4583 rules and flow and does not explain them in an intuitive way, so
4584 it just remains so confusing)
4585
4586 yes
4587
4588~rabsef I agree - I think I have slightly more background that allows me
4589 to sort of intuit some of the rules and flow, but still far less
4590 than I need to really get the docs
4591
4592~rovpec but is simple and they had not talked about auras yet
4593
4594~rabsef yes right - we might change our argument there to @ud if we were
4595 imporving this
4596
4597~rovpec got it
4598
4599~rabsef ok now the fun part
4600
4601 and a better discussion of children
4602
4603~rovpec ok
4604
4605~rabsef ?: is a branching function that has 3 children. A condition, a
4606 result if yes/true, a result if no/false
4607
4608 what are our children respectively? - let's start w/ the
4609 condition
4610
4611 The condition is fairly intuitive to read here =(end count)
4612
4613 sometimes it can be harder like [assume gth means greater than,
4614 which it does] (gth 6 7)
4615
4616 I find that hard to read, as the comparison comes first
4617
4618 I read it now as 6 is gth 7, which is false
4619
4620~rovpec cool
4621
4622~rabsef we could read =(end count) as end is equal to count, which
4623 is potentially different from =(count end) though not really
4624 potentially because of the transitive property or whatever
4625
4626~rovpec (missed that but no worries)
4627
4628~rabsef also, and incidentally, =() is a long form of ?= and also an
4629 irregular
4630
4631~rovpec good to know thanks
4632
4633~rabsef for our purposes =(end count) will give us a %.y or %.n based on
4634 whether it is true
4635
4636 then ?: will check that output and say ok, if %.y then my second
4637 child, if %.n then my third
4638
4639 let's skip ~ for a second
4640
4641~rovpec correct, though you never actually visually see the %.y or %.n
4642 here, you just have to know that logic behind the scenes is the
4643 2nd child on y and 3rd child on n part
4644
4645 ok let's skip it
4646
4647~rabsef The third child, the no condition, is yet another rune.
4648
4649 (to your point there if we just had ?= we would get, in output,
4650 our %.y or %.n assuming we commented out all the rest of the
4651 code
4652
4653~hanryc Did you two see my discussion of the door example from
4654 yesterday? I put it up after you left
4655
4656~rabsef I did ~hanryc and I still need to think about it more
4657
4658 but thank you for doing that
4659
4660~rovpec :- is the "construct a cell" rune
4661
4662~rabsef Right - and what kind of cell
4663
4664~hanryc ok, i was just making sure it didn't scroll off
4665
4666~rovpec (thank you for the clarification on y and n)
4667
4668 what kind of cell....
4669
4670~rabsef [%clhp p=hoon q=hoon]: construct a cell (2-tuple).
4671
4672~rovpec a list of real number atoms
4673
4674 since there was (list and also @)
4675
4676~rabsef explicitly a 2 part cell. This is why it's important. :- has
4677 determinate children
4678
4679 2 eto be exact
4680
4681~rovpec oh, ok, yes that too.
4682
4683~rabsef the first child is easy to read, it's count
4684
4685 the second child is less easy to read - and this is where $
4686 comes in. The second child is the entirety of every subsequent
4687 potential recursion until we break the loop
4688
4689 Let me lay this out a little visually if I can - let's pretend o
4690 is the name of our output each recursion after the first, so o1
4691 is recurion 1 o2 is recursion 2 etc
4692
4693 we know we start with count=1
4694
4695~rovpec ok
4696
4697~rabsef our cell that :- creates is then, [count=1 [o1=2 [o2=3 ...
4698 [oN=end ~]]]
4699
4700 This is because on every recursion until count = end, we form
4701 yet another twouple cell
4702
4703~rovpec is it because a duple cell which adds 3 to [1 2] is [1 2 3]?
4704
4705 the two things in the duple are 3 and the already existing unit
4706 [1 2]?
4707
4708~rabsef Let's walk through it - :- count=1 creates the first half of a
4709 duple cell
4710
4711 [1 ....
4712
4713 the recursion says "add one to count and start from |-"
4714
4715 so to find our second half of the duple, we have to do that - so
4716 now count is = to two and lets say our end value is 3 for the
4717 sake of argument
4718
4719 [1 ..... (is 2=3? no, so) the second half of our first cell, is
4720 the start of a new cell
4721
4722 [1 [2....
4723
4724 that is we go back to line 7 for the second half of the first
4725 cell
4726
4727 [1 [2 .... (recurse again, is 3=3, yes, so) ~]]
4728
4729 [1 [2 ~]]
4730
4731 aka ~[1 2] or [1 2 ~]
4732
4733 does that make sense?
4734
4735~rovpec Ah, so interesting it's not actually building a list, it's
4736 creating a cell inside a cell inside a cell and are are
4737 open-ended duples until they all slam closed at the same time
4738
4739~rabsef a list is a null terminated cell, and yes, so technically "no,
4740 but yes" to your relaying of it
4741
4742 lol
4743
4744~rovpec lol
4745
4746~rabsef but yes exactly, until every cell has its second half, they're
4747 all sort of floating and recurring
4748
4749~rovpec and then you were going to tell me - how does it know that ~ is
4750 the end not only of the list but of the entire gate?
4751
4752~rabsef because it is the deterministic duple second half w/ a value of
4753 null
4754
4755 if end=3, our second half of [1 is intedermined until we
4756 recurse.
4757
4758 Imagine this what if we put 1 as end?
4759
4760 what happens?
4761
4762 we only get ~ right?
4763
4764 ~ is a value so we don't even go to line 7, then the ^- casts it
4765 as a list of @ so we just get [~]
4766
4767 in any number end > 1 we actually start forming cells, that will
4768 by logic always end in a cell of [count(x) ~]
4769
4770 for the same reason
4771
4772 Another way of saying this is that, on the first run, everything
4773 below |- is |-'s children, but as soon as we get to $, if we do,
4774 the subsequent recursion is actually a child of :-
4775
4776~rovpec is it safe to say that if there is a null value in a list, then
4777 the system automatically knows "this list is finished, there
4778 is nothing more to do, I have produced the final product by
4779 definition" and so it ends, and you do not need to tell it to
4780 end?
4781
4782~rabsef it's nested
4783
4784 no - that's not quite right. The system knows that the list is
4785 done for 2 reasons:
4786
4787 1) :- only takes two children, the first of which will be count,
4788 but the second is indetermined until ?: kicks again
4789
4790 if ?: says %.n, then the second half of the cell is another
4791 recursion, and we must process again
4792
4793 and 2) if ?: says yes, then the second half of the recursion is
4794 ONLY line 6, which is the value ~
4795
4796 we could replace line 6 with other code and not cast this as a
4797 list and just get a cell that is not null terminated (end with 0
4798 for instance) so if we put end = 3 we would get the cell [1 [2
4799 0]]
4800
4801 does that make sense?
4802
4803~rovpec is it by definition that another recursion cannot be a 2nd
4804 child? that a 2nd child can only be what comes after the
4805 recursion is complete? Sorry I'm having a hard time with this,
4806 even though you have spelled it out clearly
4807
4808~rabsef Let me try saying it this way -> The children of a cell must
4809 always be computed down to a value (not sure if this is
4810 perfectly true, but assume it here)
4811
4812 on our first go through of this program, we give one value and
4813 one piece of program that must be computed down to a value
4814 before it can be accepted as a child
4815
4816 Thus, the second half of every cell created by execution is
4817 another recursion, until end=count. On the end=count run, the
4818 second half of the cell is just ~
4819
4820 (which is a value)
4821
4822~rovpec ok, I will ruminate on that. I do think that if I understand
4823 the entire flow of this particular generator, I will 1) have a
4824 framework for understanding hoon syntax and 2) be able to help
4825 them create an initial part of documentation that can take even
4826 early learners through thisphase.
4827
4828~rabsef let's say it this other way w/ sandwiches
4829
4830~rovpec I'mportant to know that firmly the children of a cell must
4831 always be computed down to a value.
4832
4833~rabsef imagine I'm making a multi layer sandwich
4834
4835~rovpec ok
4836
4837~rabsef the first half of each layer is going to be bread. bread + what?
4838 I have to look at my instructions - lets say it's n levels tall
4839
4840~rovpec ok
4841
4842~rabsef until I am at n, I will have to add an ingredient other than
4843 bread, and then a bread, and then look at my instructions again
4844
4845 bread butter bread jam bread meat bread lettuce bread mayo bread
4846 ~ <- air, my last bread is the run where the next instruction
4847 will be n layers which means nothing on top
4848
4849 count is bread always, and our recursion is our look @
4850 ingredients / our ingredients
4851
4852~rovpec This structure makes sense
4853
4854~rabsef [1 (look @ ingredients and the next ingredient is) [ then bread
4855 then look at our ingredients and our next ingredient is [ then
4856 bread
4857
4858 and so on
4859
4860 or [1 [2 [3 ~]]]
4861
4862 ignore that fact that we have an ingredient on bottom lol
4863
4864~rovpec haha some sandwich!
4865
4866~rabsef we might even better define [ as bread so :- starts w/ [(bread)
4867 then our current ingredient which is count, then [ count [ count
4868 until we're done and then ~]]
4869
4870 but does that help at all?
4871
4872~rovpec i was thinking on [ as bread anywasy so all good!
4873
4874 ok thanks. i'm sorry we did not get to the other thing you
4875 wanted to cover but I think I have enough to go on here to dig
4876 into the final understanding of this generator.
4877
4878~rabsef No this was great - do you want to call it there or would you
4879 like to keep going?
4880
4881~rovpec I think that for me the best course of action is to review and
4882 review and be sure I get this. Can we do your plan for next
4883 Sunday? remind me of what it was and I will put that into my
4884 appointment and prepare
4885
4886~rabsef Yah I actually can't get scrollback any more either so I'll
4887 look @ the notebook for hoon school - I think it was the second
4888 assignment to just comment some code like this that does a
4889 factorial output
4890
4891 same deal there - we will want to walk through recursion again
4892 and see how it works in a different context
4893
4894 https://urbit.org/docs/tutorials/hoon/recursion/
4895
4896 let's do that
4897
4898~rovpec ok fantastic. This speed and level of detail is amazing! I am
4899 indebted
4900
4901 ok I will put that link in my calendar.
4902
4903~rabsef Let's just remember that I don't know nearly enough to be
4904 considered even a moderate user, so we're getting big concepts
4905 but may have details excluded
4906
4907 I don't want you to be misled by something I say
4908
4909~rovpec no worries, all good. We can refine it as we go.
4910
4911 Ok I'll do another hour or so of self study now. Thank you again
4912 rabsef!!
4913
4914~rabsef outstanding - I'll see you sunday then. Sunday school w/ hoon!
4915
4916 :)
4917
4918 thanks for having me - talk to you soon
4919
4920~rovpec thanks! talk soon
4921
4922~dinlut sorry about the random "j" comment in the google doc. the
4923 floating action button to make a comment was just above the
4924 right nav button, must have clicked it by accident
4925
4926 interacting with docs on a phone is not ideal
4927
4928~somlus no worries at all dinlut. seriously feel free to add any
4929 comments or responses. I'm trying to create a version that
4930 speaks to very early non-coder learners, so I'm trying to
4931 identify all that is not clear with the beginning parts of the
4932 documentaiton.
4933
4934 Hey ~rabsef I put our chat into a document. not sure
4935 if it has value to you but it might. Here it is:
4936 https://www.dropbox.com/s/by8b1jvpmpjsson/Rabsef%20on%20list%20g
4937 eneration%2001-12-2020.docx?dl=0
4938
4939 (btw no small task to copy paste landscape chat into a
4940 well-ordered document! lots of workarounds needed)
4941
4942~hastuc hey ~somlus if you want to get the json state of your current
4943 chats
4944
4945 here's a generator
4946
4947 save it in /gen/chat-backup
4948
4949 https://pastebin.com/YFVZD6LH
4950
4951 ~somlus save this as /gen/chat-backup
4952
4953 https://pastebin.com/YFVZD6LH
4954
4955 */gen/chat-backup.hoon i mean
4956
4957 and then run it like this
4958
4959 *%/chat-backup/json +chat-backup
4960
4961~rabsef ~hastuc - At your leisure some time I'd like to talk to you
4962 about the generator I'm working on for this solitaire cipher. I
4963 am just not getting it
4964
4965~hastuc yeah for sure i'm available for the next 8 or so hours lmk when
4966 you want to talk
4967
4968~rabsef also that's very dope
4969
4970 nice job
4971
4972~somlus ok awesome ~hastuc, thank you very much
4973
4974~hastuc just fyi it will probably hang your urbit for a couple of
4975 seconds but should be fine
4976
4977~somlus understood, much like mounting sometimes does.
4978
4979~rabsef ~hastuc-dibtux - I got two transformations completed yesterday
4980 - one behaves in a way that is confusing to me so I'd like
4981 to look @ it with you some time, but only after I finish the
4982 transformations. You are the real deal man
4983
4984 (or lady - I mean it in the colloquial sense)
4985
4986~hastuc congrats!
4987
4988~somlus hey rabsef you need any more planets to give out?
4989
4990~rabsef hmm I could do a small giveaway on twitter plus I do have a
4991 buddy who wants to try the raspberry pi install... if you don’t
4992 mind I’d be into it. I know you said don’t be timid but here we
4993 are lol
4994
4995~mocrux Ah, is ARM support already implemented?
4996
4997 If I find time I might try booting a ship on a spare rock pi I
4998 have laying around.
4999
5000~widbur between urbit and urbit-worker, just the processes weigh in at
5001 ~750MB on my machine
5002
5003 presumably it also consumes pagecache for the 2GB image
5004
5005 might be a tight fit on a pi
5006
5007 i've got an early production test version of a pine64 board from
5008 when i did alpha testing for them, if there's arm support i
5009 might try that as it's got 4 gigs iirc
5010
5011 although finding that in my office would take an almighty grep
5012
5013~mocrux I wonder what kind of a userbase will be required before
5014 purchase-plug-setup-and play Urbit boxes based off of these low
5015 powered arm based boards will be in demand/desired by users.
5016
5017 I imagine you could probably include an invite and some sort of
5018 streamlined process on first boot so that they set up the ship
5019 with their own fresh keys.
5020
5021~widbur i don't think userbase is the limiting factor, usefulness is
5022
5023~mocrux Those are two sides of the same coin I suppose. With usefulness
5024 comes new users, which drives demand, and thereby makes it
5025 possible for such nodes to be worth developing/selling.
5026
5027~minder The comet has a good point.
5028
5029~widbur there are plenty of useful things you don't require a large
5030 userbase for
5031
5032 and for others, an internet->urbit gateway would suffice
5033
5034 for me, the question of whether something complex and useful can
5035 be built on top of urbit is not at this moment decidable with
5036 reasonable effort
5037
5038 largely because the things i need to understand to make an
5039 educated guess are hidden behind a wall of gobbledygook jargon
5040
5041 it takes a lot to make a functional VM-as-OS project completely
5042 unevaluatable without massive effort for a kernel dev familiar
5043 with functional programming, but urbit succeeds at that
5044
5045 i'm not being hostile or unreasonably critical btw, the bits I
5046 do understand at an architectural overview level are really cool
5047
5048~hodler I have to agree about the urbit jargon... I find it very
5049 difficult to learn.
5050
5051~widbur the networking though - composability, the price being paid for
5052 idempotency-as-an-exactly-once mechanic and so on, i have 0 clue
5053
5054 it's not a problem if this is your first programming experience,
5055 you'd have had to learn the same volume of jargon anyway
5056
5057 but it's not as if functional programming, overlay networks,
5058 transparent messaging and so on are brand new things - these
5059 are established fields, with established terminology, and that
5060 terminology has a purpose - letting those who have already
5061 invested the time and effort to accumulate clue use it to grok
5062 new projects
5063
5064 i've read yarvin's claims that this is all completely new, urbit
5065 doesn't owe anything to 20th century CS and so on, but it's
5066 blatantly not the case. there are some new-ish things, like jets
5067 (although an isomorphic equivalent might exist that i don
5068
5069 't know about, since i'm not a hardcore fp guy), and the
5070 composition is new, but the building blocks very much are not
5071
5072~ravsur The overt reason (I can't find a ref but it's out there
5073 somewhere) for the ab initio jargon is that many Urbit entities
5074 differ subtly but potentially misleadingly from existing CS
5075 concepts. The covert side, in my opinion, is about 50% an
5076 attempt to regulate the rate of adoption, so as to avoid
5077 dilution of the foundational principles, and 50% whimsy
5078
5079 Or things indistiguishable from whimsy from the outside
5080
5081~widbur CS has had 0 problems dealing with 'largely similar with an
5082 important difference' for quite some time now
5083
5084 particularly in languages
5085
5086 as a polyglot, it's something i trust my brain to handle easily
5087
5088 whimsy can be seen in the naming, but i wouldn't say it's the
5089 reason
5090
5091~ravsur I note that the four-letter naming scheme has slowly been
5092 dropped over the last year, so the direction of travel does
5093 appear to be away from whimsy
5094
5095~widbur it's not a problem that it's four letters, it's that
5096 straightforward CS concepts are renamed and no write-up exists
5097 that explains networking, for example, well enough so I can
5098 figure out whether urbit performing badly even for chat is an
5099 implementation problem, design problem or both
5100
5101 last time i brought this up ~a year ago, i was told that it was
5102 an implementation problem and a networking rewrite was in the
5103 works. clearly it's improved things massively, but not enough.
5104
5105 is it hopeless? can i help? i can't know, apparently, because
5106 there's no usable info and RTFCing is not a practical option
5107
5108~master ~widbur, i'm curious how you've formed the conclusion that "it's
5109 blatantly not the case"
5110
5111~widbur since there are people in this channel who haven't programmed
5112 before learning fp, clearly it's a net positive in the world and
5113 has some excellent folks in the community
5114
5115 ~master, because some of the bits I did manage to grok map very
5116 nicely to established concepts I'm familiar with?
5117
5118~master from a high enough level of analysis, anything computational can
5119 be considered equivalent to anything else ... but the details
5120 matter
5121
5122~widbur we've had some isomorphic equivalent of this conversation
5123 before, ~master, it's just that i have to create a new comet
5124 every time i check out urbit so there's no continuity
5125
5126 in a sense, it doesn't matter what my criticisms of the
5127 terminology decisions are, the decisions have long been taken
5128 and what is, is
5129
5130~master i believe it
5131
5132 that may be, but there's still dramatic leeway in pedagogy
5133
5134~widbur when i look at a cool project, and urbit is very, very cool, i
5135 want to know: 1) is it broken in a fundamental way at design
5136 stage preventing it from being useful when mature, 2) is it
5137 worth me getting involved, and 3) how do i get involved in
5138 pushing it forward
5139
5140~master would nock be easier to understand of cores were introduced as
5141 "closures", or "objects"? or if gates were *just* functions and
5142 their nature as cores deferred or elided?
5143
5144~widbur last i checked, 1 & 2 were undecidable and the answer to 3 was
5145 'we don't yet want people to get involved'
5146
5147 to me, yes
5148
5149 absolutely
5150
5151 and if the networking were explained in terms of, say, standard
5152 consensus algorithms
5153
5154~master as far as i know, the networking isn't really explained
5155 anywhere. but i've been out of the docs loop
5156
5157 the network implementation is extensively and mysteriously
5158 explained
5159
5160~widbur last time i asked about it, i was told to shut up and wait until
5161 it was rewritten
5162
5163~master ;)
5164
5165 well, it's been rewritten
5166
5167~widbur responsiveness is much better
5168
5169~master not sure if ~rovnys is in here
5170
5171~mocrux In regards to naming, I think most programmers should be used to
5172 both name overloading and concept overloading (diff names for
5173 same concept) if they've jumped around enough across languages
5174 in genreal
5175
5176~sarpen new ames is well documented
5177
5178~widbur my cli doesn't work for chat, at all, but the web interface does
5179 (and i hate using browsers for cli things)
5180
5181~sarpen (in the code)
5182
5183~master is there a github issue for your cli problems?
5184
5185 there have been some bugs
5186
5187 you could |unlink %chat-cli and then |link %chat-cli from :dojo
5188
5189 and i think there's a command to re-establish subscriptions
5190
5191~widbur ~master, i don't know enough to know if they are bugs
5192
5193~master what are the symptoms?
5194
5195 i'm using the cli rn
5196
5197~widbur i switch to chat-cli with ^x, ;join ~dopzod/urbit-help
5198
5199 what i'm expecting at this point is a chat-cli
5200 ~dopzod/urbit-help prompt, and eventually to receive backscroll
5201
5202 i get a chat-cli prompt, but no 'channel' prompt, no backscroll
5203 and no new messages either
5204
5205 web interface works
5206
5207~master from :chat-cli try: ;what
5208
5209 or i guess ;chats, which is new
5210
5211~widbur already have, it reports ~dopzod/urbit-help
5212
5213 interestingly, when i try to ;join a channel i can't, like
5214 ~dalten/collective, i get the permission errors on the
5215 read/write but get the channel prompt
5216
5217 chats reports this channel and hoontards
5218
5219~master that's probably the channel settings on ~dalten, but the
5220 permissions stuff is new and i'm not sure
5221
5222 does ;what show you glyphs before the channel names?
5223
5224~widbur i vaguely remember that i needed to set the audience to write
5225 to a specific channel, but i should be receiving from all the
5226 channels i'm on, right?
5227
5228~master that's right
5229
5230 ;$glyph sets your audience on cli
5231
5232 for me, this channel is &, so ;&
5233
5234 and & is then at the end of my prompt
5235
5236~widbur i just assumed ~dalten/collective doesn't exist because it
5237 was set up for the initial meeting only, or is locked down to
5238 participants only
5239
5240 it would then make sense that i can't open its /read and /write
5241
5242 urbit-help is @ for me, and @ is at the end of my prompt
5243
5244~master i gotta step away in a minute, but i'll swing back around
5245
5246~widbur no worries
5247
5248~master if you type and a send a message, is it delivered to urbit-help?
5249
5250 one more thing: from :dojo, try :chat-cli %connect
5251
5252 i see your message in urbit-help
5253
5254~widbur no, it isn't
5255
5256 %connect returns >=, which i'm assuming is success
5257
5258 i'm getting regular errors about eth watcher still running and
5259 so forth, i'm assuming that's normal
5260
5261~master that command was a "poke" to the chat-cli app. pokes are rpc
5262 messages, positively or negatively acknowledged, but receiving
5263 no response
5264
5265 so, yes
5266
5267~widbur along with intermittent zod not responding, which i remember
5268 from last time, although they're less common now
5269
5270~hodler i fixed my chat-cli with this
5271 https://github.com/urbit/urbit/issues/2099#issuecomment-56629214
5272 7
5273
5274~master fyi, ~holder, urls are best as separate messages
5275
5276 they can then be auto-linked, properly formatted on cli, etc
5277
5278 simple messsage types, avoids markup overhead
5279
5280~widbur ford is the http subsystem, isn't it? don't see how that would
5281 fix my cli
5282
5283~master ~widbur, have you seen a chat cli output yet?
5284
5285~widbur but willing to try
5286
5287~hodler it worked for me
5288
5289 my chat-cli wasn't showing anything
5290
5291~widbur ~master, nope
5292
5293~master ford is the build system, a la henry
5294
5295 that linked command forces a rebuild of all apps
5296
5297~widbur ah
5298
5299~master needed to manually resolve some recently introduced bugs that
5300 broke the reactively of "live" builds
5301
5302 just the :goad part
5303
5304 the |wipe is to clear the %ford cache
5305
5306~widbur makes sense
5307
5308 didn't fix anything, but it does make sense ;)
5309
5310 btw, urbit doesn't handle paths to ships correctly, which breaks
5311 the aur package and i'm assuming all other binary distributions
5312
5313 only thing that would work for me is downloading the tarball,
5314 changing to that working dir and creating a comet in it
5315
5316~master the filesystem path to the ship directory?
5317
5318 or the path to the binary?
5319
5320~widbur both
5321
5322 looks like urbit expects urbit-worker to be in cwd
5323
5324 and specifying the ship with a path doesn't work either
5325
5326 so i can't cd-to-urbit-install-dir and specify
5327 /home/paul/mycomet
5328
5329~master you should be able to specify the pier in that manner
5330
5331 there's a couple issues with the binary path
5332
5333~widbur and i can't cd to ~/mycomet and run urbit either via $PATH or
5334 via explicit path
5335
5336~master our x-compilation of ncurses is just wrong, so we ship a
5337 terminfo database, which is horrifying
5338
5339 local relative paths to the binary should always work
5340
5341~widbur none of those combinations work as of right now with the aur
5342 package which is at the same version as the official download
5343
5344~master back later
5345
5346~widbur cheers
5347
5348 terminfo isn't the problem, not finding urbit-worker or a
5349 spectacular sigsegv are ;)
5350
5351 ~marzod, for when you're back, write via chat-cli seems to be
5352 working, no backscroll or read or prompt still
5353
5354~somlus widbur still there?
5355
5356~widbur soz, wish there were a good way to alert on new messages
5357
5358 yes
5359
5360 ~somlus, also soz for polluting your teaching channel with
5361 off-topic stuffs
5362
5363~master hey ~widbur
5364
5365 did your cli chat recover?
5366
5367~somlus no worries wilbur all goo. was going to ask - do you need a
5368 planet?
5369
5370 *good
5371
5372 *widbur
5373
5374~ronreg ~master-morzod: it actually is kind of confusing knowing that
5375 a gate (i..e the thing that looks like a function) is just a
5376 special core
5377
5378 that cores are the most fundamental hoon data structure
5379
5380~widbur ~master, no. writes work, reads, backscroll and prompt doesn't.
5381 i was going to 'turn it off, turn it back on' with the whole
5382 ship, or creating another comet, but i didn't want to do that
5383 unless you don't care about debugging this particular problem
5384 beyond making it work for me
5385
5386 ~somlus, i'd like one in an ideal world, yeah, last time i
5387 checked in on urbit there wasn't a way for me to get one i
5388 think. there's a meetup in my area at the end of the month which
5389 ~winter is organizing and he was going to give me one there i
5390 think, but it's not a given that i'll be able to make that date
5391 because of time conflicts
5392
5393 i'm not sure what the new system of sponsorship means, or what
5394 the etiquette around all of it is, in the sense that last time
5395 i checked the star->planet thing was meant to be a purely
5396 mechanical thing, whereas now it may or may not be a social
5397 construct of some kind?
5398
5399~somlus if you email me your email address at somlus@somlus.com I will
5400 send you a planett.
5401
5402 there is no significant social construct at all yet. I watch
5403 for people who look like they will contribute and I give them
5404 planets. You can check out:
5405
5406 ~somlus-savlev/welcome
5407
5408 ~nibfeb/welcome
5409
5410 for more info. I'm headed to sleep fairly soon but if I see
5411 an email requesting a planet and providing an email address
5412 I'll send you an invite that includes a planet. you will be
5413 under my star nibfeb but here are no obligations and you can
5414 escape to another star if my star ever goes dark, which would be
5415 unintended.
5416
5417~rabsef I think it remains to be seen what sort of service stars will
5418 perform for their planets. I don't think it's just the routing
5419 tho - or I should say I don't think Tlon expects it to be just
5420 the routing
5421
5422~widbur future is hard to predict, but as of right now, the community is
5423 small enough that even if it's not meant as a social construct,
5424 it can't help but be one to an extent
5425
5426~ronreg I've had conversations with people where they've said they want
5427 a star to be like an ISP
5428
5429~widbur i've read that. every single isp relationship i've ever had has
5430 been abusive
5431
5432~ronreg and that goes along with the "network infrastructure not social
5433 infrastructure" I've seen mentioned, and also the deliberate
5434 obfustication of what star a planet belongs to
5435
5436 on the other hand, some people do talk as if a star should do
5437 things for planets that make being a member of a particular star
5438 socially valuable
5439
5440 which makes stars less pure network infrastructure
5441
5442~widbur people are social animals and most tend to want small in-group
5443 relationships at least
5444
5445~ronreg yeah, but not necessarily with the same people who are in your
5446 star :)
5447
5448~widbur among other things. sigils are meant to be random and not
5449 particularly interesting in terms of one vs another, but i've
5450 noticed more appealing ones being listed for higher prices
5451
5452 indeed. once distinct group functionality is added as i've seen
5453 mentioned somewhere, it might take that over
5454
5455 on the other hand, currently running a star 24/7 is a favour to
5456 planet owners and it's reasonable that there's some expectation
5457 of social reciprocity
5458
5459 and repeated validation of reciprocity is how a high trust
5460 social group is built
5461
5462~somlus good stuff, and what we should be talking about
5463
5464~rabsef apropos of nothing I'm almost done w/ my card transformations
5465
5466~widbur talking about it is fun, but i expect the result to emerge on
5467 its own regardless of discussion
5468
5469 and what happens now, with a small community where over time
5470 most people will have talked to each other at length, and what
5471 happens later with more adoption will likely be very different
5472
5473 every chance the folks who were early form an elite like the
5474 Old Bolsheviks and proceed to have champagne parties in large
5475 ballrooms, figuratively
5476
5477~ronreg well that's an unsettling metaphor
5478
5479 given that stalin killed many of them
5480
5481~widbur .. then someone with a spectacular moustache sends us all
5482 somewhere cold to chop wood
5483
5484 to be fair, this analogy could be past usefulness at this point.
5485 i can't decide who would be Kamenev for one
5486
5487 ah, the multi-minute lag, old friend, how i've missed you ;)
5488
5489 if the MSM is to be believed about Curtis, we should recast this
5490 into an analogy about Roehm and the SA? ;)
5491
5492 personally, one of the things i'm super interested in seeing is
5493 how sigils end up playing out
5494
5495~ronreg the MSM doesn't know who curtis is. it's specialty tech media
5496 who says he's a nazi
5497
5498~widbur people usually want to, and are used to, selecting their
5499 pseudonyms. getting a random one is interesting, and could work
5500 for most people most times, but there are syllables being used
5501 that could be highly aesthetically unpleasant for particular
5502 people dependent on personal preference and native language.
5503 onomatopoeia works both ways
5504
5505 i'm pretty sure i saw some reference to him in one
5506 pseudo-intellectual pseudo-left rag or another
5507
5508 atlantic, slate, that sort of thing
5509
5510 tech media is bad as well, i remember when they were all
5511 collectively trying to work out how much they could attack thiel
5512 for his private political views and donations given that he has
5513 some degree of magic intersectional immunity due to being a bit
5514 oscar wilde
5515
5516 vast swathes of 'journalism' is unreadable to anyone with
5517 half a brain these days because it offends intelligence to an
5518 unbearable degree
5519
5520~rabsef Yussss - just finished the triple cut of the solitaire cipher.
5521 Now only the counting cut and the keystream generation function
5522 to go.
5523
5524~somlus Sir ~widbur, you are considered a good egg because you
5525 intelligently assess and desire the improvement of systems and
5526 you are respectful. Welcome aboard!
5527
5528 haclex-moppyx! I like your name. welcome to the world...
5529
5530 if you absolutely hate that name you can give the invite to
5531 someone else and we can try again but I quite like it.
5532
5533 Oh and ~rabsef and ~haclex, FYI the CEO to Tlon, ravmel-ropdyl
5534 has stated from time to time on urbit-help that he wants that
5535 chat to be primarily about urbit help. Love the banter, but
5536 if you dive in to a convo on something, consider taking it to
5537 another channel. Feel free to use this channel if you like,
5538 though I have been considering having a nibfeb channel for some
5539 time so I might create one for all conversations that start on
5540 UH but then need be moved because of a non "urbit help" focus.
5541
5542 Actually I just created it, feel free to continue the
5543 conversation there:
5544
5545 ~nibfeb/uh-off-topic
5546
5547~widbur cheers mate and yeah, point well taken on not going off-topic
5548 for too long, i would find that annoying myself to be fair
5549
5550~somlus are you cool with the name? you are haclex-moppyx now.
5551
5552 I think it's awesome, personally.
5553
5554 It's very rare to have both a cool name and cool sigil BTW.
5555
5556~widbur yeah, i'm well happy with that
5557
5558 just concentrating now on getting through the process without
5559 losing keys and things
5560
5561 you would not believe the amount of crypto i've got in wallets i
5562 will never be able to access again in all likelihood
5563
5564 i don't actually know in fact, i've forgotten that as well,
5565 could be 2 shekels
5566
5567 my brain doesn't cooperate with me on remembering things i
5568 consider important, it retains what it thinks is worth retaining
5569 and fks me off
5570
5571~somlus haha! just make sure you download and store your master ticket
5572 and you'll be just fine. ok headed back to bed. midnight San
5573 Francisco time, cheers.
5574
5575~widbur cheers mate
5576
5577~ronreg I'm pretty sure I've never lost any cryptocurrency
5578
5579~rabsef I was in a bitcoin mining collective early on and maybe got a
5580 half a bitcoin reward and then just lost the laptop that had the
5581 wallet so that’s cool
5582
5583 also yah somlus good reminder
5584
5585 joining ot
5586
5587~widbur .
5588
5589~somlus received
5590
5591~widbur so i'm able to write here from my comet, but not join from the
5592 planet? this "maintenance-free operating function" thing is
5593 working out brilliantly ;)
5594
5595~rapfyr maintenance-free is a goal not a reality.
5596
5597~minder Archer -> Target
5598
5599 We are currently the arrow.
5600
5601~rapfyr which may or may not have tnt strapped to it :-p
5602
5603~widbur i get that, but curtis claimed that making urbit a pure function
5604 gives you that for free
5605
5606 like exactly-once delivery and so on
5607
5608 it's more gentle ribbing than anything else
5609
5610 last time i checked out urbit, it had the old chat mechanism and
5611 it worked perfectly
5612
5613 the networking was dog slow and completely unreliable, but you
5614 could join channels, read the backscroll and write to them
5615 (eventually) all while receiving updates on the welfare of ~zod
5616 every second or so ;)
5617
5618~master ~widbur, does this count as a sockpuppet attack?
5619
5620 ;)
5621
5622 exactly-once message delivery doesn't save you from
5623 implementation bugs, like delivering the wrong message
5624
5625 unfortunately
5626
5627~widbur it's only a sockpuppet if you can't see the hand and don't know
5628 to whom it belongs ;)
5629
5630 this is the channel my ~haclex can't join
5631
5632 although it's an interesting question socially what the
5633 etiquette ends up being around using more than one identity
5634
5635~rabsef no etiquette. I'm actually you and ~master and this is all
5636 staged for ~rapfyr and ~somlus, who are both the same perosn
5637
5638 person*
5639
5640~widbur heh
5641
5642 if you were me, you'd be busy screaming in horror, not posting
5643 here ;)
5644
5645~rabsef exactly what we would say in this revealing situation
5646
5647~minder ?
5648
5649~widbur are those eyes or breasts? my font isn't specific. also, how did
5650 you do that?
5651
5652~rabsef lol we see what we want to see comet
5653
5654~widbur yeah, because breasts are impossible to find elsewhere on the
5655 internet
5656
5657~rabsef fsir
5658
5659 loool
5660
5661 fair*
5662
5663 ? <- wondering if all emoji work - thinking maybe cuz their utf
5664 8 right?
5665
5666 apparently - that looks right to me
5667
5668~widbur ah, right, i keep forgetting about that abomination of an abuse
5669 ;)
5670
5671~somlus ~widbur why aren't you using your planet now?
5672
5673~borlyt need some help with recursion, i get an error on the $(5 5) line
5674
5675~rabsef I think the tape type can take utf8 so I assume this means
5676 you can put emoji in your programs in Hoon lol. this has not
5677 occurred to me until now
5678
5679 be prepared for my next gen project which will only output in
5680 eggplant/peach emoji Morse code
5681
5682 i think someone needs to explain how recursion works in hoon
5683 because i think i'm completely misunderstanding the workings of
5684 |- and $
5685
5686~rabsef whatcha tryin to do there? my simplistic way of thinking of
5687 it is $ allows you to change the start conditions and start
5688 again at |- so $(a 5, b 5) would work there and exit with a= 5
5689 printing just 5
5690
5691 you have to tell it which face ur modifyibf
5692
5693 separated by commas
5694
5695 the thing I think is least helpful in your example is that it
5696 only causes one recursion. you’re just giving the face a new
5697 value instead of modifying and recurring multiple times. you
5698 should try just $(a +(a)) which will end printing 10. you could
5699 also add a =| c=(list @ud). 1, change your finish condition to
5700 [a c] and your $ to $(a +(a), c [a c]) and see what a looks like
5701 each recursion
5702
5703 typo - do not include “. 1”
5704
5705 I am starting to understand it better. suggest walking thru
5706 the Fibonacci example too. %= $ is just a tall version of $()
5707 for our limited purposes so you can see more easily face ->
5708 transformed value -> recursion
5709
5710 in my suggested construction your output should be like [10 ~[9
5711 8 7 6 5 4 3 2 1]]
5712
5713 note that the $ transforms happen “simultaneously” or in other
5714 words +a is not represented in the first term of c there
5715
5716 ~somlus - I think comet was having issues getting planet into
5717 this room... :(
5718
5719~borlyt yeah i messed up with my $() syntax
5720
5721~rabsef any luck there ~borlyt?
5722
5723~walden hiya
5724
5725 weird, sorry
5726
5727 set: + ~somlus-savlev/hoontards
5728
5729~widbur ~somlus, i am, but it can't join this channel. there's a bug, an
5730 issue has been filed, someone is purportedly working on it
5731
5732 .
5733
5734 .
5735
5736~donbec hi
5737
5738 hi
5739
5740~sanlyt test
5741
5742~somlus received.
5743
5744 ah got it ~widbur. FYI I have seen that when I join channels
5745 too soon after launching a ship for the first time. It needs to
5746 equilibrate or update or something first. So now I launch new
5747 ships (or moons etc) and then walk away for 15-20 mins and then
5748 join everything. I have no idea if this is a real workaround or
5749 I just get lucky when I do it that way
5750
5751 Oh also - my ship was offline for a bit today.
5752
5753 my machine with the ubuntu install on it (where it lives)
5754 rebooted itself. I have to figure out if that was an
5755 update-related reboot or if I have an unstable system. This is
5756 the first instance
5757
5758~hadpun ~somlus i do the same and it kinda works, ships (especially
5759 moons) need a while to set everything up, especially network
5760 wise
5761
5762~somlus yeah moons are a mixed bag.. Sometimes they work great and
5763 sometimes they just barely hobble along. Sometimes they are
5764 birthed with some but not all of the planet's subscriptions
5765 automatically.
5766
5767~hadpun quite weird
5768
5769 when booting this one, i wasn't in any chats, but whatever my
5770 planet typed, regardless of chat, I could see
5771
5772~somlus That's odd. I think that they are focusing their energy on
5773 non-moon features and fixes, which makes sense when they are
5774 trying to make Urbit ready for the public this yeary.
5775
5776~hadpun do you by chance know if windows support is on the way? i have a
5777 bunch of friends who would join pretty fast if they didn't have
5778 to buy a mac/install linux
5779
5780 yeah
5781
5782 can someone explain what the "subject" is
5783
5784 been going through this rn
5785
5786 https://urbit.org/docs/tutorials/hoon/the-subject-and-its-legs/
5787
5788 and am quite confused
5789
5790~rabsef the subject is dependent o what sort of thing you are running.
5791 in a “naked gen” the subject is the entirety of the generator
5792 inclusive of the sample aka arguments
5793
5794 in other contexts it can be the entiret of the operating
5795 environment
5796
5797~somlus hadpun windows support is not coming but a coming windows update
5798 will allow for an actual real deal linux kernel in the ubuntu
5799 install so the ubuntu VM on windows should run flawlessly and
5800 urbit can be installed on that. for now you can easily install
5801 ubuntu on the free version of VMWare
5802
5803~rabsef generallt the subject is “everything”. imagine it like this
5804 - your brain runs programs on your experience and knowledge,
5805 and any new incoming information becomes part of that set of
5806 knowledge/ experience - further and finally, your brain programs
5807 can be operated against as well qua subject - in the case of say
5808 evaluating your thinking process
5809
5810 another possible example. everything in urbit is a noun
5811 including programs the biggest noun, is the noun of all
5812 operational data available aka everything
5813
5814~ronreg in a naked gen the dojo environment has to be part of the
5815 subject too, right? otherwise you wouldn't be able to call std
5816 library functions
5817
5818~rabsef and that noun is the subject - kinda
5819
5820 I think that’s partly true. Hoon.hoon is available but now eny
5821 beak are not and they’re part of dono
5822
5823 maybe I’m wrong ~ronreg. great point
5824
5825 one can also call custom libraries in a naked or other gen afaik
5826 so only the base case is “just Hoon.hoon” if that’s right, at
5827 all.
5828
5829 is it just me or is this the most inefficient way to implement
5830 addition
5831
5832 addition is a simple bit operation, isn't it?
5833
5834 this is in the hoon.hoon file
5835
5836~rabsef When I don't understand an implementation, I say "Oh that's
5837 because Nock works that way" - how does that feel as an answer?
5838 ;)
5839
5840~hadpun kind of helps, but when it comes down to machine operations this
5841 just seems slow af
5842
5843 imagine (add 1000 1000)
5844
5845 you'd need 1000 actions
5846
5847 whereas just adding the 2 rows of bits is quite easy to do for
5848 hardware
5849
5850 idk maybe i'm thinking of it wrong
5851
5852~rabsef That's the concept of a jet
5853
5854~hadpun a jet?
5855
5856~rabsef nah I think you're right - that's why a lot of mathematical
5857 actions are jetted - but the idea is that Nock has to be able to
5858 perform them too
5859
5860 a jet is an outside assisted action
5861
5862 doesn't perform in nock
5863
5864 as long as jets are trusted, then there is no problem
5865
5866 https://urbit.org/docs/tutorials/vere/jetting/
5867
5868~borlyt so it's like for example C-code that's being run instead of
5869 nock?
5870
5871~rabsef A "jet" is a sort of software device driver in Urbit. Urbit is
5872 precisely defined in terms of an interpreter that fits on a
5873 T-shirt, Nock. But a naive implementation of Nock is nowhere
5874 near practical, because Nock has only one integer operation:
5875 increment. For example, to decrement a number in Nock, you
5876 increment a counter up to the number under it.
5877
5878 They agree w/ you
5879
5880 correct
5881
5882 https://urbit.org/blog/common-objections-to-urbit/#jets
5883
5884 also jet just sounds cool
5885
5886 tbh
5887
5888~borlyt that seems like a massive flaw in nock, no?
5889
5890 they're using hotfixes to make up for bad decisions made in
5891 the writing of nock, isn't this the problem Unix has but to an
5892 extreme degree? isn't urbit supposed to fix this?
5893
5894 the point of the rewrite of our entire OS is to get a clean
5895 slate and "do it right this time"
5896
5897~rabsef You should read that objection
5898
5899~minder +1 ~rabsef's statement
5900
5901~borlyt I get the general idea they're going for but addition really
5902 shouldn't be this hard. it's literally 1 hardware operation
5903
5904~mocrux It just depends on the base primitives you work from.
5905
5906 If you choose to use a very very simple system from the core
5907 (you encode less inherent primitives) well then you need to
5908 define things like this.
5909
5910~rabsef I think for further elucidation you should ask someone from Tlon
5911 about it because I lack the requisite understanding to defend it
5912 properly
5913
5914 but they're all in a big fun meeting together so it might be a
5915 min
5916
5917~mocrux It's kind of like looking at System F/lambda calculus and saying
5918 it's too complicated to do anything with.
5919
5920~sarpen it's a common paradigm in many functional languages, say you're
5921 dealing with natural numbers, they're recursively defined as
5922 nat=zero or successor(nat)
5923
5924 and then operations are defined in terms comparing how many
5925 succ there are in a value, for type checking to work out
5926 appropriately, but then they'll do something analogous to
5927 jetting for actual computation
5928
5929 ^
5930
5931 it's like looking at the natural numbers and saying "we need
5932 the reals" without going through and proving the reals can be
5933 constructed from the nats
5934
5935~mocrux The tradeoff is you create a system that makes sense and is
5936 analysable from bottom-to-top for a human inspecting it, but
5937 that you can fit in black boxes that speed things up without
5938 having to needlessly look into the black boxes and adding
5939 essentially useless complexity.
5940
5941~widbur no one says the implementation has to be naive
5942
5943 it just has to be functionally (punz ftw) equivalent
5944
5945 i'm not at all sure that side-effects and ephemeral data are a
5946 problem for OSes, and therefore that their removal is going to
5947 be brilliant
5948
5949 it's useful in pure functional languages because it is a way
5950 to control and limit shared state, thereby reducing perceived
5951 complexity from a given vantage point
5952
5953~ronreg ~sarpen-laplux: this is precisely how Agda works
5954
5955 you define the naturals in a provably sound way, and then add a
5956 pragma annotaiton to tell teh compiler to map these to machine
5957 integers
5958
5959 same with booleans and a few other types
5960
5961 that said, I don't htink agda is a terribly practical language
5962
5963 and I think "The fact remains, however, that a Nock interpreter
5964 without jets is completely useless. And there is not even an
5965 informal document that tells you what jets you need for a
5966 reasonably efficient Urbit. (There should be such a document.)"
5967 matters quite a bit
5968
5969~mocrux ~ronreg, I think it's common among most if not all the
5970 dependently typed languages/theorem provers that allow for
5971 executable code.
5972
5973 Though I'd agree documentation is definitely important for
5974 explaining what are the bare essentials for jets
5975
5976~rabsef Anyone understand %~ and want to help me understand how ~(. door
5977 arg) can be used to then run the arms of that modified door?
5978
5979~sarpen ~(arm core sam) resolves core, replaces it's sample with sam,
5980 and then evaluates arm with respect to it
5981
5982 with arm=. that means the entire core
5983
5984 so it's technically not always the arm, but arm-style wing paths
5985
5986 (I think)
5987
5988 one would use ~(. door arg) or door(arg) mostly when I think you
5989 want to replace the sample of a door, and then call arms from it
5990 later
5991
5992 call/read
5993
5994~rabsef but what I want to do is once having modified the door/core,
5995 call it w/ the arms to modify against the sample and then get
5996 the modified sample back
5997
5998 Yes - I think you're right
5999
6000 ~(. cardmanipulation swapdeck) in my case gives me the arms in
6001 my door like <5.has> just like if you .add in dojo
6002
6003 what good does that do me tho? How do I use that?
6004
6005~sarpen oh you want an arm to return a modified version of the door it's
6006 in? i.e. its parent's core?
6007
6008 an arm that's a gate*
6009
6010~rabsef how do you do that last bit
6011
6012 >call arms from it later
6013
6014 Not quite - I'm not explaining it well
6015
6016 I have a core that has an arm that is a door. That door/arm
6017 manages a deck of cards
6018
6019 It has a bunt value of x deck. Each arm inside that door
6020 modifies the deck in certain ways
6021
6022 What I need to be able to do is call that door several times,
6023 use the arms against the bunt value of the deck (or subsequent
6024 decks that came out of the last time the door and arms were
6025 called) and return the deck
6026
6027 https://pastebin.com/DhWyU9b0
6028
6029 see near bottom for my door
6030
6031 I think maybe the problem is that my door's arms aren't gates so
6032 they don't generate output - they just manipulate the sample
6033
6034 so ~(arm door arg) doesn't work cuz there is no output
6035
6036 and since each arm operates against the sample again, I can't
6037 nest them like (arm door (arm door (arm door arg)))
6038
6039 does that make sense?
6040
6041 I could rewrite the arms to have outputs but i just was
6042 wondering if there's a way to proceed from here
6043
6044~sarpen ~(arm door arg) should work just fine
6045
6046 if it's a gate, ~(arm door arg) would receive the gate - not yet
6047 evaluated
6048
6049~rabsef but ~(arm door arg) doesn't produce anything - how do I request
6050 arg back from ~(arm door arg)
6051
6052 it's not a gate - that's my issue, I think
6053
6054 ti's just some hoon that operates against initial arg or
6055 supplemented arg
6056
6057~sarpen I think the problem might be that cardmanipulation is a gate
6058
6059 er not a gate
6060
6061 but a core
6062
6063 >but ~(arm door arg) doesn't produce anything
6064
6065 it produces nothing at all? or
6066
6067~rabsef I might be able to write everything down there again as gates
6068 but I was hoping not to lol
6069
6070~sarpen no you shouldn't have to
6071
6072~rabsef sorry - I'm getting a little lag and not seeing your comments
6073
6074~sarpen if the only arg you need is in the door it shouldn't be a
6075 problem
6076
6077~rabsef ~(. cardmanipulation swapdeck) gives me the number of arms and
6078 other information a la .add in dojo
6079
6080~sarpen right
6081
6082~rabsef ~(jokerafunc cardmanipulation swapdeck) I think gives me a nest
6083 fail
6084
6085 let me try again
6086
6087 If I just put ~(joker card swap) after giving swap a face at the
6088 top I get a nest fail
6089
6090 I can try =/ test ~(joker card swap) and then outputting test
6091
6092 nest fail as well
6093
6094 My supposition is that I am nest failing because joker doesn't
6095 produce a gate that would take the doors arm and do something
6096
6097 instead it just modifies the arg (arg not arm above) for the
6098 next arm of the door. If I just do =~(cardmanipulation arm arm
6099 arm arm arm currentdeck) I get the current deck that I want to
6100 us eas the starting deck next go round
6101
6102 bUt I don't understand how to pass that and then call the door
6103 again
6104
6105 I tried =~((cardmanip swapdeck) arm arm2 arm3 armn current deck)
6106 but it didn't like that
6107
6108 ere =~(cardmanip(currentdeck swapdeck).....
6109
6110 Imagine this simple example from bank account
6111 https://urbit.org/docs/tutorials/hoon/bank-account/ <- how would
6112 you recurse that so the second time you called it you started
6113 with acct balance = 150
6114
6115 assuming the door existed in a larger core, nd each time you
6116 recur you have to use the value to do some other operation in an
6117 arm of the parent core
6118
6119 and maybe this is the wrong strategy for doing that - so i'm
6120 open to ideas
6121
6122 I'm just going to rewrite them as gates and nested call them as
6123 described
6124
6125~sarpen >~(jokerafunc cardmanipulation swapdeck) I think gives me a nest
6126 fail
6127
6128 hmm
6129
6130 lemme reread in morn
6131
6132~rabsef I rewrote it
6133
6134 and it still doesn't quite work - output wont cast into a
6135 meaningful form
6136
6137~sarpen might try to hack on it
6138
6139~rabsef https://pastebin.com/AVCHVZeE
6140
6141 now it's all gates but when I call even one of them the output
6142 is a mess of shite
6143
6144 can't cast it into a meaningful form
6145
6146~sarpen maybe try =+ cm=~(. cardmanipulation swapdeck) jokerafunc:cm
6147
6148 it shouldn't be gates
6149
6150 where are you trying to call it?
6151
6152~rabsef at %~(jokerafunc cardmanipulation swapdeck)
6153
6154 trying that w/ the other copy - one min
6155
6156 nest fail
6157
6158~somlus sorry about the lag, folks. I might have to breach if I can't
6159 figure this out. I might change my hardware location to one
6160 where I get fantastic up/down speeds. At home (where it lives
6161 now) I have 1GbPS down but only 40 Mbps up.
6162
6163 ~rabsef what are we covering tomorrow. Also in my effort to
6164 figure out why things are so laggy, can you tell me how many
6165 (more or less) chat channels and notebooks you are subscribed
6166 to? I am subscribed to about 35 chats and 20 or so notebooks.
6167 Shouldn't be that, but I'm looking at all angles now.
6168
6169~rabsef tomorrow we will slavishly hack away at my generator until it
6170 works
6171
6172 after going through
6173 https://urbit.org/docs/tutorials/hoon/recursion/ and
6174 https://urbit.org/docs/tutorials/hoon/recursion/
6175
6176 we should review https://pastebin.com/ac3Yc1ky and comment it
6177
6178~somlus rock it out. let's do it. I will work on that today.
6179
6180 oh those two links separated by "and" were the same. is there
6181 another link to go through other than the recursion one?
6182
6183~rabsef https://urbit.org/docs/tutorials/hoon/fibonacci/
6184
6185 my b
6186
6187~somlus got it
6188
6189 Interesting, I unsubscribed from some chats and now it's
6190 responsive as hell. We'll see how long this holds up
6191
6192~rabsef yah it's faster here too
6193
6194~somlus I only unsub'd to like 3-4
6195
6196~rabsef I'm in like 10-15 and subscribed to like 8 notebooks
6197
6198~somlus one of them was your snapple one!
6199
6200~rabsef to answer your prior question
6201
6202~somlus thx
6203
6204~rabsef lol oh well that doesn't exist rn so that might be the problem
6205
6206 oh no wait it does
6207
6208 ~rabsef-bicrym/snapplefans
6209
6210~somlus yeah, it actually might be a problem to be subscribed to ones
6211 that don't exist. Perhaps it goes on fetching and fetching.
6212
6213 wow i'm like in a little heaven here of responsiveness for a
6214 while.
6215
6216 I'd be pretty surprised it it was my internet speeds TBH. must
6217 be something else.
6218
6219~rabsef yah uve never been this snappy here
6220
6221 tbh - is nice
6222
6223~somlus wow. I wonder if that is it
6224
6225~rabsef I'm going to wrastle this thing to the ground today
6226
6227 by hook or bloody crook
6228
6229~somlus I admire your tenaciousness
6230
6231~rabsef I just took the goddamned door out and I think it's gonna work
6232
6233 I wish I understood doors but I'll take working over that
6234
6235 fudging awesome
6236
6237 I just found a previously unnoticed bug in one of my arms now
6238 that they're written as gates
6239
6240 I think I'm there.
6241
6242 it works
6243
6244 I did it
6245
6246~somlus what was the bug? just something tiny?
6247
6248~rabsef 1 math issue cuz I'm dumb
6249
6250 then I just decided to go back to my original idea of using a
6251 counter declared to do a transformation twice the first time and
6252 once every subsequent time
6253
6254 it works - posting soon
6255
6256 https://pastebin.com/pk0RLwdW
6257
6258 actually I think I don't need the counter
6259
6260 Doing the transformation for tempvalcard twice always works
6261
6262 I forgot to even increment passone
6263
6264 that... doesn't make sense
6265
6266 oh yes it does I just still have trouble w/ recursion occurring
6267 simultaneously
6268
6269 hot damn
6270
6271 I'm projecting one into the future each time and adding the past
6272 value at the same time
6273
6274 WILD STUFF MAN I'm so pleased
6275
6276~somlus kapow!!!
6277
6278~rabsef Probably don't need to triple post this but here we go:
6279
6280 I done it.
6281
6282~borlyt Caesar cypher?
6283
6284~somlus Here is my commented hoon 101 3a exercise. See you at 9am (1:13
6285 from now)
6286
6287 https://pastebin.com/DqyWFNzu
6288
6289 Will be stepping away, but a couple of questions confuse me and
6290 i did not include them in the paste.bin because it would get too
6291 busy. Q1: so it looks like recursion includes the line where $
6292 lives, and once that line's code is complete THEN it jumps back
6293 to the trap beginning?
6294
6295 Q2: It's interesting that a variable can name itself in the line
6296 of code whereby the variable assumes a new value. I just want
6297 to be sure that I understand that the nested code is completed
6298 first (before the variable changes value) and then the outer
6299 code happens whereby the variable assumes the new value. Seems
6300 like that must be it.
6301
6302 Headed on a short errand, should be back in time
6303
6304~rabsef ~borlyt - solitaire cipher. can be decoded with a physical pack
6305 of cards
6306
6307 https://en.m.wikipedia.org/wiki/Solitaire_(cipher)
6308
6309 or encoded for thst matter - gonna build in custom deck starting
6310 state functionality next
6311
6312 Hello ~somlus!
6313
6314~somlus Hello sensei
6315
6316~rabsef :-D Are you ready to begin?
6317
6318~somlus Very shortly
6319
6320~panlux Talking as moon
6321
6322~rabsef reading you loud and clear
6323
6324~panlux opening pandora
6325
6326 opening multiple windows on multiple screens (believing,
6327 falsely, that flair equals competence)
6328
6329~rabsef It definitely contributes to it
6330
6331~panlux ready, boss. Do you have the pastebin open for my commenting on
6332 that code?
6333
6334 and there are two questions above
6335
6336~rabsef I do and I read
6337
6338~panlux 3 2 1 go
6339
6340~rabsef Let's start w/ your pastebin - There's one or two things I'd
6341 like to clarify/modify in how you thought through this
6342
6343~mocrux That's why I always have a script that just prints random files
6344 of code fullscreen at blazing fast speed on a 2nd monitor to
6345 make it feel like I'm in a hacker movie 24/7 while coding
6346
6347~panlux yes!
6348
6349~rabsef 1) Line 4 - >(that is this program) - > Are you stating that the
6350 sample is the program? Is that right?
6351
6352~panlux you honed right in on something I was lazy about. I need to get
6353 the vocab right. generators, samples, parts of generators called
6354 wings and limbs. Still don't have it all down, so I say program
6355
6356 here I meant this entire set of code
6357
6358 all falls under |=
6359
6360~rabsef Let's just review the terms briefly. A gate (|=) consists of
6361 a battery and payload. The battery is the one arm named $,
6362 the payload is the data required to compute $. The payload is
6363 further divided into sample and context. The Sample, rightly, is
6364 the input value or /n/ in our case
6365
6366~panlux thank you that is clear. However, I thought that $ was specific
6367 to the recursion, and was only a marker / trigger for recursion.
6368 Here it seems to have a much more important definition
6369
6370~rabsef second, @ud is not technically "real numbers" Both @s and @u
6371 would be real numbers or integers. @ud is an unsigned decimal
6372 which could be real.
6373
6374~panlux should have looked that up instead of assuming
6375
6376 I see it now on my printout list of auras
6377
6378~rabsef So that's a little past my understanding but the way I think of
6379 it presently is that $ is the arm of computation that occurs to
6380 produce an output. This could happen through recursion where $
6381 could be explicitly called and modified several times or, in the
6382 case of a trivial gate like |= a=@ud a where input is printed
6383 back, I think it is still the unnamed $ that we are computing
6384
6385 or the undeclared $ i should say
6386
6387 uncalled* even more rightly in line w/ the prior paragraph
6388
6389~panlux is $ specific to the rune |= ?
6390
6391 or is it used all over the place?
6392
6393~rabsef It is used in all cores, as far as I know. But, in gates, there
6394 is only one arm and it is named $. In higher level cores, there
6395 can be other named arms in addition that contribute to the
6396 computation of $
6397
6398~panlux actually if $ is "the thing we are computing" then that actually
6399 clarifies things for me. I have often been lost in the code
6400 as to exactly where the output is stored. In Basic (I know, I
6401 said basic, it's from my youth) you were only naming values to
6402 variables, and in excel you are always outputting to a cell.
6403 So here I had a hard time telling exactly what the output is
6404 outputting to
6405
6406~rabsef For instance, in my pontifex gen, there are like 10 arms, but
6407 the final computation is in $ and reads from the other arms to
6408 do things
6409
6410~panlux ok good that does clarify things
6411
6412 awesome. I'm surprised that is not front and center in the early
6413 part of the docs.
6414
6415~rabsef yah $ is like the cell or the value that you print in basic
6416
6417~panlux boom. hard to believe but that is a major epiphany for me.
6418
6419~rabsef awesome!
6420
6421~panlux we are seeking $
6422
6423 always (or mostly always so far)
6424
6425~rabsef there's some nuance in that comparison insofar as like the
6426 cell can be recursively re-computed before output, right, and
6427 technically the output is the result of computing $ but whatever
6428
6429~panlux olk
6430
6431 ok
6432
6433~rabsef ok, so you formed the trap yep, then let's look @ line 16
6434
6435 Yes, at first t is 1 but we only know t is 1 if n is 1 first
6436 iteration, right?
6437
6438 t /starts/ as 1 but $ will modify t based on some parameter to a
6439 new value each recursion
6440
6441~panlux oh yeah, we are counting down so would this be the stop point
6442 then?
6443
6444 I thought it was an early stop in case the user entered 1, but
6445 it works either way as n counts down to 1. stops there with an
6446 accurate t value
6447
6448~rabsef an important note here - failing to modify the values you expect
6449 to modify in $ can easily result in an endless loop - imagine if
6450 we never decremented n and gave it +thiscore 3
6451
6452 it would just multiply 3 * t endlessly
6453
6454~panlux got it. does the system hang then or know there is an error and
6455 tell you?
6456
6457~rabsef It is /both/. If the user enters 1, the recursion is never
6458 called and the trap never returned to
6459
6460 the output is t, which by default is 1
6461
6462 the system spins / until you ctrl-c basically
6463
6464 if you do it bad enough it crashes - depends on what you're
6465 making the poor thing do
6466
6467~panlux ok
6468
6469~rabsef ok so let's look @ 19. I would like it if you thought of 19 as
6470 including the idea "if n!=1 then..."
6471
6472 Because ?: has two potential outcomes, just like
6473 =IF(condition,true,false) in excel
6474
6475 I assume you thought this implicitly based on 16 but it's good
6476 to remember it
6477
6478 also this helps remind us of explicit children in hoon
6479
6480 and you have the function of the $ down correctly. In other
6481 words, you might say - reiterate the loop w/ these changed
6482 starting conditions
6483
6484 So - I think unless it would be dull to you, we might think
6485 through the products and give ourselves some example starting
6486 n's?
6487
6488 Incidentally, if you've not seen that notation before != means
6489 not equal to
6490
6491~panlux ah I did not get it. you give me too much credit. So this line
6492 is the "then" line if n does not equal one correct?
6493
6494 yeah was just about to ask
6495
6496 got it
6497
6498~rabsef Correct. As I too easily brushed over - $ qua starting again w/
6499 changed initial values does not occur if n=1 at the first pass.
6500 Instead $ is computed as t
6501
6502~panlux got it. What is "- $ qua" in your most recent statement?
6503
6504 I mean "$ qua"
6505
6506~rabsef qua = "defined as " or "in the sense of"
6507
6508~panlux thank you
6509
6510~rabsef sorry. So let's talk through this gate as if we are it.
6511
6512 Our user has just given us a /sample/ of 2
6513
6514~panlux great
6515
6516~rabsef What is our first step? I will give it to us - first, we are
6517 given as known that t=@ud = 1
6518
6519 What happens next?
6520
6521~panlux it states that n is that number that was given to us
6522
6523~rabsef sorry - yes technically the first step is definitely that we
6524 give a name or face to 2 that is n
6525
6526 very good.
6527
6528~panlux then the next step to inform hoon that there is a trap that is
6529 being set up and sets up the start point
6530
6531 and right after that it says is the number the person entered (2
6532 in this case) equal to 1?
6533
6534~rabsef Yes - so we know we may be coming back here again if we are told
6535 to
6536
6537 Yes - and is it?
6538
6539 lol
6540
6541~panlux If yes (though it's not), then output t, but since it is not
6542
6543 it goes to two lines down which is code line 20
6544
6545 and then in 20, I do want to get into the weeds here.
6546
6547~rabsef Ok so may I? or would you like to describe?
6548
6549~panlux I'll try
6550
6551 it says "ok so here is the recursion point - be advised Hoon,
6552 after we're done with this line, go back to |-"
6553
6554~rabsef Yes
6555
6556~panlux and then it says, ok I'm going to redefine n, but first I will
6557 use n in it's OWN redefinition. NEW n is going to be equal to
6558 CURRENT n minus 1. But we will just call it n when this is done
6559
6560~rabsef yes - all redefinition 'kicks' or 'takes effect' post $ line
6561
6562~panlux and it also says similarly, I am going to redefine t, but first
6563 use it also. I want to multiply t by NEW n (but now just called
6564 n).
6565
6566~rabsef no
6567
6568 that is the one error in thinking - and I have it too
6569
6570~panlux ok that was a question
6571
6572~rabsef yes sorry
6573
6574~panlux no worries at all, just commenting.
6575
6576 it reads from right to left
6577
6578 ?
6579
6580~rabsef I do that exact thing still tho. Just wanted to let you know
6581 that it's hard to get over
6582
6583 lol
6584
6585~panlux so the t calculation happens with the old n? and then the old n
6586 is used once again to make the new n?
6587
6588~rabsef No - not that either. Instead, what happens in $() only takes
6589 effect thereafter
6590
6591~panlux wow. ok
6592
6593~rabsef So $ says "For the next pass, starting from trap, please use n
6594 as n-1 and t = as (current n * t)"
6595
6596 but current n is still the n to wit in n-1
6597
6598~panlux and also the mul t n
6599
6600 ok got it. so you have to think of this line as needing to be
6601 complete and the very finishing touch is to make the changes on
6602 the variables before Hoon leaves this line
6603
6604~rabsef yes that's what I mean - so with our values, we would say "Start
6605 again at trap w/ n = 1 and t = 2 * 1
6606
6607~panlux ok cool
6608
6609~rabsef yes - I like that - the finishing touch is to take effect
6610
6611 and that happens while we the program are cycling back up to 11
6612
6613 (this one goes to 11)
6614
6615 so now we are at 11 w/ n=1 and t=(2*1) or t=2
6616
6617~panlux ok cool! I just ran the code and it works. 5 produced 120 and 10
6618 produced 3.629.800
6619
6620 mf year
6621
6622 yeah
6623
6624 (nice spinal tap reference)
6625
6626~rabsef lol yah so what's another name for this function?
6627
6628~panlux factorial
6629
6630~rabsef hell yah
6631
6632 So before we look @ something a little harder - any questions?
6633
6634~panlux sorry i jumped ahead for fun. we should finish out what happens.
6635 Then with n=1 when you get to the logic question, n=1 and so it
6636 spits out t, and that is 2
6637
6638 yes one question
6639
6640~rabsef ^correct re: final step
6641
6642~panlux You said that the program produces $, but it actually does not -
6643 it produces t and that is spit out at the end
6644
6645 so let's briefly revisit what you mean by it has $ as a final
6646 product
6647
6648~rabsef Yes - this is the nuance $ is the computation that leads us to a
6649 leg. A leg is anything that is not an arm, i.e. a fully computed
6650 noun
6651
6652 $ is an arm, i.e. something that still requires computation
6653
6654 once buc is settled it is the output (t)
6655
6656~panlux is t the leg? or what would be the leg here?
6657
6658~rabsef t is a leg, yes. Buc acts on the leg t until the arm collapses
6659 to no further computations
6660
6661 it also acts on teh incoming leg n
6662
6663 and it does so in everything from 11 to 20
6664
6665 Maybe think of $ as the current operation at the (usually) top
6666 of the program - that which will collapse
6667
6668~panlux why is n a leg? is user input considered a process with an
6669 endpoint?
6670
6671~rabsef a user input that is a noun that is not a computation is a leg
6672
6673~panlux ok I do think it is useful to think of it that way. $ is
6674 the actual meat of the computation. the rest is sort of
6675 decision-making and establishing rules
6676
6677~rabsef if the input were like a gate somehow it would be different.
6678
6679 Here is a forinstance - in my pontifex deal, I have some nested
6680 arms - so you do one operation to the deck then another (arm
6681 (arm (arm starting leg)))
6682
6683~panlux actually it's very useful to think of it that way. ANother
6684 imporant addition to the hoon intro section. (we need to
6685 first create rules and then flow and then ultimately make a
6686 computation. ok let's do that)
6687
6688~rabsef something like that - the leg is a leg because it doesn't
6689 require any computation. Before the arms are computed inside
6690 to outside, they are arms - as they collapse into values they
6691 create legs for the next arm
6692
6693~panlux copy that on user imput
6694
6695~rabsef $ technically (I think) includes the decision making as that is
6696 part of what tells us /how/ to computate
6697
6698 does that track for you?
6699
6700~panlux I think so yes
6701
6702 So since I have made two generators now, I need to call my
6703 mother and tell her I am a coder.
6704
6705~rabsef lol do it
6706
6707~panlux (opens window with falling matrix symbol animations)
6708
6709 ok so what's next chief?
6710
6711 we have a good 20 mins
6712
6713~panlux https://www.youtube.com/watch?v=rpWrtXyEAN0[embed]
6714
6715 matrix raining code for 1 hour
6716
6717~rabsef https://urbit.org/docs/tutorials/hoon/fibonacci/
6718
6719 We're going to look @ that.
6720
6721 Need a few initial data points
6722
6723~panlux ok greqat
6724
6725~rabsef =+ declares lots of variables together at once (rightly faces
6726 for nouns)
6727
6728 %- does something to the output thereafter itself
6729
6730~panlux by line:
6731
6732 https://pastebin.com/U4LA1QPt
6733
6734~rabsef %= resolves a "wing" (arm) based on a series of changes
6735
6736 Sorry - yes. So 2 is operate "flop" (invert what we have)
6737 against our output, 3 is decalre many variables (could use =/
6738 repeatedly) and 6 is just a very long $(blah)
6739
6740 /in this case/ - %= could modify some other wing, but for us
6741 here it is buc
6742
6743 oh - one more is the part after the trap on line 4 - it just
6744 casts (or prints) our output as in the form of r as declared (a
6745 list of @uds)
6746
6747~panlux ok cool, digging deeper
6748
6749~rabsef I wouldn't worry to omuch about those specific parts - but I'll
6750 fill in gaps if we get stuck walking through.
6751
6752~panlux sounds good.
6753
6754~rabsef I would suggest you get a paper to write some values on - cuz
6755 we're going to want to do n = 3 or something to see what happens
6756
6757~panlux yes, I actually print the code in very large print and write all
6758 over it. That is how I am getting through this.
6759
6760 Another thing I will sugges to Tlon
6761
6762~rabsef One additional trick they're using here - remember what I said
6763 about avoiding infinite loops and making sure to operate on your
6764 variables? Here in %= we do not change n! How is this possible?
6765
6766~panlux will take me some time to get to that
6767
6768~rabsef look @ line 5 and line 7
6769
6770 what are we doing
6771
6772 note the starting value of i at line 3
6773
6774 I will tell you if you would prefer - lmk
6775
6776~panlux it is zero
6777
6778 actually I think we are too far along for me to follow. Better
6779 to begin at the top and go through what each line is doing, more
6780 slowly.
6781
6782~rabsef Yes ok. 1 - we ask for input of an @ud
6783
6784 ignore 2 - we will come back to it
6785
6786~panlux ok got it
6787
6788~rabsef 3 - we declare 4 faces, i p q and r
6789
6790~panlux in three, =+ means combine a new noun with the subject. ok we
6791 are defining variables, but I get stuck at r
6792
6793~rabsef i = 0, p = 0, q = 1, r is a blank (*) or bunt value (don't worry
6794 about it - blank) list of @uds
6795
6796~panlux 'cause it's a weirdo
6797
6798 ok will nto worry about r for now
6799
6800~rabsef Let's talk about a list briefly. A blank list is [~]
6801
6802 Oh I just meant don't worry about * or bunt. We need to worry
6803 about r
6804
6805 lol
6806
6807 a list is [a [series [of [nested [cells [terminated [by ~]]]]]]]
6808
6809~panlux ok
6810
6811 got all of that
6812
6813~rabsef The computer politely prints it as [a series of nested cells
6814 terminated by ~]
6815
6816 but we must remember we are creating cells each time., read from
6817 right to left
6818
6819~panlux how cordial! And I came empty-handed.
6820
6821~rabsef yes well it's used to it
6822
6823~panlux yes, right to left
6824
6825 haha
6826
6827~rabsef what is (this is just another notation - putting the ~ out
6828 front) ~[1 2 3] in full write out?
6829
6830~panlux it is [1 [2 3]]
6831
6832~rabsef not quite
6833
6834 do not forget "terminated by ~"
6835
6836~panlux ~[1 [2 3]]
6837
6838~rabsef one might also write it [1 2 3 ~]
6839
6840 it's just different notation - annoying but you must get used to
6841 it
6842
6843~panlux ok got it
6844
6845~rabsef ~[1 2 3] is [1 [2 [3 ~]]]
6846
6847 /terminated/ by ~ always in a list
6848
6849 e.g the last term is always ~
6850
6851 ok so we know our variables. Let's move to 4, set a trap, ignore
6852 the cast, and move to 5
6853
6854 What happens on 5
6855
6856~panlux it says...
6857
6858~rabsef Here is a hint: Hoon does not know the difference between two
6859 spaces and a carriage return
6860
6861~panlux no it does not
6862
6863 ah thanks
6864
6865~rabsef they are synonymous
6866
6867~panlux it's a logic test. if i and n are equivalent, then r is the
6868 final output. if not then go to 6 and continue
6869
6870~rabsef precisely
6871
6872~panlux got me with those two spaces
6873
6874~rabsef now let's look @ line 7, assuming for the moment that it is part
6875 of a $() progression
6876
6877~panlux ok
6878
6879~rabsef what do we do to i=0 on each recursion
6880
6881 (just i rather, but starting at =0)
6882
6883~panlux add one to it
6884
6885~rabsef +(x) == (add 1 x)
6886
6887~panlux (sorry was looking something up)
6888
6889~rabsef yes - just making sure you knew that notation
6890
6891~panlux yes got it
6892
6893 on line 7 we will add 1 to i at the conclusion of the $ section
6894
6895~rabsef OK - so to return to my question earlier, how can we get away w/
6896 not modifying n as we did in factorial?
6897
6898 In factorial we counted n down to 0. Here, we count 0 i) up to n
6899
6900~panlux we are modifying other numbers instead and then comparing them
6901 to n - the opposite solution
6902
6903~rabsef (i)*
6904
6905~panlux counting up not down
6906
6907 oh sorry we are not adding one to i I read that wrong
6908
6909~rabsef precisely
6910
6911 no you're reading that right
6912
6913 each recursion we will add (increment up) one to i
6914
6915 increment is the only mathematical operator that knock has (to
6916 point to our discussion of jets a few days back)
6917
6918 nock*
6919
6920~panlux so +(2) would be 3?>
6921
6922 3?
6923
6924 +() is the add one function?
6925
6926~rabsef ok - so back at 5 for a moment - when i == n, we output r. Else
6927 we go to 6 and do some things
6928
6929 yes +(2) == 3
6930
6931~panlux yeah
6932
6933~rabsef ok - so the things we do - we know line 7, what is line 8?
6934
6935~panlux cool, so we add one to i, then we define p as q? (not sure why
6936 yet)
6937
6938~rabsef yes - you will see. and 9?
6939
6940~panlux add em together and that results in what will be the NEW q at
6941 the end of the $ sequence
6942
6943~rabsef and do note that "add them together" means add the /old/ p
6944 despite the fact that p has just been modified for purposes of
6945 the next pass
6946
6947~panlux yes, thank you for that reminder. that is important to note
6948
6949~rabsef same for line 10 then - what happens?
6950
6951~panlux line 10 I do not understand cince there is no command like "add"
6952
6953~rabsef great
6954
6955~panlux I don't know what putting numbers in a list does other than
6956 output that same exact list
6957
6958~rabsef this is shorthand and annoying also
6959
6960~panlux oh making a longer list?
6961
6962~rabsef this is the rune :-(a b) which forms a cell of [a b]
6963
6964~panlux oh thank you.
6965
6966 man we need them runes but I do see it on the hoon cheat sheet
6967
6968~rabsef so, to give it away, each recursion we will take r (which starts
6969 as [~]) and make a larger cell, the first of which will be [q ~]
6970 (~[1 2 3] = [1 [2 [3 ~]]] - see what we are doing)
6971
6972 we are hacking together a list in the long notation
6973
6974~panlux ok so if you start with list r such as [1 2 3 4] and q is 13 you
6975 get [13 1 2 3 4]
6976
6977 reading yourse
6978
6979~rabsef yes yes but do not forget the ~
6980
6981 r will always have ~ at the terminus
6982
6983~panlux true, also we are building to the right, mine built to the left
6984
6985~rabsef its "bunt" value is ~, we do not even need to tell the computer
6986
6987~panlux if the code was r [r q] then would it build to the left?
6988
6989~rabsef no we are building to the left. "adding to the head"
6990
6991~panlux got it, I am understanding that i need to use ~ and not get
6992 sloppy on that
6993
6994 ok always add to the head.
6995
6996~rabsef let me show you - if R already equals [1 2 ~] then the next pass
6997 we will make [q [1 2 ~]]
6998
6999~panlux ok I'm finally understanding much of this
7000
7001~rabsef because [x y] == :-(value value)
7002
7003~panlux copy that
7004
7005~rabsef and remember that a list is a series of nested cells - which is
7006 exactly what we are making
7007
7008 it is "computationally costly" to build a list on the right hand
7009 side
7010
7011 because effectively we must change EVERY cell, not just add one
7012 cell to the exterior
7013
7014 does that follow?
7015
7016~panlux makes sense, yes I understand.
7017
7018~rabsef that is adding 3 to the end of [1 [2 ~]] makes [1[2[3~]]]
7019
7020~panlux It's like taking one single base pair out of genetic code - has
7021 massive downstream implications
7022
7023 and tis tis just says go back to the recursion line 4?
7024
7025~rabsef sorry I forgot spaces there lol
7026
7027 tistis closes centis
7028
7029 centis has an indeterminate number of children
7030
7031~panlux oh ok
7032
7033 ah, got it. ok finally this makes sense.
7034
7035~rabsef however centis is modifying buc and buc will send us back to the
7036 trap
7037
7038~panlux at least something needs closure!
7039
7040~rabsef lol yah
7041
7042 I do on many of my past relationships! oh that's not what you
7043 meant huh
7044
7045~panlux haha! no closure on the other code was very hard for me.
7046
7047~rabsef ok so we have most of this - let's just hack thru it w/ n=3 so
7048 we have to do it 3 times
7049
7050~panlux ok so == closes this little redfining group of instructions and
7051 then we have reached the end so the recursion goes back to 4..
7052
7053~rabsef starting at line 5. 0!=3 so not r but...
7054
7055~panlux ok
7056
7057 increase 0 to 1
7058
7059~rabsef tell me what each variable in turn will be changed to
7060
7061 yes
7062
7063~panlux p is 0 and will become q (after ==)
7064
7065 q is 1
7066
7067 q will become the addition of old p and old p, which will be 1
7068
7069~rabsef old p and old q I'm sure you meant.
7070
7071~panlux yes sorry
7072
7073~rabsef np just making sure.
7074
7075 and what of r
7076
7077~panlux then r will be the list generated by old q (1) and a currently
7078 empty r, only definied by the stuff that will go into it but not
7079 yet by contents
7080
7081~rabsef what will it look like
7082
7083 if we outputted r immediately after this what would r b
7084
7085~panlux and the real change then is that p has become 1 and r will
7086 become ~[1]
7087
7088 ?
7089
7090 can you have a list of one atom?
7091
7092~rabsef p is not involved with r. R will become [1 ~] by proxy of q
7093 starting at value 1
7094
7095 yes, you can have a list of 1 atom - it is just a trivial list
7096
7097~panlux wait, just summarizing the changes at the conclusion of $, p
7098 does become r, so p goes from 0 to r (1)
7099
7100 oops shit
7101
7102 q
7103
7104~rabsef ok - so to define our recursion conditions -> i=1, p=1, q=1,
7105 r=[1 ~]
7106
7107 and n still equals 3
7108
7109~panlux yeah let me regroup on your observation and drop my line of
7110 thought as it was messed up
7111
7112 yes so all of that looks good, and then we go again through the
7113 $ instructions
7114
7115 i WILL become 2
7116
7117~rabsef ok because 1 !=3, yes - go on
7118
7119~panlux p WILL not change, or rather it will once again be set to q
7120 which is 1
7121
7122~rabsef yep
7123
7124~panlux q WILL become the sum of p and q which WILL be 2
7125
7126~rabsef write the long form cell of r
7127
7128~panlux and then r WILL become the former list plus the value of q in
7129 the head or ~[1] WILL become ~[2 1]
7130
7131~rabsef not quite
7132
7133~panlux I don't think there is a longer form of that
7134
7135~rabsef think about that again
7136
7137~panlux oh
7138
7139~rabsef and write it with all the [[[[]]]]s
7140
7141~panlux oh
7142
7143 [2 [1 ~]]
7144
7145~rabsef Hint: r is currently [1 ~]
7146
7147 bingo
7148
7149 didn't need a hint
7150
7151 no lol
7152
7153 wait
7154
7155 why 2?
7156
7157~panlux let's see
7158
7159~rabsef 2 is incorrect but your form is right
7160
7161 q old q is 1, q becomes 2 when? after ==
7162
7163 [1 [1 ~]]
7164
7165~panlux true. I didn't think there were two 1's in the solution but
7166 there it is
7167
7168 you're right
7169
7170~rabsef ok, so now we are back at ?: =(2 3)
7171
7172 thus, not r, so...
7173
7174~panlux back to recursion point with new variable values, i=2 p=1 and
7175 q=2
7176
7177~rabsef I suggest you write all the changes in one line so you do not
7178 think of them as occurring in order
7179
7180 yes that is right and that takes us to 6 which is where I meant
7181 my last comment to apply
7182
7183~panlux yeah, that is where I get screwed up. I will do that as an
7184 exercise. I will do this one by hand soon
7185
7186~rabsef Do me it on this recursion then - starting conditions i=2 p=1
7187 q=2 r=[1 [1 ~]]
7188
7189~panlux ah ok this is easy i is counting the number of recursions
7190
7191~rabsef instead of n counting down
7192
7193~panlux up to n, the total amount of recursions we have asked this thing
7194 to do
7195
7196~rabsef yep
7197
7198~panlux ok so with those starting conditions, i WILL become 3, p WILL
7199 become 2, and q WILL become 3, while r gets an old q (2) added
7200 to its head, which will make it [2 [1 [1 ~]]]
7201
7202 and we then can restart with i=3 p=2 q=3 r is what I put there
7203
7204 I'll be damned
7205
7206~rabsef right?
7207
7208 it starts to click after a while
7209
7210~panlux and it keeps going until we have it does the number of times we
7211 have told it to repeat. this is useful because we can easily
7212 make a loop of n times now with this simple toolkit
7213
7214~rabsef we are not quite done
7215
7216 2 things remain
7217
7218~panlux oh I was going to make n-5 chocolate souffles
7219
7220 n=5
7221
7222~rabsef currently we are outputting r because i=n now
7223
7224~panlux ok what remains?
7225
7226~rabsef r is [2 [1 [1 ~]]]
7227
7228~panlux ah yes. once i=n , then spit out r and for godsake let the
7229 little Hoon rest, will ya? (last part implied)
7230
7231~rabsef but that is not a list - that is a series of nested cells (which
7232 technically is what a list is but we want to pretty print it
7233 with the ~ out front
7234
7235~panlux ok
7236
7237~rabsef so - we have ^+ r which "casts" r as a list
7238
7239 take my word for that part
7240
7241 then we have line 2
7242
7243~panlux ok will do
7244
7245 oh and flop is reverse it?
7246
7247~rabsef which takes our list ~[2 1 1] and does something
7248
7249 yes
7250
7251~panlux I'm amazed that flop is up there at the top. why is that, when
7252 we read left to right and top to bottom and this work is done?
7253
7254~rabsef because flop nests around 1 argument
7255
7256 that argument is the computation of $
7257
7258~panlux oh the rest is a dependency
7259
7260~rabsef 1 child flop has only one child, and we must make the arm a leg
7261 for it to work
7262
7263~panlux a child of flop
7264
7265~rabsef (arm (arm (arm starting condition)))
7266
7267 exactly
7268
7269~panlux I hope my daughter is not a child of flop.
7270
7271 ok my simple homework is going to be to make a list that omits
7272 the duplicate 1. Will be an easy chance so I will do that and
7273 get back to you
7274
7275~rabsef lol
7276
7277 flop does work at least.
7278
7279~panlux interstingly, though, this flip completely deranges the meaning
7280 of the original list.
7281
7282 i wonder when that would be used
7283
7284~rabsef technically 1 is not duplicated - that's the nature of the
7285 fibonnaci sequence
7286
7287 fibonacci*
7288
7289 it's not wrong w/ the 2 1s that is
7290
7291 nah fibonacci sequence is 1 1 2 3 5 etc
7292
7293~panlux ah yes I recall.
7294
7295 it's been a while since I studied that sequence. just wanting to
7296 do a simple exercise.
7297
7298~rabsef You should write a recursion that does something else. Like
7299 makes a list of all n counting up to an input n where n is
7300 incremented once each recursion
7301
7302~panlux ah yea, 1+1=2, 2+1=3, 3+2=5, etc
7303
7304 yeah I will
7305
7306~rabsef basically n output = n, but as a list showing how we got there
7307
7308~panlux ok very fair
7309
7310~rabsef so like a list of all natural numbers leading up to and
7311 including n that is
7312
7313~panlux fantastic will do and then will have it count up to name
7314 ~somlus-savlev (not really)
7315
7316~rabsef lol u could do that
7317
7318 it'd just take a long time
7319
7320~panlux cool man this as always has been fun and fruitful! I will review
7321 all of this stuff this week and look forward to our new topics
7322 next Sunday.
7323
7324~rabsef I'll think about where we can go next
7325
7326 it was a delight :)
7327
7328 talk to you soon ~somlus
7329
7330~somlus me too. back to my somlus visage.
7331
7332 talk soon, and thanks. Very fun times.
7333
7334~rabsef just built in custom deck support for pontifex gen
7335
7336~risruc awesome stuff ~rabsef!
7337
7338~somlus what does pontifex gen mean?
7339
7340 oh that's the card generator
7341
7342~risruc pontifex is the name of the encryption mechanism created by
7343 pontifex in Cryptonomicon
7344
7345 i suggested ~rabsef look at building it, since he already had
7346 the card selection mechanism built and was looking for a next
7347 project.
7348
7349 and then the guy went ahead and did it.
7350
7351 like a boss.
7352
7353~rabsef it was a great challenge - thank you again!
7354
7355~somlus oh yeah! Sorry I even looked at that wikipedia entry on it
7356
7357~rabsef while driving today I realized there’s one code bug which I can
7358 fix, but what that means to me is more than making a mistake. I
7359 can conceptualize in Hoon now. I can think about thinking about
7360 it
7361
7362~somlus Very nice! And apparently you can put on after shave as a
7363 handsome bald man...
7364
7365~rabsef ^this msg took a while to get delivered
7366
7367 it's the feelsgoodman face! or at least the one that isn't a
7368 pepe
7369
7370~somlus ah boy maybe not fixed after all, but at least a little better.
7371 tomorrow will move ships to a non comcast ISP and then we will
7372 see
7373
7374~rabsef u gonna put it on the lil boy comp again
7375
7376 I can only imagine laptop turns off a lot
7377
7378~somlus I think I have the system settings set up properly to never
7379 sleep or turn off. my main concern is that the NUC has a bios
7380 setting to always restart after a power failure, while the
7381 laptop does not have such a setting. So the NUC is a bitter
7382 computer to recover from power outages on its own - just need
7383 scripts that auto-start my ships on boot.
7384
7385~rapfyr that is awesome ~rabsef
7386
7387~rabsef Thanks ~rapfyr; feels good to hear that too :)
7388
7389~mocrux I'll be looking forward to the "Novel Hoon Design Patterns #X"
7390 notebook entries you'll be running with in a few months ~rabsef
7391
7392 Assuming you keep up with this pace ;)
7393
7394~rabsef That is really encouraging and I am not going to let you down,
7395 at least insofar as keeping up the pace - Doubt I'll have novel
7396 contributions too soon, but I hope to be a (some kind of)
7397 contributor to this project in short order.
7398
7399 Thank you.
7400
7401~talfus :publish|subscribe ~master-lardyr %recettes-de-urbit
7402
7403 :publish|subscribe ~middev %urbit-resources
7404
7405 :publish|subscribe ~hatdyl-toldeg %eudaemonia
7406
7407 :publish|subscribe ~master-lardyr %urbit-journal-club
7408
7409 :publish &publish-action [%subscribe ~hardux-rigdel
7410 %self-reliance]
7411
7412~somlus Those go in dojo, you are probably aware
7413
7414 hit control X and then when you see your ship name with dojo,
7415 re-enter those
7416
7417~rabsef test
7418
7419 last test
7420
7421 ~somlus - I've lost the name of our last chat due to breaching
7422 again - thought I had it in a screenshot - apparently I did not.
7423 Please remind me at your convenience
7424
7425~hadpun does hoon have a sort of hashmap? key value pairs and stuff
7426
7427~rabsef there’s a map logic section in the tutorials on urbit.org
7428
7429 I might not be answering correctly but it has map - yes
7430
7431 also see the caeser cipher
7432
7433 https://github.com/rabsef-bicrym/urbitasofia
7434
7435 If you need some other examples of map functions, check out
7436 Pontifex on GitHub :-D
7437
7438 hoontards coming soon. we will cover recursion in more advanced
7439 forms today.
7440
7441 back in 15 ish. ~somlus, let me know if you can’t make it
7442
7443~somlus sorry!
7444
7445 I messaged you on the DM and should have checked this one.
7446
7447 I'll be here.
7448
7449 firing up my moon now
7450
7451~rabsef sorry - brt
7452
7453 missed the dm. this thing needs notifications
7454
7455~somlus no worries.
7456
7457 I'm having a real problem with moon communciations but that's
7458 ok. I can code there and talk here.
7459
7460~rabsef that should work fine
7461
7462 ok I'm at computer - let me boot my ssh connection and we'l lget
7463 started
7464
7465~somlus sounds great
7466
7467 I wanted to pre-annotate your code but I did not. I did print it
7468 out for annotation here
7469
7470~rabsef For anyone following along here and lurking, we're going to look
7471 @ https://pastebin.com/vK1DTLAS
7472
7473 and the ackermann function in the tutorials
7474
7475 Ok first things first, we're going to need to know a few things
7476 about lists that you might already know
7477
7478 1) A "tape" is a list of cords. A cord is a unicode character
7479 surrounded in ''
7480
7481~somlus ok got it
7482
7483~rabsef so 'a' is a cord 'at' is a cord, a tape is ['a' [' ' ['b' ~]]
7484 and so on
7485
7486 2) weld joins lists together first to second
7487
7488 so weld list1 list2 becomes list1list2
7489
7490~somlus copy that
7491
7492~rabsef 3) cass takes a tape and makes it lower case, cuss takes a tape
7493 and maeks it upper case
7494
7495 4) addressing the head or the tail of a list, requires first
7496 that you determine that it is non-null, and then allows you to
7497 do so via i.list or t.list respectively
7498
7499 aight - that's all we really need to know to get started w/ the
7500 pastebin
7501
7502 so we have some pretty basic text up to line 9 - we should be
7503 familiar w/ those parts by now
7504
7505~somlus cool. that is very straightforward, though I'm sure we will go
7506 into i.list or t.list more later
7507
7508~rabsef to review, we're simply declaring alternator as 1, declaring a
7509 blank outputstring and requesting (line 3) a valued incoming
7510 string
7511
7512 yes actually, let's start here - in dojo create yourself a tape
7513 with a face
7514
7515 =abc "a b c"
7516
7517 if you "abc" in dojo from there, you'll get back "a b c"
7518
7519~somlus done
7520
7521 abc
7522
7523 sorry
7524
7525~rabsef lol np
7526
7527 you're calling the face and getting the value
7528
7529~somlus got it, but in quotes
7530
7531 (oh as you said I would)
7532
7533 got it.
7534
7535~rabsef no quotes for what you put in dojo, sorr, so if you >abc in
7536 dojo, you get back "a b c"
7537
7538 you get it
7539
7540 anyway try i.abc which should give us a
7541
7542 what do you get?
7543
7544~somlus ?
7545
7546 I get an error.
7547
7548~rabsef not what you hoped for
7549
7550 this is because you have to make the list a lest or a non-null
7551 list first
7552
7553 How do we determine if a list is null? do you konw the rune?
7554
7555~somlus https://pastebin.com/PsJicDiq
7556
7557 ok
7558
7559 ~ is null but I do not know the rune
7560
7561~rabsef ?~ can check a list for 'null-ness' for us, and it has two
7562 children - a condition if true and a condition if false
7563
7564~somlus ?~ make sense.
7565
7566~rabsef Try ?~(abc %.y %.n)
7567
7568 in dojo
7569
7570 just like in excel, the children are in order true then false
7571
7572~somlus %.n
7573
7574 is what I get.
7575
7576~rabsef right, because abc is non null
7577
7578~somlus got it
7579
7580~rabsef we're on course. Now, let's try i.xxx - ?~(abc "this won't
7581 happen" i.abc)
7582
7583~somlus it did not accept that, stopped at -
7584
7585~rabsef Sorry - didn't mean the - from here I'll put dojo code in curly
7586 brackets to distinguish
7587
7588 exclude the curlies
7589
7590 {?~(abc "x" i.abc)}
7591
7592~somlus got it.
7593
7594 similar error
7595
7596 to the one above
7597
7598~rabsef if you just {abc} do you still get your tape?
7599
7600~somlus that I paste.bin'd
7601
7602 interesting, no I do not
7603
7604 same error
7605
7606~rabsef let's set it again {=abc "a b c"}
7607
7608 then repeat the above {?~(abc "x" i.abc)}
7609
7610~somlus I'm an idiot. I'm still pasting in th {} chars
7611
7612 will try again
7613
7614~rabsef lol nbd
7615
7616~somlus so {abc} works but
7617
7618~rabsef does {abc} yield output of "a b c" in double quotes, to confirm?
7619
7620~somlus yes sir but the {?~(abc "x" i.abc)} is not working
7621
7622 (without {} of course)
7623
7624~rabsef what does it do?
7625
7626 same error?
7627
7628 https://pastebin.com/5vg42Z0p
7629
7630~somlus now it does work, even though I put in the same thing 'a' is
7631 returned
7632
7633~rabsef ^what you should get
7634
7635 ah yes good
7636
7637 idk what happened time 1 but it doesn't matter
7638
7639 you should get 'a'
7640
7641~somlus got it
7642
7643~rabsef the head of the list abc is the cord 'a'
7644
7645 a tape is a list of cords
7646
7647 let's clear that by simply {=abc} in dojo to remove the saved
7648 face abc and destroy our data
7649
7650~somlus i.abc specified head?
7651
7652~rabsef yes sorry i is head and t is tail
7653
7654~somlus done, cleared
7655
7656~rabsef if you want you could do with {=abc "a b c"} then {?~(abc "x"
7657 t.abc)} and get " b c"
7658
7659~somlus (also incidentally this is all very well described, you are
7660 going to be GREAT at creating lessons)
7661
7662~rabsef why double then and not ' '?
7663
7664 let's actually do that
7665
7666~somlus I got " b c:
7667
7668~rabsef why?
7669
7670~somlus sorry " at end
7671
7672~rabsef why isn't it in single quotes?
7673
7674 Hint: nested cells
7675
7676~somlus is the answer something I've already learned? i honestly don't
7677 know though I do understand nested cells. I do not know how that
7678 relates to ' vs "
7679
7680 BRB in 2 mins, a handyman doing an ethernet install wants to ask
7681 me something. my apologies
7682
7683~rabsef I don't really expect you to intuit it but asking an impossible
7684 question might spur the answer to hae impact
7685
7686 no problem - waiting - tell me when you're back
7687
7688 Also, you could technically answer this given what we know from
7689 fibonacci but again I wouldn't expect it per se
7690
7691 Answer: [the head [everything [else [is [tail ~]]]]]
7692
7693~somlus i'm back
7694
7695~rabsef The head of a list is the exterior +2 value (remember the noun
7696 is +1, the head is +2, everything else is +3
7697
7698 so when we ask for i.abc, we get the value at +2 which is a
7699 cord, the tape is a list of such cords
7700
7701~somlus ah. the tail for (a b c) is [b c]
7702
7703~rabsef when we ask for the tail, however, we get back the list that
7704 remains because we are not asking for the cord at position
7705 +6 (in my bad example, the word everything), but instead the
7706 entirety of +3 (the list everything else is tail)
7707
7708 precisely - although more specifically, the spaces are also
7709 cords
7710
7711~somlus ah, so its [ b c]
7712
7713~rabsef let's clear abc {=abc} and make a tape that begins with a space
7714 to prove it {=space " tape"}
7715
7716 {?~(space "x" i.space)}
7717
7718~somlus I did not register mentally that spaces are cords. that is
7719 important since in the [1 2 3] notation the spaces are only
7720 separators of numbers
7721
7722~rabsef yes - that is confusing
7723
7724 that's a good point
7725
7726~somlus I got a fail for
7727
7728 ?~(space "x" i.space)
7729
7730 shit
7731
7732~rabsef did you set space
7733
7734~somlus didnt' do the space command first.
7735
7736~rabsef sorry I am going all over the place a little
7737
7738 perhaps too much coffee :)
7739
7740~somlus ' '
7741
7742~rabsef there's our proof
7743
7744 let's unset space {=space}
7745
7746~somlus no worries, it's fun. I like to need to keep but but be able to
7747 keep up (even if barely)
7748
7749 done
7750
7751~rabsef let's now return to the code
7752
7753~somlus ok
7754
7755~rabsef line 3 - ignore the first cell of now eny beak
7756
7757 the second cell at line 3 requests a value w/ a face of
7758 incomingstring
7759
7760 that value must be a tape
7761
7762 so we will be giving this generator a tape
7763
7764~somlus got it
7765
7766 (let's take a break for just a moment and talk about
7767 instruction)
7768
7769~rabsef we'll cover maybe later how a say generator works and what we
7770 do with those arguments, but for us now it is effectively |=
7771 incomingstring=tape
7772
7773~somlus This is critical
7774
7775~rabsef yes
7776
7777 hit me
7778
7779~somlus It's important to state at the very beginning in plain english
7780 "ok, so Hoon needs help at the start of every generator. since
7781 there are lots of ways of stating things, you must tell it
7782 exactly how you have inputted information."
7783
7784~rabsef Yes - there is talk of naive type interpretation that isn't
7785 helpful
7786
7787~somlus This is when we talk about how one thing "bead" or whatever, can
7788 mean multiple different things depending on the aura.
7789
7790~rabsef I see what you mean
7791
7792~somlus And the reason for this is the following:
7793
7794~rabsef Potential Outline for Course Structure
7795
7796 Programs we might be familiar w/ - input->output
7797
7798 Types of input and output in hoon - introduce main concepts of
7799 atom, cell, list, and types of atoms/cells/lists (@ud, @tD, @p,
7800 cord, tape)
7801
7802~somlus when someone looks at code, they should be first honing in on a
7803 few simple things. A beginner has no idea what to hone in on.
7804 But if we spoonfeed them and say "ok when you see code, the
7805 first few things you should do are...." and perhaps it is "look
7806 at the first generator" or "take a look at what sort of input is
7807 being requested" or something, then we can give them an actual
7808 process to begin instead of being lost.
7809
7810~rabsef that's very good - I will add that as a note to the notes
7811
7812~somlus So I think the lesson here is, it would be helpful to the
7813 students to provide some very early basic structure that they
7814 need to know for most programs of a given category, like "take
7815 user input and do something to it"
7816
7817 I meant look at the first rune not generator
7818
7819 yeah, input/output programs is a category. The course structure
7820 could go through like 2 different programs (easier and harder)
7821 for each "type" of program we decide is needed
7822
7823 ok LMK if if you have thoughts on that, if not we can continue
7824 now that we have defined the user input as a tape and given it a
7825 variable name
7826
7827~rabsef Yes - I think you're right. We can talk about input-> output
7828 then talk about types of input/output, then talk about the need
7829 to recognize type requirements at each level of a program (later
7830 you may have to recast things many times, or cast arm output for
7831 other arm use)
7832
7833 the most important starting type check is what input is
7834 requested
7835
7836~somlus and really emphasize it with annotations.
7837
7838 ok cool
7839
7840~rabsef So - taking that as granted for now, we should do that here.
7841 And perhaps we should just state outright the intention of this
7842 program
7843
7844 our INPUT will be a tape "tape" and our OUTPUT will equally be a
7845 tape "TaPe" where we want to play w/ the capitalization (insert
7846 sarcastic spongebob meme)
7847
7848~somlus good point^^ always state outright the intention of the program.
7849
7850 awesome.
7851
7852 AND
7853
7854 in the instruction materials, probably add a step whereby you
7855 question "ok how do we think about doing this?"
7856
7857 and the answer is "well, we have to go letter, by letter,
7858 obviously, so we have to create a generator that is able to
7859 slice off one letter at a time, and then alter every other one.
7860 for that, we need to be able to understand how Hoon thinks of a
7861 line of text and then based on that how we can chop it up and
7862 alter it, and then put it back together again"
7863
7864~rabsef Yes. That is where I intended to send our minds using abc and
7865 space
7866
7867 that's a good point - it should be said first then do those
7868 experiements to see the results
7869
7870~somlus "said first concretely" "thinking about how we will go about
7871 this" "execution with lots of annotations & questions, answers"
7872
7873 maybe. just thinking out loud
7874
7875 I love the experiments BTW.
7876
7877~rabsef So assume we talked through that and then did the abc and space
7878 experiments - we now have tools required to start down our road
7879 to our goal
7880
7881 at least in part
7882
7883~somlus because they both tell you what something is and what it isn't.
7884
7885 and that creates mental bookends of boundaries around something
7886 strange which adds predictability and also a sense of
7887 safety/less confusion.
7888
7889 yeah, this is great.
7890
7891~rabsef so maybe we shouldn't have unset abc and space yet
7892
7893 let's reset them {=abc "abc"} and (slightly modified {=space "
7894 def"}
7895
7896~somlus ok...
7897
7898 done
7899
7900~rabsef Let's learn some basic "standard library" (pre programmed
7901 short-hands for other programs) tools we can use on our values
7902 named abc and space
7903
7904 {(flop abc)}
7905
7906~somlus as expected cba
7907
7908~rabsef flop allows us to reverse the direction of a list - this is
7909 helpful in hoon because, given that lists are nested cells, it
7910 is easier to peel off the exterior layers
7911
7912 as we peel off an exterior layer, apply a modification to it,
7913 and then do something with it, we will likely create our output
7914 in inverse order
7915
7916 thus flop is important to set things back in the order we want
7917 after the fact
7918
7919 let us do another (weld abc space)
7920
7921 {(weld abc space)} rather
7922
7923~somlus abc def
7924
7925 are we able to do something like =weldedones (weld abc space)
7926 and define weldedones as that?
7927
7928~rabsef right ok - so as we get lists we want to combine, we can combine
7929 them using weld, and if we find we are building our output in
7930 the wrong direction, we can correct with flop later
7931
7932 we are
7933
7934 let's try it
7935
7936 and then {weldedones}
7937
7938 (also looking @ DM - happy to talk by phone after - tell me when
7939 to call it)
7940
7941~somlus yes
7942
7943 cool ok
7944
7945~rabsef (or in chat - w/e - just mean happy to do that)
7946
7947 yah ok - so let's unset those values now, I think, and return to
7948 the code at hand
7949
7950~somlus cool. let's get to whatever stopping point you see fit and then
7951 we can go to the chat channel
7952
7953~rabsef {=abc} {=space} {=weldedones}
7954
7955 it's important to clean up the dojo so you don't tack things as
7956 required into later programs
7957
7958~somlus done
7959
7960 cool
7961
7962~rabsef whatever is saved in the dojo when you create a program is
7963 implicitly part of that program (weird, right?!)
7964
7965 that is what people mean when they say that hoon is subject
7966 oriented
7967
7968~somlus interesting, thank you for explaining that
7969
7970~rabsef whatever is saved in dojo is implicitly part of the state, and
7971 therefore part of programs made thereafter
7972
7973~somlus makes sense.
7974
7975~rabsef ok - so we know that we should look @ input type when we analyze
7976 our programs - this program, on line 3, requests input of tape
7977
7978 we can look @ line 6, also, to confirm that our output will be a
7979 tape also
7980
7981 this coincides with our goal
7982
7983 we have one hanging bit of information in line 5 that indicates
7984 that we are doing something with a number
7985
7986 alternator is a number (@ud) that starts at 1
7987
7988 we should keep those in mind when we evaluate the rest of the
7989 program - as these are likely the only things that will be acted
7990 on by our program
7991
7992 not even likely, necessarily
7993
7994 We know by now what a trap is on line 7
7995
7996 so we know we will be doing something of recursion
7997
7998~somlus i'm following you fine
7999
8000~rabsef but what is different from our prior examples here is that,
8001 looking at lines 11 13 and 14 it appears there are multiple
8002 bucs?
8003
8004 how can this be?
8005
8006 Let's start walking through the trap
8007
8008 Line 8 - We first do something we did earlier with abc and
8009 space. We ask if our incomingstring tape is null
8010
8011 we know what we might be able to do with this. In this case, the
8012 TRUE value is to (flop) our output string
8013
8014 as stated in prior lessons, we should not build a program that
8015 has an infinite recursion, so we know that, at some point,
8016 incomingstring /will/ be null, to allow us to proceed to output
8017
8018 so - we should expect to find something that sends
8019 incomingstring to null-ness at some point - pin that thought
8020
8021~somlus ok
8022
8023~rabsef But, let's assume we don't pass a null string - so we'll ignore
8024 the line 9 outcome for the immediate present
8025
8026 Line 10 - what does line 10 ask the computer to do?
8027
8028~somlus branch on a logic test, and
8029
8030~rabsef think of passing our old value space as incomingstring
8031
8032 what is it checking
8033
8034~somlus see if the head of the tape is a space
8035
8036~rabsef yep - that's it
8037
8038 we know that ?: has 2 children
8039
8040 in the case of space, we would get a true value, right? So, we
8041 would then proceed to the first child
8042
8043 line 11
8044
8045~somlus if it is then begin another recursion
8046
8047~rabsef right
8048
8049~somlus oh no.
8050
8051~rabsef exactly
8052
8053 but what if we pass abc?
8054
8055 no that's right - if we passed "space" our old value, which
8056 began with a space, we would be sent to line 11
8057
8058~somlus ok...
8059
8060~rabsef but if we do not - if we pass our old value "abc" which does not
8061 begin with a space we would not reach line 11, instead we would
8062 be sent to 12
8063
8064 Here you might begin to see how we can have multiple bucs
8065
8066~somlus I do not understand passing abc... you mean use as user input?
8067
8068 or what is 'pass' here?
8069
8070~rabsef I only mean inputting either " def" or "abc" as our old values
8071 were called (space and abc respectively)
8072
8073 as the input to this program
8074
8075 so if the input to this program were " def" we would do what
8076 happens at line 11
8077
8078~somlus got it
8079
8080~rabsef if our input to this program were "abc" however, we would not
8081 hit line 11
8082
8083 and, as we were saying, if we don't hit line 11, we can see more
8084 clearly why we might be allowed to have multiple $s
8085
8086 so long as we only allow for one $ to happen, /different/ things
8087 can happen in each recursion, based on those conditions that
8088 make the various $ mutually exclusive
8089
8090 does that follow?
8091
8092~somlus ah you have to continue the recursion but under different
8093 circumstances, so each needs a buc
8094
8095~rabsef Yes - and lets think abck to the intent of this program
8096
8097 "abc" -> "AbC"
8098
8099 we are doing /different/ things to each letter in the tape
8100
8101 sometimes upper, sometimes lower casing it
8102
8103~somlus yes
8104
8105~rabsef How often do we change this? Once every /other/ letter (or
8106 technically, we switch behavior each letter in the row)
8107
8108 aha - perhaps we understand alternator now
8109
8110 alternator helps us decide which to do
8111
8112 let's look @ line 12
8113
8114~somlus ok
8115
8116~rabsef I'm not sure if we've discussed modular arithmatic yet
8117
8118 basically mod x y gives us the remainder of x/y
8119
8120~somlus did not discuss but I did read that.
8121
8122~rabsef So (mod 1 2) will (sort of bizarrely because it's not really a
8123 remainder, but just take it as granted unless you want to talk
8124 about modular arithmatic) 1
8125
8126 (mod 2 2) = 0
8127
8128 (mod 3 2) = 1
8129
8130 (mod 4 2) = 0
8131
8132 noticing a pattern, we have a clear method of alternating
8133 behaviors
8134
8135 0 1 0 1 0 1
8136
8137 what does line 12 do then
8138
8139~somlus interesting.
8140
8141 It just flops back and forth between 0 and 1
8142
8143 it's a toggle
8144
8145~rabsef so long as alternator is increasing
8146
8147~somlus on each recursion
8148
8149~rabsef yes
8150
8151 bingo bango
8152
8153 so let's look at what happens if mod alternator 2 is 1
8154
8155 that happens on line 13, as you have said
8156
8157 let's break this into 3 parts - each separated by commas
8158
8159 and first discuss the 1st and 3rd term
8160
8161 what does the 1st do?
8162
8163~somlus cool, this is toggle instruction to go to 13 then 14 alternately
8164 as long as it keeps going through that recursion space
8165
8166~rabsef yep - and if we want to jump slightly ahead, condition 10 and
8167 result 11 handle the exception to the rule, where the value at
8168 the head of incomingtape is a space
8169
8170~somlus hmm this is getting a bit complex, will take me a bit.
8171
8172~rabsef we can't really capitalize spaces or lower case them so we had
8173 to build in an exception
8174
8175~somlus makes senes
8176
8177 sense
8178
8179~rabsef So back to the thought -> the first term of 12 says "make
8180 incoming tape just the tale of tape as it exists coming into the
8181 rcursion"
8182
8183 recall our pinned thought - we must lead to a termination point
8184 or we will build an infinite loop
8185
8186 our termination point is when incoming string is null
8187
8188 a tape is a list of cords, a list is always terminated with a
8189 null value
8190
8191 combining those three things, we will always, eventually lead to
8192 a null list by pruning incoming tape to it's tail, no matter the
8193 length
8194
8195 does that make sense?
8196
8197~somlus overall yes, but I do not understand this line yet => the first
8198 term of 12 says "make incoming tape just the tale of tape as it
8199 exists coming into the rcursion"
8200
8201 12 is a logic test
8202
8203~rabsef $(<incomingstring t.incomingstring>,blah,blah)
8204
8205~somlus oh I have that as 13
8206
8207~rabsef that in <> is what i mean
8208
8209~somlus cool ok.
8210
8211~rabsef oh my bad dude
8212
8213 it's 13
8214
8215 I got confused
8216
8217~somlus groovy, I figured.
8218
8219~rabsef looking @ the third term of /13/ we see something else fairly
8220 easy to understand
8221
8222 we know that alternator needs to increase to give us, well,
8223 alternation
8224
8225 and here we increase alternator by 1
8226
8227~somlus ah so incoming and outgoing are changing throughout the
8228 generator, little by little and both are sort of approximating
8229 the endpoint with each recursion
8230
8231 yes that is cool and easy.
8232
8233~rabsef precisely. This leads us to flop, weld and cass as we learned
8234 them earlier
8235
8236~somlus and this is long format as compared to tall format. Would be
8237 interesting in education to show both formats.
8238
8239~rabsef to give away the magic trick, we are going to pluck a value from
8240 the top layer of our incoming list (tape), do something with it
8241 based on the value of alternator at that instant, and then stick
8242 it to our outgoing tape
8243
8244~somlus ok so here is another important point, which we sort of already
8245 stated, but not only should we state what we are going to do as
8246 part of an exercise, but what individual building blocks we will
8247 need.
8248
8249~rabsef in this way, we can slowly prune incomingstring and slowly build
8250 outgoingstring
8251
8252 you're right -we should do experiments and several of them with
8253 each standard library operation before hand
8254
8255 I assume too much
8256
8257~somlus So here, we need: recursion (including multiple endpoints that
8258 still trigger a recursion), an understanding of what a tape is
8259 and how to piece it apart character by character, something that
8260 alternates 0 to 1 over and over again
8261
8262 yeah, this is great though. let's switch over to dm ok?
8263
8264~rabsef we could build a simple naked gen that creates a list of
8265 alternator 0 1 0 1 and terms at a value of alternator proper (4
8266 cycles or whateveR)
8267
8268 yah let's do it
8269
8270 we can finish this next week or later
8271
8272~somlus agreed
8273
8274~risruc ~somlus, can you still read my DM?
8275
8276~somlus yes sir
8277
8278 I just answered it now. I'm surprised I missed that as I had
8279 been checking chat yesterday and today, feeling like I was the
8280 only one in this ghost town
8281
8282~risruc no worried! I had the same feeling yesterday, compounded by my
8283 DM, I was afraid I wasn't properly sending or receiving. all
8284 good!
8285
8286~rabsef Hey everyone - This week we're going to go through the SpOnGeBoB
8287 generator again as well as the Ackermann function available on
8288 the tutorials. It would be swell if new people want to join -
8289 I'm trying to improve my descriptive processes so happy to have
8290 you
8291
8292~somlus Time for the hoontards session is 9am Sunday PST
8293
8294 usually runs about 1.5 hours. It's technically 1 hour but
8295 usually it's rolling and fun and we don't stop until 1.5-2h
8296
8297 hey ~rabsef maybe post that in /party and /nopub
8298
8299~rabsef Yah for sure - do you happen to still have the pastebin link?
8300
8301 also do you think the Tlon people will get pissed at all about
8302 it?
8303
8304 I can regen the pastebin link - just trying to cut corners lol
8305
8306~somlus I'm sure I can find it - which was the pastebin link the
8307 spongebob one?
8308
8309~rabsef yes sir
8310
8311~somlus https://pastebin.com/vK1DTLAS
8312
8313~rabsef bingo bango
8314
8315 thank you
8316
8317~somlus I can't imagine they would be angry - they are super
8318 non-territorial. Oh you mean about posting in /nopub? Honestly I
8319 think they think this hoontards effort is sort of 'cute' and I
8320 do think they know that this level of learning has value, but is
8321 not the best place for their efforts at this time.
8322
8323~rabsef That seems like a fair read to me
8324
8325 I'm doin it - one sec while I write up an announcement
8326
8327~rovnys i think you could simplify that code a bit by just toggling a
8328 bit instead of incrementing and calling +mod each time
8329
8330 toggling a boolean flag, I mean
8331
8332~rabsef that's a good point - I am not comfortable w/ loobeans yet but I
8333 shoulda done that
8334
8335 I mean there's nothing difficult about loobeans I'm just not
8336 used to processing them as something to do
8337
8338 ~rovnys - I didn't ask my question very well in ~dalten but
8339 I have an example now. Suppose ~dalten is "Steam" and it's
8340 owners/managers are video game producers. Could ~dalten act as a
8341 distributor of the producer's product. Like REI started out as a
8342 coop to do just that
8343
8344 That's what I was trying to get at - assuming that the
8345 application qua game continued to 'live' on the underlying
8346 producer's machine could ~dalten provide a face for getting to
8347 that content
8348
8349 maybe that's just an inefficient use of two machines; I'll take
8350 that answer too - just thinking aloud here.
8351
8352~somlus are you able to get into the dalten coop? I can't get in
8353
8354~rabsef Yes - ~somlus, next time we have a meeting I'll make sure
8355 you're apprised through our DM. Sorry I didn't think about
8356 the difficulties you were xpressing in U-H re that and I was
8357 on a work call up until 10 min /into/ the meeting today,
8358 unfortunately, so I missed some of it as well
8359
8360 goddamned work getting in the way of my moonlighting
8361
8362~rovnys ~rabsef I'm not sure, maybe
8363
8364 technically, I don't see why not
8365
8366 but we don't have any drm support in urbit and that might be
8367 hard to do
8368
8369 not sure if that matters for your game distribution model
8370
8371~rabsef follow up: do you think that's a dumb idea because why wouldn't
8372 the star just take the service and run from there
8373
8374 eh - I hadn't thought that far into it, I was just trying to
8375 model the opposite of what you'd said in my brain a little re:
8376 ships running mirrors of dalten's events to ensure consensus /
8377 identify misbehavior
8378
8379~rovnys oh, well I do think a star could be a reasonable way to
8380 arbitrate disputes
8381
8382 and also as a sort of poor man's blockchain
8383
8384 if you want lower latency and less hassle, but you still want
8385 a neutral third-party node to store a sequence of hashes or
8386 something
8387
8388 you could use a star for that
8389
8390 that would be a way for a star to ensure consensus and help
8391 prevent misbehavior among other nodes
8392
8393 those nodes also wouldn't strictly need to be the star's
8394 sponsors, especially if you want someone really neutral, like a
8395 notary
8396
8397~rabsef As a mild aside, I tried to sell my law firm on blockchain
8398 stamping wills and estate documents but they didn't quite get it
8399 and also it's not technically self-certifying evidence in all
8400 states yet (blockchain records, that is). I would be super into
8401 urbit moving to try to fill that space some day.
8402
8403 as you say - like a notary
8404
8405~rovnys oh that's interesting
8406
8407~rabsef The two parts they failed to recognize is 1) it will be shortly
8408 self-certifying evidence in all states, and already is in some
8409 and 2) younger people would think it was dope and eventually
8410 young people who are rich are going to be our clients in that
8411 space (as they get older)
8412
8413~rovnys it could be an interesting service to provide as a law firm,
8414 even if it doesn't yet mean anything officially
8415
8416 yeah
8417
8418~rabsef I think NH and MA already have that on the books re: 1
8419
8420~rovnys i didn't know that
8421
8422 seems reasonable
8423
8424~rabsef http://blogs.asucollegeoflaw.com/lsi/files/2018/11/Gary-Marchant
8425 -Blockchain-Admissibility.pdf
8426
8427 it's vermont and some others - to correct myself
8428
8429 ^above covers some controversy over that finding but I don't
8430 think there's much avoiding it
8431
8432 The software I wanted to use was called AmiStamp
8433
8434 they also have a sick service - this one is real interesting
8435
8436 So when you do deals (M&A stuff), you have data rooms for due
8437 diligence
8438
8439 the problem is you want to be able to turn this off for bidders
8440 as they drop out right? But - obviously - they could just keep
8441 copies of the documents which gives them intelligence you don't
8442 want (obviously there's no real way around this w/ photographic
8443 memories etc, but better to not give them the chance)
8444
8445 The AmiShare product by AmiStamp allowed you to give a drop-box
8446 like experience to all users but every file was wrapped in
8447 a proprietary filetype that would only unlock based on the
8448 blockchain and you could build in time-outs on it so like "you
8449 can read my documents for 6 months and no more" or "I've decided
8450 you're out of the running so cut all access to that user
8451
8452 I think there's a kernel of awesome there
8453
8454~rovnys huh, that is interesting
8455
8456 I wonder if you could notarize encrypted documents using
8457 zero-knowledge proofs
8458
8459 sorry, vague thought
8460
8461~tocref Can't wait until my life simmers down sometime this weekend and
8462 I can finally submit the hoon 201 week 1 assignment lmao
8463
8464~rabsef Hoon 201 is running?! I thought it was suspended
8465
8466~tocref It's been a /while/, my friend
8467
8468~rabsef Gonna have to google 0 knowledge proof now :)
8469
8470 ah - well then I don't feel toooo bad but also consider me jelly
8471
8472~ronreg at the last sf urbit meetup harrison at tlon said that he was
8473 working on what sounded like some major redesigns to hoon
8474
8475 which sounded exciting, certainly, but also makes me a bit
8476 trepedatious about spending time on hoon right this second
8477
8478~rabsef eh - if you get it once you can get it again
8479
8480 I need to come up w/ a new project in hoon and start learning
8481 again. I'm sort of at a lull and the best way for me to learn is
8482 w/ an active goal
8483
8484 I think I need to learn JS too so I can make it landscape active
8485 - I'd like to do that at least
8486
8487~rovnys ~ronreg those changes won't land for a long time, I wouldn't
8488 worry about it
8489
8490 and if they make hoon harder to use, we won't accept them :)
8491
8492~somlus Am going to update the binary for ~somlus-savlev and ~nibfeb
8493 now, will be offline just a bit
8494
8495 I am back, successful
8496
8497 I was thinking the same thing ~ronreg after learning there was
8498 'a lot to be fixed' in hoon. discourages me from putting too
8499 much into building something big at this time. However, I still
8500 have lots to learn so maybe that's fine
8501
8502~navpun Interesting, is there any overview of what needs major changing?
8503 wouldn't a major hoon overhaul involve changing some more basic
8504 stuff?
8505
8506~somlus it was a very casual conversation. I took it to be a bit of a
8507 "curtis is gone and he left hoon with some stuff I have to fix"
8508 conversation. I'm not sure it was the same person referenced
8509 above so I don't want to incriminate anyone. we did not get into
8510 any details at all.
8511
8512~rabsef as long as they keep hoon weird I'm ok w/ having to relearn.
8513 Relearning gives you an opportunity to re-consider the things
8514 you learned the first time and how you understand them
8515
8516 Also ~rovnys was suggesting that maybe learning Nock would be
8517 helpful to understanding more advanced pieces of hoon, and if
8518 Nock isn't changing, then maybe that would be a good place to
8519 spend time
8520
8521 if hoon expressions change, they still can only mean pieces of
8522 Nock
8523
8524~somlus Good point ~rabsef
8525
8526~risruc ~rabsef, did you see a while bag, ~taglux-nidsep shared his
8527 hand-written notes from writing some non-trivial program in raw
8528 nock?
8529
8530 https://twitter.com/JRstract/status/1202800817767698432
8531
8532~rabsef I did not see that - I need to take a look - do you happen to
8533 have that content?
8534
8535 nice man
8536
8537 thank you
8538
8539~risruc the next message says he had several dozen pages like that
8540
8541 seems like ~somlus is a bit slow this morning
8542
8543 unless it's me.
8544
8545~rabsef test
8546
8547 no change in brave
8548
8549 how very odd
8550
8551 And I /just/ installed brave
8552
8553~somlus yeah i am hanging again with messages not going out, browser not
8554 refreshing.
8555
8556 Do you all have any idea when the next network breach will be?
8557 if 1 month or so I will just breach this weekend and see if that
8558 fixes it all. If soon, I'll wait for that.
8559
8560~risruc yeah, interesting ~rabsef.
8561
8562 i wonder how that's possible.
8563
8564 i wonder how that's possible.
8565
8566~rabsef ~somlus, given that they just rolled out 10.2 I would imagine
8567 some time. It would be surprising to me if they had a breaching
8568 update immediately following a non-breacher. I would assume they
8569 got a lot of their recent work packaged in those two OTA and
8570 10.2 updates.
8571
8572~somlus yeah good point
8573
8574 how much would it adversely affect y'all if we lost the
8575 hoontards chat history? ~rabsef I actually copied most of our
8576 sessions, FYI. I might breach and I'm not aware of chat history
8577 saving measures...
8578
8579~risruc i think that we might keep our chat histories if you give the
8580 channels the same names
8581
8582 but not positive about htat
8583
8584~somlus notebooks are in home/web (on a mounted folder) as publish and
8585 its subfolders (notebooks)
8586
8587 but I can't find anything that looks obviously like the chat
8588 folders to load up and commit
8589
8590~risruc test
8591
8592~rabsef Going way out on a limb, I suspect chats are in the event log
8593 and therefore do not have object permanence in their own file
8594
8595~somlus could be, though I would be surprised they were entangled. No
8596 wonder there are long load times if that is true...
8597
8598 aha it's on chat-store!
8599
8600~rabsef dotpoast
8601
8602 second dotpost
8603
8604 o wow that worked
8605
8606 I would not have expected that to work
8607
8608 ~risruc is a genius
8609
8610~risruc I had a hacked index.js for mobile use before the official
8611 mobile version came out
8612
8613 that's how I knew where to go :)
8614
8615~rabsef lol amazing
8616
8617~somlus risruc does dazzle quite often.
8618
8619~risruc i try to keep a good balance of dazzle and fizzle.
8620
8621~tocref If anyone has JS questions feel free to DM me on here; I
8622 have experience with javascript as well as react.js (which
8623 urbit's web interface uses, and involves learning concepts and
8624 conventions that regular JS doesn't think about much)
8625
8626~rabsef So - question - should I want to build a tile for urbit
8627 landscape I should learn the react framework?
8628
8629~tocref Yes –– though apparently they built tools to help
8630 https://urbit.org/docs/tutorials/hoon/landscape-tile/
8631
8632~somlus interesting. thanks tocref! you are certainly welcome any time
8633
8634~tocref React also requires a good bit HTML/CSS knowledge to use, but
8635 you can learn all the useful HTML in a couple hours and CSS is
8636 something you never truly "learn"
8637
8638~risruc yes, appareciated!
8639
8640~tocref Though Javascript and React are easier to work through when
8641 something goes wrong because the userbase is large enough that
8642 if you have a problem someone else has already come across and
8643 solved it most likely
8644
8645~rabsef nice. and thank you, like the others said. I need to get to that
8646 tutorial. I'm going to complete the numbered ones in the next 2
8647 weeks and get started on the advanced stuff
8648
8649 I have reinvigorated my desire
8650
8651~tocref I also believe that urbit uses a modified version of tachyons
8652 for it's CSS framework
8653
8654 https://tachyons.io/
8655
8656 I actually fixed a couple UI issues in the interface and it made
8657 me really like tachyons
8658
8659~risruc that's great ~tocref
8660
8661 what's your level of hoon expertise?
8662
8663~tocref I finished 101, though I had a pretty ugly submission for the
8664 final assignment (it worked though)
8665
8666 Hoon is pretty cryptic to me but I've wrapped my brain around
8667 most of the basic concepts
8668
8669~somlus very cool. what drew you to hoontards other that good
8670 samaritanship?
8671
8672~tocref I went through the list of landscape cities and joined a few of
8673 them
8674
8675~rabsef ~tocref we should compare finals - mine was p ugly too :)
8676
8677~tocref Also not really sure I'd consider it "good samaritanship" though
8678 I'm like, barely above the level most people here seem to be
8679
8680~somlus I'm hoping to do hoon 101 for real this time. l
8681
8682 I am hoping to do hoon 101 for real this time. I'm a non coder
8683 so I fell off last time out of confusion but risruc has rehabbed
8684 me significantly
8685
8686~risruc it's the part you were born to play!
8687
8688~tocref I feel like being a coder might make you bad at hoon but in a
8689 different way than being a non-coder
8690
8691~somlus I have heard that a few times.
8692
8693~tocref https://pastebin.com/XzsjT24N
8694
8695 This was my final assignment for 101; There's two versions, one
8696 doesn't work
8697
8698~rabsef https://pastebin.com/TL47Uunv
8699
8700~tocref One like barely works and ocassionally takes like 10 full
8701 minutes to arrive at a result lmao
8702
8703 Yours is way better than mine; I think they didn't introduce
8704 typing at that point in 101 when I did it
8705
8706 Custom types I mean
8707
8708~rabsef o u did something very interesting w/ the cards tho
8709
8710~somlus I sometimes worry about Urbit's computing power. our level of
8711 programs should not be doing that
8712
8713~rabsef Also I had help learning how to do custom types so
8714
8715 doing wat ~somlus?
8716
8717~tocref They all had us just make lists but the emoji + number was a
8718 really elegant solution that someone else in my cohort did
8719 successfully ~rabsef
8720
8721~somlus I'm bowing out haven't done it yet. also turning in soon so
8722 cheers folks. big surgery day tomorrow
8723
8724~tocref If you guys haven't done the ackermann function yet, please do
8725 not run it with numbers larger than 2
8726
8727 It's designed to be computationally absurd and it will take
8728 literal hours/days/weeks with large numbers
8729
8730~rabsef oh yah I didn't think about it but emoji I guess are UTF8?
8731
8732~tocref The ones I used are technically pre-emoji UTF8 characters; but
8733 yes emoji are UTF8
8734
8735 The real crazy use of utf8 is in swift; which has full utf-8
8736 support –– so you can actually use emoji for function names
8737 (which you shouldn't actually do)
8738
8739 Though being able to set 3.1458 to π instead of the word pi is
8740 kinda cool
8741
8742 I wanna get myself to the level where I can make things in
8743 landscape that interact with a hoon backend; because from
8744 reading the docs it seems to be a deeper integration than just
8745 async data calls
8746
8747~rabsef like what would that look like?
8748
8749 like a for instance of what you want to do
8750
8751~risruc ~ponmep-litsem had built a hoon web editor, in the pre-landscape
8752 days.
8753
8754 "plato"
8755
8756 but he used elm, rather than react.
8757
8758 that was so long ago, i'm guessing his elm-bindings don't work
8759 anymore
8760
8761 but it was pretty impressive work.
8762
8763~rabsef it's humbling to know so little :)
8764
8765~risruc last time i'd checked this image worked... but doesn't seem to
8766 now.
8767
8768 https://twitter.com/urbit/status/977619558117752834
8769
8770 any way, it's still on his github:
8771
8772 https://github.com/mikolajpp/plato
8773
8774 https://github.com/mikolajpp/plato/blob/master/elm/plato-peek.gi
8775 f?raw=true
8776
8777 there it is ^
8778
8779 https://i.imgur.com/lzNnJJL.mp4
8780
8781~hatdyl Urbit isn't exactly fast but it's not ludicrously slow. I
8782 wrote a procedural planet shader in shadertoy and then ported
8783 it to Hoon and it's slow but not completely impractical.
8784 https://gist.github.com/mattnewport/f3eaa71c3f71cafe83da541cf3c0
8785 52ae
8786
8787~rovnys whoa, nice!
8788
8789~hatdyl We're talking 1000s of times slower than a GPU which is 'only'
8790 like the difference between a 90s PC and a modern GPU
8791
8792~rovnys I hadn't seen this before
8793
8794~risruc that is awesome ~hatdyl
8795
8796~hatdyl You could still do a lot with a 90s PC
8797
8798~risruc can you quantify that at all?
8799
8800~rabsef that's amazing ~hatdyl
8801
8802~rovnys that's some pretty good-looking hoon, ~hadtyl
8803
8804~somlus Is there hope that Hoon will every be computationally fast, or
8805 is that something we just give up and focus on "slow computing,
8806 but communities can be created"? Seems like a very core issue
8807 there to set long term expectations. BTW very cool planet and
8808 love the comment by Phillip and your reply on GH
8809
8810~rapfyr hoon can be much faster than it is currently
8811
8812 it's just not something that is being actively focused on.
8813
8814 i mean other than jaque
8815
8816~somlus got it, that is good to hear at least!
8817
8818~rapfyr the previous version of jaque, iirc, was much faster than vere
8819 without any actual optimization work
8820
8821~rovnys we'll probably never be full-speed on the processor, but if
8822 someone dumped the same amount of money into making hoon fast
8823 that people have dumped into making javascript fast, hoon will
8824 probably be quite a bit faster than javascript
8825
8826 and javascript is actually not that slow for most things
8827
8828~rapfyr i mean maybe if someone makes a nock chip
8829
8830 zoom zoom.
8831
8832~rovnys that is a possibility
8833
8834~risruc i know a guy.
8835
8836~somlus what a newsworthy item that would be...
8837
8838 you do?
8839
8840~rapfyr hey... hey you... you wanna... buy a nock chip?
8841
8842~somlus oh, a joke. I know nothing about chip making
8843
8844~risruc we're all just waiting for the loop to run enough times that the
8845 2025 time traveler has a nock chip to bring back to 1990 curtis.
8846
8847 you weren't my guy, ~somlus.
8848
8849 you're not my only guy you know ;)
8850
8851~somlus I'm the bull in a china shop of chip making. First of all, I
8852 begin with Doritos
8853
8854~rapfyr mmmmm nock flavored Doritos. my favorite.
8855
8856~risruc how would you describe the flavor?
8857
8858 [[[2 [3 [1 2]]...
8859
8860~somlus it's actually a Doritos nock off. flavor has yet to fully
8861 develop
8862
8863~rapfyr ...
8864
8865 i'm dead
8866
8867~hatdyl Because hoon is pure and side effects are pretty well defined
8868 I'm somewhat optimistic that purely computational stuff
8869 should be able to be sped up pretty dramatically. I don't see
8870 any reason in theory why it wouldn't be possible to offload
8871 something like this to the GPU for all the heavy lifting since
8872 it's side effect free until you write the output somewhere. I'm
8873 not an expert on this stuff though.
8874
8875~tocref ~rabsef a data call is "asking another source for data" and
8876 asynchronous (async) means "do this on a seperate thread"
8877
8878 in this context it means a frontend interface querying a
8879 backend via the internet –– think like a social media website
8880 periodically contacting the server for new notifications
8881
8882~ronreg that procedural planet generator is super nifty
8883
8884~somlus Getting ready for hoontards session to begin at 9am (35mins)
8885
8886~tomdet somlus here, speaking as moon
8887
8888~rabsef Hey ~somlus
8889
8890 Updated SpongeBob to be by loobean instead of mod alternator ->
8891 https://pastebin.com/1TsUpnih
8892
8893 https://pastebin.com/1TsUpnih
8894
8895 Ackermann Function:
8896
8897 https://urbit.org/docs/tutorials/hoon/ackermann/
8898
8899 Anyone else joining us today?
8900
8901~tomdet ready rabsef, sir, when you are
8902
8903~rabsef Let's hit it
8904
8905 So - last time we were working through the SpongeBob script
8906 above - and I think we got most of the way through
8907
8908 I've made a small change to use loobeans instead of an
8909 incremental counter w/ mod operations
8910
8911 you'll see that on lines 5 and 12-14
8912
8913~tomdet interesting, ok. (also fyi because of other projects I come
8914 quite unread with regards to today, so we are winging it a bit
8915 on my end, apologies)
8916
8917 ok focusing on thos lines
8918
8919~rabsef Don't worry about it. So basically the biggest change is just
8920 that it's very easy to read an @f (loobean) as either & (true)
8921 or | (false) and, consequently, make it go the other direction
8922
8923 (false or true, respectively)
8924
8925~tomdet one moment, comparing to the old one now
8926
8927 what does & do? change the alternator?
8928
8929 oh no,
8930
8931~rabsef & is a potential value for the alternator, as | is (false)
8932
8933~tomdet it's true obviously and you're comparing alternator to & in 12
8934
8935~rabsef yep
8936
8937 line 12 we arbitrarily test for & (true) - it would do equally
8938 well to test for false and reverse the ordination of lines 13
8939 and 14
8940
8941 Does that make sense?
8942
8943~tomdet ah, then you just reset alternator to the other one right after
8944 you do the work in 13 or 14
8945
8946 easy, peasy.
8947
8948~rabsef Yes - so it seems like this whole generator is pretty much
8949 within your grasp now, yah?
8950
8951~tomdet you set alternator as & and | yourself? or do they have inherent
8952 (immutable) meaning?
8953
8954~rabsef They are immutable meanings and are just the way that Hoon does
8955 boolean values
8956
8957~tomdet curious as to why you did not choose 0 and 1 or y and n?
8958
8959 oh got it. So you can set a variable to be "true" or "false"
8960 this way. nice!
8961
8962~rabsef that's right - and it just uses that notation 'because'
8963
8964 or at least I don't have a better reason as to why
8965
8966~tomdet cool
8967
8968 great. this is easier.
8969
8970~rabsef lil bit - yes. Thanks to whomever suggested that - I forget who
8971
8972~tomdet ok great
8973
8974~rabsef The big beat takeaway here is we have three different cases of
8975 buc where the resolution of the gate changes slightly based on
8976 conditions, right?
8977
8978~tomdet yes, this is a very valuable learning tool.
8979
8980~rabsef or, more simply, we can do different recursion strategies based
8981 on different conditions on each recursion
8982
8983 let's then turn to the
8984
8985 Ackermann function ^
8986
8987 https://urbit.org/docs/tutorials/hoon/ackermann/
8988
8989 four short lines but I would say somewhat more complex than what
8990 I did
8991
8992~tomdet When describing this exercise, that should be stated in the
8993 'brainstorming' section. We will need to do something over and
8994 over (recursion), flip flop (recursion) and build something
8995 slowly as we tear something apart slowly (recursion)
8996
8997 ok on to ackerman
8998
8999~rabsef yes - that makes sense ^ noted
9000
9001 ok - first let's read the bottom two paragraphs
9002
9003~tomdet ok regarding ackerman, started doing this but did not get grasp
9004 the 'not primarily recursive' part FYI
9005
9006 ok reading the bottom part
9007
9008~rabsef Primatively Recursive is sort of helpfully defined by Wikipedia
9009 though it's not entirely necessary to grasp the definition to
9010 understand what's going on in the hoon there
9011
9012~tomdet I cannot tell why this function would be useful
9013
9014~rabsef In computability theory, a primitive recursive function is
9015 roughly speaking a function that can be computed by a computer
9016 program whose loops are all "for" loops (that is, an upper bound
9017 of the number of iterations of every loop can be determined
9018 before entering the loop).
9019
9020~tomdet ah interesting.
9021
9022~rabsef It's not useful to us, it's just an example of complex recursion
9023 for us
9024
9025 so like my 'function' for spongebob (I think this is right) is
9026 primatively recursive because you know exactly how many loops
9027 based on length of tape incoming
9028
9029~tomdet ok got it. I have entered that generator into my ship, committed
9030
9031~rabsef ok - so let's look through the lines like usual
9032
9033 and recall to our rules - line 1 - takes 2 arguments in a cell,
9034 both of which are @s
9035
9036 ln 2 - a ?: operator which takes a test and two outcomes
9037
9038~tomdet indeed
9039
9040~rabsef Our first test - well that mirrors the first line of the
9041 penultimate paragraph
9042
9043~tomdet easy, yes
9044
9045~rabsef "If m is 0, return the increment of +n, else..."
9046
9047 What's interesting here is that +n is going to be our output.
9048 How can I tell this?
9049
9050 that is to say, this function will always end by outputting +(n)
9051
9052~tomdet ah because there is no $ here
9053
9054~rabsef and further because all other possible conditions are $ lines
9055
9056 =IF(m=0, output, IF(condition, $, $))
9057
9058~tomdet in terms of understanding this function, is m the number of
9059 overall recursions we will put n through (it counts down to zero
9060 and then the generator stops)?
9061
9062~rabsef not exactly - there's a very good reason why not, too. We'll get
9063 to that
9064
9065~tomdet ok
9066
9067~rabsef So - first, if n = 0 we do what? recur with m-1 as m and 1 as n
9068
9069~tomdet yes
9070
9071~rabsef What's happening in the next line tho - line 4. Talk me through
9072 the things it's asking us to do
9073
9074~tomdet ok.
9075
9076 this is the case where neither m nor n equals zero
9077
9078~rabsef that's true
9079
9080~tomdet in this case first of all we have announced we will recur after
9081 doing the instructions. then we subtract one from m and make
9082 that the new value of m. and then somehow we are setting up a
9083 new recursion loop for n, but I can't see where the beginning of
9084 that loop is
9085
9086~rabsef that's why m is not a counter of recursions
9087
9088 that right there is the special part of ackermann
9089
9090 let's focus on the n condition in line 4
9091
9092~tomdet ok
9093
9094 i'm with you.
9095
9096~rabsef n will become the value of what? $ always points to |- above,
9097 so n will become the value of the ackermann function run with
9098 m=current n and n=current n - 1
9099
9100 there is a mini-loop that will then play out the whole four
9101 lines again to determine the maxi-loop n value for recursion of
9102 the four lines
9103
9104~tomdet oh wow. this is a little bit of turtles on the backs of other
9105 turtles.
9106
9107~rabsef Eh - since |- doesn't exist it just points to the gate, but
9108 that's not that strange
9109
9110~tomdet but not infinitely
9111
9112~rabsef yes - it's turtles all the way down
9113
9114 but it does take a lot of computer power to do this - if you put
9115 in relatively mild values of m and n, you're going to get back a
9116 relatively large number and it will take a while to work itself
9117 out
9118
9119 I suggest you don't do it - but you can work this out on paper
9120 too - let's try with 1 1 on paper?
9121
9122~tomdet ok
9123
9124 I think I need to do that in order to understand this.
9125
9126~rabsef It's going to take a bit of work to even write
9127
9128~tomdet we get immediately to line 4
9129
9130~rabsef yep
9131
9132~tomdet m becomes zero
9133
9134~rabsef so for our maxi recursion m is 0 for next loop (we know this
9135 means we will output soon!)
9136
9137 but n is problematic - so somehow indicate a sidebar of a mini
9138 loop
9139
9140 and what do we start the miniloop w/
9141
9142~tomdet n is initially 1 and it is going to become the value of the
9143 ackermann solution (with m being zero now)
9144
9145 or perhaps M doesn't change value until this mini loop is
9146 complete?
9147
9148~rabsef not quite. For the mini loop we will start w/ m=n which is
9149 currently 1, and n = 0
9150
9151 do you see why?
9152
9153~risruc enjoying the walkthrough. great stuff. fyi, following along on
9154 and off. ??
9155
9156~tomdet because of dec n
9157
9158~rabsef actually - risruc - am I right about that?
9159
9160 I think it's calling n and (dec n) as m and n in the recursion
9161
9162 second half line 4
9163
9164 but now that I think about it it might be just saying keep m the
9165 same and recur w/ n as dec n
9166
9167 which in our case is the same thing but it's sort of important
9168 that we think of it right
9169
9170 It must be that second case
9171
9172 so you're right somlus - m does not change, it retains it's
9173 value from the prior maxi-loop and then recurs with n = dec n
9174
9175~tomdet I think it is keep m the same because buc is outside the
9176 parentheses
9177
9178~rabsef otherwise it would need to be written n $(m n, n (dec n))
9179
9180~tomdet this mini recursion happens in the environment before the $ line
9181 is complete
9182
9183 yes
9184
9185~risruc correct. in the final $, m doesn't change.
9186
9187~rabsef yah - my bad - I was thinking of it wrong. either way, we can
9188 proceed w/ our mini recursion starting at the gate with m=1 n=0
9189
9190 which takes us where
9191
9192~risruc in the penultimate $, m becomes m-1 and n becoms the result of
9193 the given recursion with n=n-1
9194
9195~tomdet so you have to "end the generator" in a mini sense by getting M
9196 to zero before you can complete line 4
9197
9198~risruc part of the problem of the ackerman function as an illustration,
9199 in my opinion is that it's an abstract and silly function. not
9200 one that most people have a map of in natural language.
9201
9202~tomdet true my head is spinning a bit
9203
9204~risruc compared with factorial / fibonacci which are easy to describe.
9205
9206~rabsef yep - and in that mini recursion w/ m=1, n=0, we go to line 3
9207
9208~tomdet yes, I see that
9209
9210~rabsef n does = 0, so we should mini recur with m=0, n=1
9211
9212 which, 2nd (?) pass of the mini loop (I'm not actually writing
9213 it sorry) takes us to line 2
9214
9215 and we know line 2 is an output line, thank god which means soon
9216 we will return to our maxi-loop
9217
9218 thus, for our maxi loop, what is the value of n now?
9219
9220~tomdet and so that n is finally n+1 which is 2 which is the result for
9221 that part, which means n is now 2
9222
9223 for the maxi loop to begin again with m =0 and n=2
9224
9225~rabsef and so
9226
9227 ?
9228
9229~tomdet it goes to line 2, which is true which produces the +(1) as 2 as
9230 the final output
9231
9232~rabsef not quite
9233
9234~tomdet dang
9235
9236~rabsef for our maxi loop m=0, n=2
9237
9238 what is our output on line 2 then
9239
9240~tomdet 3 but let me think on why n=2 for the maxi loop
9241
9242~rabsef let's return to our miniloop
9243
9244 on the second pass what did we get as output?
9245
9246~risruc ~somlus, have you looked at this, from wikipedia?
9247
9248~tomdet oh yeah, we went into that loop with n=1 and so +(1) is too
9249 there
9250
9251~risruc https://wikimedia.org/api/rest_v1/media/math/render/svg/1a15ea2f
9252 cf1977e497bccdf1916ae23edc412fff
9253
9254 oops, that image won't embed.
9255
9256~tomdet yes, risruc, but only briefly unfortunately. I sadly bogged
9257 myself down with other stuff and didn't really come prepared as
9258 I would have liked
9259
9260 I have it open now though
9261
9262~rabsef that's fine - you got to where we needed to be
9263
9264 So - I would say try your gen w/ 1 1 and see if we get what we
9265 thought
9266
9267 you could probably rewrite this generator to create a list of
9268 cells of [@ @] that showed you each pass output to coincide w/
9269 your maxi and miniloop recursion values
9270
9271 which might be sort of interesting
9272
9273~tomdet yeah actually it would
9274
9275~rabsef you could even do it w/ a cord or term of %mini and %maxi [%mini
9276 1 0] [%maxi 0 2] and so on
9277
9278~tomdet ah got it! had a problematic input format. it needs to match the
9279 line where the variables are defined.
9280
9281~rabsef yes - ah and that's always true
9282
9283 right? we have to give the system what it expects or we get a
9284 nest fail I think or a want has if a say generator
9285
9286~tomdet cool it is working for now. got 29 for [3 2]
9287
9288~rabsef want have* for say generator error
9289
9290 yah nice - and we could work that out on paper but absolutely f
9291 that
9292
9293 lol
9294
9295 go too much bigger and it will bog your urbit down for a while
9296
9297~tomdet haha!
9298
9299~rabsef I tried something fairly big when I first wrote this and
9300 realized that the 'hard way'
9301
9302~tomdet it did. had to interrupt [4 1]
9303
9304~rabsef yah lol
9305
9306 the poor computer has to go nest nest nest nest nest nest just
9307 like we do
9308
9309 until it gets a value
9310
9311~tomdet incidentally I am running planetppm at 1.024 and will see how
9312 that goes. it's at line 179 now
9313
9314 cool, ok.
9315
9316~rabsef is planetppm the planet shader?
9317
9318~tomdet yes
9319
9320~rabsef or ?
9321
9322~tomdet I think I got this. I want to spend some time doing more
9323 handwritten versions and also go back to spongebob sarcastic
9324 text and make sure I get both versions.
9325
9326~rabsef nice - do you want to do anything more today?
9327
9328 we could look @ the caesar cipher
9329
9330 that is going to take at least one week
9331
9332~tomdet sure!
9333
9334~rabsef https://urbit.org/docs/tutorials/hoon/caesar/
9335
9336 let's just try to read through the code at the top
9337
9338 new notation for us =<
9339
9340~tomdet my browser froze, stand by
9341
9342~risruc if we'll split it over weeks, might be useful for today to try
9343 and understand it at a higher level.
9344
9345~rabsef 2
9346
9347~rabsef =<(b [a=1 b=2 c=3])
9348
9349~risruc break it up into black boxes
9350
9351~rabsef Yes - I just want to get through lines 1-7 today
9352
9353~risruc good call
9354
9355~rabsef I guess we could include 9 lol 9's pretty easy to understand
9356
9357~tomdet ok i have it now, beginning
9358
9359~rabsef :)
9360
9361 I guess we should begin at the beginning really
9362
9363~tomdet good point since !: is actually new to me right now
9364
9365~rabsef !: zapcol gives us a "stack trace"
9366
9367 The product of p unless p crashes, in which case a stack trace
9368 is given.
9369
9370 ^per the documentation
9371
9372~tomdet got it
9373
9374~rabsef basically "Do everything after me else give me a list of the
9375 lines you went to and where you failed"
9376
9377 that's extremely helpful when ur debugging, incidentally
9378
9379~tomdet so you could do that with every single generator
9380
9381 got it
9382
9383~rabsef yah for sure
9384
9385~tomdet so the we have |= where we state that our final output which we
9386 call "msg" is a tape and is cast as @ud
9387
9388~rabsef ok so line 2 we're familiar w/
9389
9390 yep
9391
9392~tomdet =<
9393
9394~rabsef what would our input look like - arbitrary input value
9395
9396 ["like this perhaps" 2] right?
9397
9398 yes - now =< does something new as well
9399
9400 2
9401
9402 =<(b [a=1 b=2 c=3])
9403
9404 that's an example of what it does that is new
9405
9406 can you intuit from that what it does?
9407
9408 or deduce I suppose would be a better word
9409
9410~tomdet produce the value from a database
9411
9412~rabsef sooort of. =<(p q) evaluates p in light of q
9413
9414 where normally in hoon we would have to do q first
9415
9416 so if you went into dojo right now and hit b
9417
9418 it would be find.b error
9419
9420 if you =b 2 then b it would give you 2
9421
9422 =<(b [b=2]) will give you 2 in one line
9423
9424 =< evaluates the first statement in light of the remaining
9425 information
9426
9427~tomdet ok
9428
9429~rabsef the /rationale/ for doing this is that you can have your main
9430 (output focused) work at the TOP of your program and have your
9431 other work at the bottom (everything that begins with ++ below)
9432
9433 like a christmas tree w/ the star on top where the star is the
9434 important part, your branches can exist below it. Arguably your
9435 branches should be bigger than the star, and it's nice to look @
9436 w/ them at the bottom
9437
9438~tomdet I understand the concept but not how =< achieves that (yet)
9439
9440~rabsef does that track fairly well?
9441
9442~tomdet oh
9443
9444~rabsef that's just what =< does. Our lines 4-6 will be evaluated based
9445 on 7+
9446
9447~tomdet what I need to grasp is where the endpoint of =< is. in your
9448 example you had an open and closed parenthesis
9449
9450~rabsef Ok - great question, and I /think/ the answer is "after there is
9451 definitive output"
9452
9453~tomdet oh
9454
9455~rabsef ~risruc - weigh in if I'm wrong there
9456
9457 let's try to find that point
9458
9459 =. does something new too, to move to the next line
9460
9461~tomdet ok i'll get back to =<
9462
9463~rabsef =. 'mutates' the subject in some way and the rest of the
9464 function is evaluated in light of that mutated subject
9465
9466 our subject in this case is the sample (and context but it isn't
9467 used)
9468
9469 the sample is our input
9470
9471~risruc that is correct, essentially.
9472
9473~rabsef =. is doing something like $ here w/o recursion, but instead
9474 continuing to flow forward
9475
9476~risruc although of course we don't need to see the output.
9477
9478 think about the fact that each function (rune) takes a fixed
9479 number of children
9480
9481~rabsef so what does =. look like it's doing
9482
9483~risruc without evaluating anything, if we know that, we can see where
9484 the next hoon ends.
9485
9486~rabsef that's a good point - so at termination of computing is where =<
9487 ends
9488
9489~tomdet where would i find out what 'cass' refers to. is that standard
9490 library?
9491
9492~risruc hoon meaning the rune after =< and its children
9493
9494~rabsef yes sorry and let's give you a freebie there - cass is all lower
9495 case
9496
9497 cuss is upper case
9498
9499~tomdet ah got it.
9500
9501~rabsef we used those in the SpongeBob - I should have mentioned that
9502
9503~tomdet understood
9504
9505~rabsef that's how we were getting the letters to flip case regardless
9506 of their input style
9507
9508~tomdet got it I see that now
9509
9510~rabsef ok so we take in a ["sample" 2]
9511
9512~tomdet ["ucorng" "qyknjc"]
9513
9514~rabsef and cass the "SAMPLE" into "sample" at line 4 using =. which
9515 'mutates the subject' for further computation. Technically, I
9516 suppose, the subject of msg="SAMPLE" still exists somewhere but
9517 it is not used hereafter
9518
9519~tomdet got it.
9520
9521~rabsef ok - and you already got output so that pretty much tells us
9522 what 5 and 6 do
9523
9524~tomdet that's an easy way to convert to all lower case
9525
9526~rabsef without worrying to omuch about what's in the ()() what is :-
9527 doing
9528
9529 lmk if you want help but we've seen this rune before
9530
9531 I think
9532
9533~tomdet yes we have
9534
9535~rabsef think of it w/o evaluating that in parentheses next to/below it
9536
9537~tomdet construct a cell, and in this case two things will be there
9538
9539~rabsef what is :- doing then
9540
9541 yes - and those two things are going to be that in parentheses
9542
9543~tomdet which we will define later, but will include a shift and unshift
9544 version of message key
9545
9546~rabsef so [(shift msg key) (unshift msg key)]
9547
9548~tomdet indeed
9549
9550~rabsef yes exactly. and here we see why =< is used
9551
9552 there are arms called shift and unshift just below this - in a
9553 core. msg and key are sample inputs
9554
9555 so the output of =< will be the cell of "operate shift on
9556 sample" and "operate unshift on sample"
9557
9558~tomdet ah
9559
9560 yes
9561
9562~rabsef look at the gate for shift - line uhh 10?
9563
9564 what does it ask for
9565
9566~tomdet an input which is assigned to message
9567
9568~rabsef and a key right?
9569
9570 it asks for a tape and an @ud
9571
9572~tomdet indeed just like msg
9573
9574~rabsef the notation (function arg arg2) passes the args to the function
9575
9576 (shift msg key) passes (cass msg) and key from our initial input
9577 to shift
9578
9579~tomdet ok
9580
9581~rabsef does that make sense?
9582
9583~tomdet just a moment, i think so
9584
9585 when you say 'passes' here I think we need to be more specific.
9586
9587 becomes? is equal to? does something to?
9588
9589~rabsef gates require input |= [msg=tape key=@ud] on line 2 requires a
9590 cell of [tape @ud] as input
9591
9592 when I say passes I mean calls the gate w/ the following
9593 arguments
9594
9595 just as we would call +caesar [tape @ud]
9596
9597~tomdet ok got it
9598
9599~rabsef shift is a gate, see line 11
9600
9601 we are +shift [tape @ud]
9602
9603 only (shift tape @ud) serves the same purpose here
9604
9605~tomdet got it
9606
9607~rabsef and we can only call shift up here before it exists because =<
9608 says evaluate me in light of "q" which is the core at the bottom
9609 (lines 7+)
9610
9611~tomdet that makes sense now.
9612
9613 ok got it.
9614
9615~rabsef let's look at line 8
9616
9617~tomdet so coders like to have a neat summary of everything that will
9618 happen at the beginning before they get into the weeds.
9619
9620 that is an important point for learning.
9621
9622~rabsef I think that's the idea
9623
9624 yes it is - good point
9625
9626~tomdet A coder can look at line 1-6 and tell what is going to happen,
9627 and then they then know what to look for.
9628
9629~rabsef it's not always true but it's a nice way of writing something
9630 simple like that
9631
9632~tomdet as compared to the result of the entire effort being in line 42
9633 or something.
9634
9635~rabsef yes and you can keep doing that in the core where shift calls
9636 operate, passing message key and the value of the arm encoder
9637 when passed key
9638
9639~tomdet it is time efficient to do that. ok i'm getting this now.
9640
9641 it's nice that it is set up that way. Basic as you know is not
9642
9643~rabsef inside of a core, you can call anything that is part of the
9644 "subject". The subject of an arm of a core is the parent core
9645
9646 that is to say shift can call unshift, operate, encoder,
9647 decoder, coder, zipper, and rott
9648
9649 the core starts at |%
9650
9651~tomdet got it. briefly define core please.
9652
9653~rabsef yah.. about that
9654
9655 lol
9656
9657~tomdet is this where all of the "workhorses" are stored?
9658
9659~rabsef It's very hard to define, for me. a Core is a broad definition,
9660 a gate is a type of core as is a door
9661
9662 let me get their definition one sec
9663
9664~tomdet ok
9665
9666~rabsef A core is a cell of a battery and a payload. It is a Hoon
9667 construct similar in use to Objects in Object Oriented
9668 programming languages.
9669
9670 remember that battery = [sample context] and payload is "what to
9671 do w/ it"
9672
9673 in a simple gate |= a=@ud +(a), for instance, the battery is the
9674 sample of a and the payload is +(a)
9675
9676~tomdet ok
9677
9678~rabsef in this specific case our |% core is unlike a gate in that it
9679 doesn't take direct sample, but the context is the larger gate
9680 that took in msg and key
9681
9682 (I think - ~risruc correct if I'm wrong therE)
9683
9684 the context is something like the subject in which the thing
9685 occurs
9686
9687 so the subject of our core is the 'program' that it's running
9688 in which includes the information coming in and given a face at
9689 line 2
9690
9691~risruc it's useful enough to thing of a core as an object with one or
9692 more arm.
9693
9694 a gate is a specific core with only one arm
9695
9696~rabsef yah and a gate is one w/ one arm called?
9697
9698 $
9699
9700~risruc so it doesn't need a ++ arm declaration
9701
9702~tomdet ok
9703
9704 all right so |% defines a core for this cypher?
9705
9706~rabsef yes - you could say it just starts a core period
9707
9708~tomdet and then the items under ++ are called what?
9709
9710~rabsef arms
9711
9712~risruc ++ creates an arm of the core.
9713
9714~posbus test (send ack if possible)
9715
9716~risruc ack
9717
9718~rabsef Yah - to clarify, the stuff under the ++ is /part/ of the
9719 declared arm
9720
9721~tomdet cool
9722
9723 hello pos
9724
9725~posbus ty
9726
9727~rabsef ok - I think we're probably done there for this week?
9728
9729~posbus Hello everyone
9730
9731~rabsef unless you have further questions
9732
9733 ~posbus-bictud Hey bicdude
9734
9735~tomdet I think so. I have a good amount to review
9736
9737~risruc you can think of the arm ++ shift as you would a generator named
9738 shift.hoon
9739
9740 you see from its gate that it requires a sample of [tape @ud]
9741
9742~tomdet very helpful, and was wondering that. Thank you
9743
9744~risruc and it works the same way with arms of a core.
9745
9746 also, useful to review that "arm" simply means a wing with hoon
9747
9748~rabsef the only important distinction between separate .hoon files in
9749 gen is that you can call the arms directly shift calls operate
9750 and so on
9751
9752~risruc whereas "leg" means a wing with only data.
9753
9754 remember that all data structures are binary trees.
9755
9756~rabsef yah - that's a hard distinction imo. for instance, is alpha an
9757 arm or a leg?
9758
9759~risruc each branch is a wing, either an arm(has hoon code) or a leg(has
9760 only data).
9761
9762~tomdet ok I got all of that down, will study. Thanks guys!
9763
9764~risruc good question, ~rabsef. by the definition i gave, we should say
9765 leg.
9766
9767~rabsef but it's called as an arm I think maybe it's transiently an arm
9768 until evaluated and is then a leg because it has no evaluation
9769
9770 ?
9771
9772 lol
9773
9774~tomdet This is nice because it tees me up for being ready for hoon 101
9775
9776~rabsef there are a lot of dope caesar exercises
9777
9778 I felt very accomplished when I figured some of them out
9779
9780 I strongly recommend doing all of the exercises in the readings
9781
9782 i suppose that's obvious
9783
9784 ok I'm going to work on my conversion utility and then maybe a
9785 few more simple generators for the thing
9786
9787~tomdet agreed, I really need to dive into that with gusto
9788
9789 thank you for your time! makes me invigorated to dive in
9790 further.
9791
9792~tomdet nice.
9793
9794~polmex did anyone launche the Fake ship ? I can't. When I follow the
9795 aerology instructions video it appears this on my shell $ git
9796 clone https://github.com/urbit/urbit.git fatal: destination path
9797 'urbit' already exists and is not an empty directory.
9798
9799 did anyone launche the Fake ship ? I can't. When I follow the
9800 aerology instructions video it appears this on my shell $ git
9801 clone https://github.com/urbit/urbit.git fatal: destination path
9802 'urbit' already exists and is not an empty directory.
9803
9804 did anyone launche the Fake ship ? I can't. When I follow the
9805 aerology instructions video it appears this on my shell $ git
9806 clone https://github.com/urbit/urbit.git fatal: destination path
9807 'urbit' already exists and is not an empty directory.
9808
9809 sorry for spam, just crashed lol #hoontard
9810
9811~botter you already have something named urbit in that directory
9812
9813~polmex I know, its my planet
9814
9815~botter mk newdir
9816
9817 then
9818
9819 cd newdir
9820
9821~polmex wherever?
9822
9823~botter run your commands now and there'll be no conflict
9824
9825 yeah. I'm assuming you're in the your home directory
9826
9827 your default directory when you login
9828
9829 this would be /home/[whatever your username is/newdir
9830
9831~somlus thx for helping botter. welcome polmex
9832
9833~botter er, the command is mkdir, not mk.
9834
9835~polmex yep
9836
9837 I fig it out
9838
9839 I done it
9840
9841 I know basic linux stuff but when it comes to affect my urbit
9842 thing I'm very cautious, I don't want to spoil my ship hehe
9843
9844 thanks sir
9845
9846~somlus that is concern well placed, polmex.
9847
9848~polmex after cloning I can't either bootstrap
9849
9850 when im in 'urbit' and type "./scripts/bootstrap" >> bash:
9851 ./scripts/bootstrap: No such file or directory
9852
9853 :S
9854
9855 guessing it could be because I need to install nix before?
9856
9857~digmel Does it take a while for the notebook to show up? I was in last
9858 week, can't find my OG ship, idk how to run a fake one- so I
9859 deleted everything and started over- and here I am :) So- I
9860 ran the :publish &publish-action [%subscribe ~rapfyr-diglyt
9861 %hoon-school-assignments] command, and I got the error that
9862 everybody else did, but I also got >= which means successful
9863 right?
9864
9865~risruc was your OG ship a planet or another comet?
9866
9867~digmel well I am not entirely sure- I booted it up using my planet
9868 creds, but it gave me a different handle when I was in here- so
9869 I assume it was a comet- also during the boot sequence it said-
9870 if you want it to go faster get a planet- so... 53% confident in
9871 my answer: comet.
9872
9873 I can't get back far enough in the chat to find my
9874 original original- i was also in with this handle:
9875 ~latnep-tacweb-sannev-lidtux--donmyn-mostug-noldev-marzod
9876 From my understanding I am creating a new comet each time-
9877 I do not know how to retrieve or relaunch an instance. Any
9878 recommendations?
9879
9880~risruc was it 16 syllables like your current name?
9881
9882 or 4 like mine
9883
9884 4 = planet
9885
9886 16, comet
9887
9888 if you launched it successfully the first time, for subsequent
9889 launches, you don't need the -w or -k commands.
9890
9891 those might result in mining a comet rather than using your
9892 plant
9893
9894 in any event, since you've deleted everything, to get your
9895 planet back, you must log in to bridge and reset your network
9896 keys
9897
9898 (breach continuity)
9899
9900 under the admin section.
9901
9902 then download your arvo keyfile
9903
9904 and ./urbit -w sampel-palnet -k keyfile
9905
9906 again, every time after that first boot, you will launch just
9907 with ./urbit sampel-palnet
9908
9909~digmel OO! OK- I see, I didn't go back far enough to reset! Thanks.
9910 Before I go- if I wanted to come back using this comet- would I
9911 be able to? Not if I reset the key right?
9912
9913~risruc yes
9914
9915 just check the folder name it's using for data
9916
9917 (its pier)
9918
9919 and then run ./urbit comet-folder
9920
9921 comets don't have keys except for their own names
9922
9923 its name is a 128bit public key
9924
9925 so you can't reset a comets network keys
9926
9927 that's why they aren't meant to be permanent identities
9928
9929 but as long as you don't delete the folder it's running from,
9930 you can use it forever
9931
9932 or sink it somehow (screw up to the point you can't boot)
9933
9934~digmel ok, thank you! I will try to be back as my planet.
9935
9936~risruc planets you can sink as often as you like aaaand not lose your
9937 identity, since you can always reset your keys
9938
9939 just ask our good friend ~rabsef :)
9940
9941 I won't be here if you make it back. knocking out.
9942
9943 good luck!
9944
9945~digmel night!
9946
9947 ty
9948
9949~rabsef 22 rifts and counting. Probably need to do another one soon.
9950
9951~lagrev needs a leaderboard
9952
9953~rabsef I think in the .9 lineage I racked up 19 of those 22 and when
9954 they rebooted zod (or livpub or somebody) I displayed 19 times
9955 and several Tlon people were like wtf dude
9956
9957~lagrev if you're not double digits do you even Mars
9958
9959~rabsef go hard and do terrible things to your planet or go home. I
9960 learned it from you dad
9961
9962~somlus comet digmel, did you make it back as your planet?
9963
9964~polmex after cloning I can't either bootstrap when im in 'urbit' and
9965 type "./scripts/bootstrap" >> bash: ./scripts/bootstrap: No such
9966 file or directory
9967
9968 any idea guys?
9969
9970~somlus sorry if you answered this already but why are you going that
9971 route as compared to the curl and tar commands to get the files?
9972 I don't have much experience building binaries this way
9973
9974~walden ~polmex-nocten: you want to follow the directions here instead:
9975
9976 https://github.com/urbit/urbit/#development
9977
9978 sorry about the double post, was having trouble reaching
9979 ~somlus-savlev
9980
9981 i only posted once, fwiw
9982
9983~somlus no worries, I only see one on my end. I have learned that a
9984 double post *can* occur when the sender is an a weak connection
9985 for some reason, but we have had somlus slight lag issues for a
9986 while now. it's much improved but occasionally still an issue.
9987
9988~ronlyr .
9989
9990~haclex i. am. in.
9991
9992~somlus kaaaaaaaboom. welcome
9993
9994~haclex i'm entirely useless in here of course, but it feels good to get
9995 in after being locked out all the same ;)
9996
9997~somlus actually, I was thinking that you will be astounded with the
9998 extremely basic level on which we cover hoon. You might find
9999 it frustrating because you will likely grasp these concepts
10000 quickly. In any case you are, of course, more than welcome to
10001 participate any time you like.
10002
10003~haclex there's presumably some sort of hoon tutorial on urbit.org
10004 somewhere in some form
10005
10006 at least i've seen it referred to iirc. i figure i'll start with
10007 that at some point when my brain is functioning *and* i don't
10008 need it for doing more pressing things
10009
10010~somlus I"m sure you found it by now but yes this is that section:
10011
10012 https://urbit.org/docs/tutorials/hoon/setup/
10013
10014~lagrev IMO there's a bit of a gap in the Hoon curriculum. There's a lot
10015 of time on basics (great!) and Gall development (great!) but
10016 there's not really an "advanced" Hoon or a "Hoon in practice"
10017 module.
10018
10019 (The docs do cover this.)
10020
10021 One of the consequences is that one often doesn't know when to
10022 dig for a library, use an existing pattern, or write something
10023 new.
10024
10025~somlus yes lagrev, they are actually aware and we are going to reach
10026 out to see if they are open to ideas to help fix this! It's
10027 a fairly widely commented thing. There's a chance that some
10028 changes will come in time for the next hoon 101 session (not
10029 this one), but that's all pending. Sorry to be secretive-ish but
10030 don't want to set any expectations until we know if there is an
10031 interest in hearing creative solutions.
10032
10033~lagrev awesome
10034
10035~haclex i expect it to be sufficient for me to read an introductory
10036 text, map all of the functional concepts to whatever they
10037 renamed them to, and then read actual code. but i'm an edge
10038 case, so what you're doing here is great
10039
10040 an architectural overview would be super helpful though, since
10041 trying to induce it from code is going to be a pain and a time
10042 sink i can't afford
10043
10044~ronreg which is actually a neat thing to have a programming language
10045 std library, and of course hoon itself needs something like that
10046 to parse and compile hoon
10047
10048 a few weeks ago I was trying to write a parser in hoon, and
10049 I was asking some basic question pertaining ot this, when
10050 someone pointed out that the std library has some basic parser
10051 combinator functionlaity already
10052
10053~rabsef ~haclex could you point me to an architectural overview of
10054 something (anything) that you think is a good example of what
10055 you mean?
10056
10057~hastuc https://urbit.org/docs/reference/vane-apis/gall/
10058
10059 This is a pretty good hands on overview of the general structure
10060 of userspace applications
10061
10062 (disclaimer: I wrote it)
10063
10064 alternatively for a more high level view of how exactly urbit
10065 works the whitepaper is good
10066
10067 https://media.urbit.org/whitepaper.pdf
10068
10069~rabsef Thanks :)
10070
10071~hastuc alternatively have a look through the urbit-dev google group
10072 it's a fantastic resource
10073
10074~haclex ~rabsef an example of what i mean when i talk about a good
10075 architectural overview of a complex system is the linux
10076 netfilter docs rusty russell wrote around 2.4-2.6, complete with
10077 following the path of a packet through the linux kernel and
10078 tcp/ip stack
10079
10080 i've been pointed to some urbit docs now, have not yet read them
10081 and don't know how good they are, but they're already better
10082 than what existed last time i asked since that was virtually
10083 nothing ;)
10084
10085~rabsef I'll take a look @ that - thanks haclex
10086
10087~haclex it's significantly outdated now in the era of ebpf, new-mm and
10088 so on
10089
10090 it's significantly outdated now in the era of ebpf, new-mm and
10091 so on it's significantly outdated now in the era of ebpf, new-mm
10092 and so on it's significantly outdated now in the era of ebpf,
10093 new-mm and so on outdated now in the era of ebpf, new-mm and so
10094 on, but worth a read anyway
10095
10096 wow, wasn't *so* good it was worth saying that many times
10097
10098~lagrev haclex, do you need some percussive maintenance to recalibrate
10099 your vocoder?
10100
10101~haclex either that, or for urbit to handle network hiccups better, or
10102 for my cable headend to finally figure out these 8 channels are
10103 noisy and give me new ones
10104
10105 hmm, I didn't think I posted that to this channel
10106
10107~somlus Question for ~rabsef or ~risruc or whoever:
10108
10109 Is there a reasonably straightforward way to explain what the
10110 "expands to" components of the standard library runes means?
10111
10112~risruc specific exampel?
10113
10114~somlus one moment
10115
10116 https://urbit.org/docs/reference/hoon-expressions/rune/bar/
10117
10118 all runes have the same sections: syntax, semantics, expands to,
10119 discussion, example
10120
10121 I am trying to grasp these different sections, though I know
10122 most of it is over my head. as long as i understood the intent
10123 of the expands to section I would be further along
10124
10125~risruc "expands to" means "could be written with lower level runes as:"
10126
10127~somlus ok thanks.
10128
10129 perfect
10130
10131~risruc not only "could be written" but "is interpretted as"
10132
10133~somlus I do not yet know those lower level runes so there is the
10134 confusion
10135
10136 got it - to build this command, we used these simpler tools so
10137 you don't have to every time...
10138
10139~risruc it's like saying 5! expands to 5*4*3*2*1
10140
10141 correct ^
10142
10143~somlus ok great. that will actually help me one day understand the
10144 lower level commands because there are so many examples of using
10145 them of course.
10146
10147~risruc protip: print out the cheat sheet
10148
10149 or just have it open in a tab at all times
10150
10151~somlus I have it but still don't have the vocabulary to understand the
10152 terms and what they are trying to do. I'll get there
10153
10154 what is the best definition for 'mold' ?
10155
10156 nm found them in 2.3.2 will figure it out
10157
10158~rabsef I’m not really sure I fully get mold yet tbh
10159
10160~somlus got it - going through the list of atoms exercise, ^- functions
10161 to typecast by mold.
10162
10163 that's where I got to looking for it.
10164
10165 Question - in the list walkthrough, the null value (line 6) is
10166 the next line after the logic test "does end equal count" - does
10167 this null end the generator because it is a null, or does it add
10168 the final null onto the list, and this then ends the generator
10169 because the ^- rune created a typcast by mold command, which
10170 defined the mold as a list of atoms and as a list, needed to be
10171 null terminated, and with this final null the list is complete
10172 so that command is complete, so the generator is complete? I
10173 hope that makes sense. wondering if ~ is basically one of the
10174 commands to terminate a generator, or simply initiated a cascade
10175 of completion which finished all the work the generator knew it
10176 had to do
10177
10178~rabsef it makes sense
10179
10180 the null ends the list because it is a final value for the duple
10181 cell being created each recursion (I’m not looking at it but
10182 that’s what I remember)
10183
10184 null does not automatically end a cell/list but for needing to
10185 be the terminal tail of a list but adding one to the first or
10186 tail-most-tail position of a list doesn’t automatically end what
10187 ever you’re building. you could add another element to the right
10188 and screw it up as a list but still have a valid cell I believe
10189
10190 your latter wondering is correct
10191
10192~somlus thanks
10193
10194 In the rune explanations, there is a regular syntax and an "AST"
10195 Abstract Syntax Tree syntax. Why?
10196
10197 What's the value of having two ways of describing syntax?
10198
10199~rabsef that’s a good one and idk. here is an experiment for ur last
10200 question. change cast to list to cast to cell (kethep ket) and
10201 change the null to ‘end’ and see the cell it produces
10202
10203~somlus end in single quotes?
10204
10205 getting only errors on that experiment
10206
10207 this is what I did
10208
10209 https://pastebin.com/snvBDACx
10210
10211 we can forget about it - I'm satisfied that i know what's going
10212 on with the end of that generator
10213
10214 New question:
10215
10216 https://pastebin.com/jarRwn4X
10217
10218 in this example, the list ends in the number 100. The question
10219 is: how does the ?: know where to send the "false" output
10220 computer next. I added :- 100 but it did not consider that to be
10221 the first and ~ to be the second child. it knew that :- 100 and
10222 ~ were the first child and :- count onward was the 2nd child.
10223 How did it know that without any confusion?
10224
10225~rabsef sorry for my belated reply - it's the wrong kind of single
10226 quotes in there
10227
10228 ' ' not ` `
10229
10230 I typed it wrong sorry
10231
10232 It's the other way. Each :- for the no condition opens a cell
10233 and gets a left hand value [1 [2 [3 [4 ~]]]] or [1 [2 [3 [4 [100
10234 ~]]]]]
10235
10236 in the next recursion, then, the no condition again opens a cell
10237 :-(1 :-(2 :-(3 :-(4 {yes condition} ~))))
10238
10239 look at all those unhappy faces
10240
10241 :-(1 :-(2 :-(3 :-(4 ~))))
10242
10243 `(list @ud)`:-(1 :-(2 :-(3 :-(4 ~))))
10244
10245 It might help to write that one down - each recursion write out
10246 the hoon that is happening and what is left open
10247
10248 :- has 2 children, is given one before buck so it's still open -
10249 so buck calls back to the |- trap /inside/ of the second child
10250 of the first :- and so on until ~
10251
10252 `(list cord)`:-('countprime' :-('recursionone' :-('recursiontwo'
10253 :-('recursionthree' ~))))
10254
10255 :-('countprime' :-('recursionone' :-('recursiontwo'
10256 :-('recursionthree' ~))))
10257
10258 ['countprime' ['recursionone' ['recursiontwo' ['recursionthree'
10259 ~]]]]
10260
10261 Does that make sense?
10262
10263~somlus studying it... (thanks BTW)
10264
10265~rabsef my pleasure - let me know if you want to go more on it
10266
10267~somlus Yes, makes sense. That is how I understood it. So the final null
10268 slams shut all of the cells. it closes the right most cell, and
10269 that makes the right most part of the cell to the left of that
10270 one and so one, ok great. thanks
10271
10272~rabsef just to be clear it only 'closes them' because it is a value
10273 (arm) rather than more computation (leg)
10274
10275 and :- needs 2 arms [one two]
10276
10277 I think you get that but it's not about that value being ~
10278
10279~somlus oh I thought it closed them because the generator specified that
10280 the final product needs to be a list, ending in null, so once
10281 you end in null, the generator says "oh I'm done - I built what
10282 I said I would build"
10283
10284~rabsef no - suppose you cast as a list but instead of ~ put 'end' -
10285 you'll get a nest fail
10286
10287 because... it's not a list because the last term is 'end'
10288
10289 but it is a cell
10290
10291 :-(1 :-(2 :-(3 :-(4 'end'))))
10292
10293 `(list @ud)`:-(1 :-(2 :-(3 :-(4 'end'))))
10294
10295 `(list @ud)`:-(1 :-(2 :-(3 :-(4 ~))))
10296
10297 Perhaps u could use some more LSD, doc?
10298
10299~somlus haha! yeah, send it over.
10300
10301 trying now to rewrite it as you suggested earlier, to not
10302 require it to be a list of numbers, but instead a list of nouns
10303
10304~rabsef wait tho - list means one thing in specific
10305
10306 ['a' ['series' ['of' ['nested' ['cells' ['that' ['are'
10307 ['null-terminated' ~]]]]]]]]
10308
10309~somlus sorry you said cast to cell.
10310
10311 ok trying that
10312
10313~rabsef `(list cord)`['a' ['series' ['of' ['nested' ['cells' ['that'
10314 ['are' ['null-terminated' ~]]]]]]]
10315
10316 ['a' ['series' ['of' ['nested' ['cells' ['that' ['are'
10317 ['null-terminated' ~]]]]]]]
10318
10319 ['a' ['series' ['of' ['nested' ['cells' ['that' ['are'
10320 ['null-terminated' ~]]]]]]]]
10321
10322~somlus yes sir. can't end in 'end' or it's not a list
10323
10324~rabsef sorry that took me a min lol
10325
10326 `(list cord)`['a' ['series' ['of' ['nested' ['cells' ['that'
10327 ['are' ['null-terminated' ~]]]]]]]]
10328
10329~somlus u, sir are committed
10330
10331~rabsef you should see all the garbage executions that pile up at the
10332 bottom of my screen lol
10333
10334 this is why I cannot have nice things
10335
10336 although 10.3 is hella stable on this new OTA
10337
10338 I haven't crashed in over a day
10339
10340~risruc important point ^ rab. it doesn't close all the cells because it
10341 returns ~, it closes the cells because it returns an atom, not
10342 :-
10343
10344~rabsef ^!
10345
10346~somlus thanks
10347
10348~rabsef that is the /ultimate/ point
10349
10350 not to back pat myself
10351
10352~somlus what am I missing here?
10353
10354 https://pastebin.com/UDAYBGWc
10355
10356 trying to convert this to a non-list cell output. used ket for
10357 the mold
10358
10359~rabsef does it error?
10360
10361~somlus and put the cord 'end' in there
10362
10363 yes
10364
10365~rabsef just comment out the kethep
10366
10367 mabe you can't cast as ^
10368
10369~somlus that worked
10370
10371~rabsef my b
10372
10373~somlus ok cool.
10374
10375~rabsef u could ^- [* *]
10376
10377 do you understand why that would work? - think about it
10378
10379~somlus [1 [2 [3 [4 'end']]]]
10380
10381~rabsef relates to subject
10382
10383~somlus that's the output neat
10384
10385 gimme a minute to consider
10386
10387~rabsef yah - sorry that's what I wanted you to get earlier lol - I was
10388 writing from fone
10389
10390 i'm kinda surprised u can't cast as ^ cuz you can cast as @
10391
10392 seems weird
10393
10394~somlus if everything is a cell, you don't need to state that it is a
10395 cell. that is the status quo
10396
10397~rabsef sort of - If * means anything, an @ or a ^ then [* *] can be [1
10398 2] or [1 [2 [3 4]]]
10399
10400 in the second example, the first * is 1 and the second is [2 [3
10401 4]]
10402
10403~risruc you could as well just use * :)
10404
10405~rabsef that is true lol
10406
10407 which is why you should be able to ^
10408
10409~somlus dinner's ready heading afk a bit
10410
10411~rabsef I might not get why ^ doesn't work there
10412
10413~somlus thx for the help though
10414
10415~rabsef my pleasure - let's do some more later if I'm around :)
10416
10417~somlus ok cool if you're game. I figured you were learning on yourown
10418
10419~rabsef I am but I'm stuck so I'm happy to think w/ you
10420
10421~somlus ok, here's another Q:
10422
10423 Pastebin to follow question
10424
10425 in this example, the list ends in the number 100. The question
10426 is: how does the ?: know where to send the "false" output
10427 computer next. I added :- 100 but it did not consider that to be
10428 the first and ~ to be the second child. it knew that :- 100 and
10429 ~ were the first child and :- count onward was the 2nd child.
10430 How did it know that without any confusion?
10431
10432 https://pastebin.com/jarRwn4X
10433
10434~rabsef https://hastebin.com/kuhayucuvu.shell
10435
10436 I'm not sure what you mean exactly. The /last/ value of your
10437 cell opened in a yes condition is just a cell
10438
10439 the cell of 100 ~
10440
10441~risruc the ~ is the last entry in the list. in case it's confusing that
10442 it displays it first in dojo.
10443
10444~rabsef the first child of the first cell is the furthest left value
10445
10446 ahhh cuz list
10447
10448 my b - didn't understand wat u meant
10449
10450~risruc if you run that with +gen 10
10451
10452 you'll get ~[1 2 3 4 5 6 7 8 9 100]
10453
10454 which of course is [1 2 3 4 5 6 7 8 9 100 ~]
10455
10456~rabsef or [1 [2 [.... [100 ~]...]]
10457
10458~somlus So the boolean logic asks if end equals count. if not so then it
10459 goes to the next line that say "add 100 to the list" and then I
10460 would think it would say "ok so that's what we do if true, so
10461 the next line is what we do if false, and then it would end on ~
10462 but it does not. It knows that both 100 and ~ are what you do if
10463 true. How does it know clearly where the "if false" part begins?
10464
10465 hope this makes sense.
10466
10467~risruc [1 [2 [3 [4 [5 [6 [7 [8 [9 [100 ~]]]]]]]]]
10468
10469~rabsef Ah no - because you start the "true" line w/ :-
10470
10471~somlus I figured the true/false routing was by line, but it is clearly
10472 not. so if not, then what is it by?
10473
10474 oh shit that easy?
10475
10476~rabsef so it says "oh I gotta make a cell first value of... 100 ...
10477 second of ... ~"
10478
10479 because :- has how many children? Let me hear it from the back
10480 this time
10481
10482~somlus that's why hoontards....
10483
10484 three - the logic test, the thing if true and the thing if false
10485
10486~rabsef effectively you're just skipping 11-99 hehe
10487
10488~somlus yeah I hate 11-99
10489
10490~rabsef that's ?: - :- has 2 children value 1 and value 2
10491
10492 or noun 1 and noun 2
10493
10494 :-([1 [2 [4 5]]] 6)
10495
10496~somlus oh ok. but the syntax is still (logic test) (if true) (if false)
10497
10498~rabsef :- 2 ~
10499
10500~somlus I may not have noticed that ?: always has :- to trigger the if
10501 false case....
10502
10503~risruc :- 2 ~
10504
10505~rabsef wait let's slow down
10506
10507~risruc :- 2 ~
10508
10509~rabsef that's not quite right
10510
10511~risruc :- 2 ~
10512
10513~rabsef The TRUE condition of ?: is "some hoon" as they are fond of
10514 saying
10515
10516~risruc lol. thid time's a charm
10517
10518~rabsef hoon can either be a value (~ e.g.), or another program
10519
10520 in the exemplary presentation, it is the value ~
10521
10522 in your modified presentation, it is the program :-
10523
10524~somlus yeah I'm looking at the wutcol hoon expression now and :- is not
10525 mentioned.
10526
10527~rabsef that program requires 2 children to close
10528
10529 so - before you put in :- 100 ~, it closed instantly because ~
10530 is a leg/value/not a program
10531
10532 when you put in :-, EVERYTHING after :- is part of the true
10533 condition until :- is satisfied (2 children or 100 and ~)
10534
10535~somlus oh, yeah. I forgot the naivety of needing to be certain when
10536 things are done.
10537
10538~rabsef the most important dunce-ing
10539
10540 of the hoonening
10541
10542~somlus yeah
10543
10544 So when you look at code are you trying to zone in on where
10545 values are determined, and then you know "ok these are the
10546 endpoints of this generator"?
10547
10548~rabsef Let's say it even a little differently - each time you see a
10549 rune you have to determine where it 'goes'
10550
10551~risruc you must become one with the interpretter.
10552
10553~rabsef that is to say when it ends
10554
10555 as ~risruc says
10556
10557~risruc haha
10558
10559~somlus i am not one with the interpreter, to be clear.
10560
10561~rabsef you will be
10562
10563 it becomes more natural.. Here is a story I will tell:
10564
10565 When I was a kid, I couldn't type. My mom got me Mavis Beacon
10566 teaches typing, Mario teaches typing etc
10567
10568 I hated them
10569
10570 Then I found this MMORPG MUD game called Castle Marrach online
10571 one summer
10572
10573 you had to type like "go north" "don cap" etc - it was a text
10574 game
10575
10576 just like zork only many people
10577
10578 so you had to type fast to make your character do things in a
10579 convincing way when read out on the screen right?
10580
10581~somlus sounds cool
10582
10583~rabsef you don't want to be slow to "accept cheese from alice" in the
10584 cafeteria
10585
10586~somlus and there it was -> motivation
10587
10588~rabsef it was the best game - I go back every once in a while lol
10589
10590 yes well so I learned how to type
10591
10592 but further, I truly thought in the parser language for a brief
10593 moment
10594
10595 like I would be outside and think "take box from ground" etc
10596
10597~somlus haha yes that makes sense.
10598
10599~rabsef it just became so natural to think in that parsing cuz I played
10600 it non stop for like 3 months
10601
10602~somlus Well I can say that I am definitely enjoying myself, this whole
10603 thing is like a gigantic puzzle, an enormous brain teaser (is
10604 that the phrase)?
10605
10606~rabsef an enigma wrapped in a conundrum
10607
10608~risruc haha
10609
10610~rabsef w/ a side of mystery
10611
10612~somlus I chisel off a chunk of minor understanding from the whole and
10613 then that lets me go back to something that was greek and then
10614 it's a tiny bit less greek, where I can chisel off another small
10615 piece of understanding
10616
10617~rabsef that's literally how I feel every step of the way - I just have
10618 more runway than you do rn
10619
10620 /have traversed more runway
10621
10622~banhex i loved mavis beacon and still think about it from time to time
10623
10624~rabsef you should try castle marrach
10625
10626 I wish that game were still popular
10627
10628 there are like only 5-10 people online at any given time now. In
10629 it's heyday it was like 40-50
10630
10631~risruc lol.....
10632
10633~rabsef and I played an artist and they custom coded me a paint set
10634 object I could interact w/
10635
10636 it was so sick.
10637
10638~somlus it sounds awesome. I literally played zork first on a green
10639 screen monitor on the 2nd ever IBM PC
10640
10641~rabsef blessed
10642
10643~somlus I was already 872 years old at that time.
10644
10645~rabsef I used to make christmas trees out of x's on the terminal
10646 screens at my moms office when I was sick from school
10647
10648 I get sick a lot (or did years ago)
10649
10650~somlus yeah, I remember the computers at dad's office (IBM) - so
10651 alluring and confusing.
10652
10653 I did too. I was so sick they diagnosed me with cystic fibrosis.
10654
10655 In error, fortunately
10656
10657~risruc :- 3 :- 2 :- 1 ~
10658
10659~rabsef ~ris - do my examples print for u? That one didn't for me
10660
10661~risruc that help ~som?
10662
10663 oh.
10664
10665 haha
10666
10667~rabsef :- 3 :- 2 :- 1 ~
10668
10669~risruc sometimes yes, sometimes no.
10670
10671~rabsef weird right?
10672
10673~risruc well, it produced [3 2 1 ~]
10674
10675~rabsef I see it on my end lol
10676
10677~somlus I did not see the result, just the code that leads to the
10678 result.
10679
10680 But it's good to see that :- can be done in succession to arrive
10681 at nested cells.
10682
10683~risruc thought it might help ~som understand
10684
10685 to see what is actually being done written out on one line
10686
10687 that's precisely what your generator does.
10688
10689~somlus yeah it does actually.
10690
10691~rabsef if one of our examples doesn't print just repeat it w/ # on ur
10692 end
10693
10694 cuz we're probably trying to show off and it's frustrating if u
10695 cant see it
10696
10697 hehehe
10698
10699~somlus oh cool i'm reading you can :- more than once
10700
10701~risruc the reason it ends is because the last entry is not :-
10702
10703~rabsef Yes - why?
10704
10705~risruc not because the last entry is ~
10706
10707~rabsef or ris u stepped on it
10708
10709 oh*
10710
10711 :)
10712
10713~risruc haha
10714
10715 ya i blew it.
10716
10717~rabsef say it in ur own words ~somlus - why can you chain :-
10718
10719~somlus because it arrives at an endpoint which is a noun, and a cell
10720 (actually nested cells) and not something that say "hey i've got
10721 something else for you to do)
10722
10723 that's why it ends
10724
10725~rabsef >(actually nested cell) - blessed understanding shines on u this
10726 day
10727
10728 now consider re: arm and leg
10729
10730 :-(leg leg) terminates instantly
10731
10732~somlus and why it can chain is because it builds a cell using the right
10733 two nouns (in this case atoms) after the right most :- and then
10734 that becomes the right most noun for the atom and :- to the left
10735 of that]
10736
10737~rabsef :-(leg arm) has to resolve arm
10738
10739~risruc yep, you got it.
10740
10741~somlus ah yeah, basically super important to keep thinking in terms of
10742 "this has to resolve before..."
10743
10744~risruc once the last child has 2 args, it closes and becomes the second
10745 arg for the penultimate :-, which closes and becomes the arg for
10746 the antepenutimate :-, et c.
10747
10748~rabsef now consider the subject - a giant binary tree where some
10749 positions are arms and some are legs - our naked gen (any naked
10750 gen) is an arm branch that requires a leg being sent to it
10751 (sample) and then resolves itself
10752
10753 >antipenultimate :D
10754
10755 ante*
10756
10757~somlus yeah, I actually understand that now. I'm sort of blown away /
10758 in awe that we're in the middle of a giant tree right now and
10759 the more fundamental nodes, living by the same rules, are above
10760 us on the way to the core node, nock
10761
10762 again, please pass the LSD
10763
10764~rabsef let us consider and meditate for a moment on the mind that
10765 envisioned this
10766
10767 Curtis is a fugging galaxy brain
10768
10769~somlus totally.
10770
10771~rabsef It's downright implausible that a mind could think of this, in
10772 my opinion
10773
10774~risruc btw somlus, that generator ending with 100 ~ is adorable
10775
10776~somlus thanks man, I named him ~george
10777
10778~rabsef +george 99, the perfect proram
10779
10780~risruc [1 2 3 100 ~]
10781
10782 lol!
10783
10784~somlus Yeah, it's how I play hide and go seek count to 100.
10785
10786 +george 5
10787
10788~rabsef lol
10789
10790 Adam Carolla has this bit "You know it's funny when people say
10791 'You can run but you can't hide'. Of course they can hide.
10792 Really the saying should be 'You can run, and you can hide, but
10793 I will find you anyway'"
10794
10795~somlus yes perhaps the word "forever" got lost off of that saying in
10796 the middle ages
10797
10798~risruc man that just cracked me up some.
10799
10800 som.
10801
10802 wife "hm?"
10803
10804 > nerd things
10805
10806 no further questions
10807
10808 to get great
10809
10810~somlus totally. I just showed my wife the +list generator and it's full
10811 output and she was like. "ummmmmmm..... you've been in that
10812 chair since 5am you know?"
10813
10814 I'm like "yeah but I'm happy"
10815
10816~risruc to her great credit, she's learned to take that as a good enough
10817 answer.
10818
10819 haha!
10820
10821~somlus indeed
10822
10823~risruc yeah man. learning is the bomb.
10824
10825 and this feels special
10826
10827~rabsef LOL
10828
10829 My fiancee is always like "So how's your... urbit stuff?"
10830
10831 I love it that they're supportive but also not invested - it is
10832 cute as hell
10833
10834~somlus yeah it's nice. I think that chicks dig it when their men are
10835 super into super harmless stuff. for lots of the right reasons,
10836 plus they can turn off their brains to worrying about the man's
10837 well-being or whether he is trending toward up to no good.
10838
10839~rabsef lol fiancee found out about CY founder of tlon today and wiki'd
10840 him and we did have to have a multi-part discussion about
10841 why the wiki on him is grossly inaccurate and abusive to his
10842 character
10843
10844~somlus yeah, much to discuss there...
10845
10846 might help the project actually - all news is good news in a way
10847 to a project that wants to be known
10848
10849~rabsef It's frustrating because I read UR and think it's clearly the
10850 work of a genius and I have a major issue w/ constraining genius
10851
10852 Like - just let these people think and produce because whatever
10853 it is it will be forward
10854
10855 more than now, which is objectively good
10856
10857~somlus Good morning guys. I realize we are not due to being for another
10858 40 mins. Wanted to set some expectations. I am still all-in as
10859 always. Having said that, all 12 hours of yesterday's work were
10860 basically re-learning, organizing notes, solidifying and not
10861 moving beyond a generator unless I pretty much fully undersood
10862 it. That took some time, since some concepts are abstract and
10863 needed to work through those.
10864
10865 As such, I have not studied the Caesar Cypher, but even if
10866 unprepared I know that I will learn a lot so I am still ready to
10867 jump into the pool of molten lava for another Hoon baptism.
10868
10869 *not due to meet
10870
10871~nibtyc Here as moon
10872
10873~tomsef hi fellow hoontards
10874
10875~rabsef hey good morning.
10876
10877 we will be starting shortly. somlus, I want to spend the first
10878 half just looking at the structure and learning how to read it
10879 so we can then dissect the arms thereafter, and in order
10880
10881 so no need to be super prepared
10882
10883~somlus ok
10884
10885 those were the magic words today.
10886
10887~rabsef I’ll be on in 4. just taking care of. few things and getting out
10888 my Sunday best.
10889
10890~somlus take your time, i'm chilling and getting everything in its place
10891
10892 cyper loaded and working in moon
10893
10894 cypher
10895
10896 hey tomsef!
10897
10898 might not chat as moon so that I can have the moon screens all
10899 be full of vscode and dojo
10900
10901 we'll see
10902
10903 tomsef, we are going to go over the caesar cypher from section
10904 1.7.1 of the walkthrough. You probably saw that but wanted to
10905 make it clear
10906
10907~rabsef I arrive!
10908
10909 let me pull that bad boy up r quick
10910
10911 Ok - so everyone here who wants to be here?
10912
10913~somlus I reckon
10914
10915~rabsef Last time we went over a little bit of the introductory material
10916 for caesar. I want to return to that and go through the first 6
10917 lines carefully again
10918
10919~somlus great
10920
10921~rabsef They will help us in several ways, (1) we should look at how
10922 gates are called and what they require (2) we should look at the
10923 function of =. and what it's doing and (3) we should use this
10924 opportunity to reinforce our discussion of :- from yesterday
10925
10926~somlus ~tomsef don't be shy with questions
10927
10928~rabsef https://urbit.org/docs/tutorials/hoon/caesar/
10929
10930 ^this is what I'm talking about incidentally, if you want to
10931 follow along
10932
10933 Line 2 opens a gate - what does it expect?
10934
10935 it calls a gate I guess - it doesn't open it; bad phrasing
10936
10937~somlus tape and...
10938
10939~rabsef yes two values, in a cell, a tape and a @ud or an unsigned
10940 decimal
10941
10942~somlus an input from the user which is the tape and a real number
10943
10944 which is the key
10945
10946 *which is a tape
10947
10948~rabsef We should note that, in every arm beneath the |% creation of a
10949 core, the arms begin with gates
10950
10951 the gates require various information points - some 2 items,
10952 some more. This is going to be important for us.
10953
10954~somlus ok
10955
10956~rabsef save for alpha which is basically a leg of data
10957
10958 So - when we get further into this and we see an arm get called,
10959 we should be able to intuit from looking at that arm what data
10960 structures the arguments are (arm arg arg2 arg3) of arm |= @ud
10961 @tas tape would require (arm 1 %term "here")
10962
10963~somlus ok
10964
10965 I get it so far
10966
10967~rabsef sometimes its easiest to think of it that way so you can
10968 remember what the arguments you're calling are and better
10969 understand how they're getting there, especially when an
10970 argument is a call to an arm itself (see (operate message key
10971 (encoder key)) where (encoder key) is a call to the encoder arm
10972 and requires an @ud
10973
10974~somlus ok
10975
10976~rabsef aight - line 3 "composes two expressions, inverted"
10977
10978 what the hell does that mean?
10979
10980 also, for bonus points, identify the two expressions here
10981
10982~somlus one moment
10983
10984 thinking...
10985
10986~rabsef Here is a hint: It is proper hoon style to keep the "heaviest"
10987 part of the program towards the bottom - the top should be
10988 reserved to show you what's going on as output. This style
10989 choice correlates to what we're asking
10990
10991 heavy = more hoon basically
10992
10993~somlus the shift and unshifted messages
10994
10995~rabsef those are what? the two expressions? one each?
10996
10997~somlus and just before that you say "convert this message to lower
10998 case"
10999
11000 one moment
11001
11002~rabsef (the proposed two expressions one each I just made is incorrect
11003 - think of the hint)
11004
11005~somlus ok
11006
11007~rabsef It's pretty hard - let's work through it together? Or you want
11008 another sec?
11009
11010~somlus hmm sorry I keep concluding that you are outputing an upshift
11011 in characters and also a downshift in characters based on the
11012 number inputted. I do not see output beyond that
11013
11014 yeah let's go through it.
11015
11016 there is a shift and an unshift
11017
11018~rabsef =<(output [possibleoutput=1 output=2 otherpossibleoutput=3])
11019
11020~somlus and then the stuff that supports that
11021
11022~rabsef You're /close/
11023
11024 Yes exactly that's right but perhaps not how I'd phrase it
11025
11026 The expressions in lines 4-6 are the first expression of hoon,
11027 and everything thereafter is the second expression of hoon
11028
11029 the first expression is evaluated in light of the second
11030
11031 =<(output [possibleoutput=1 output=2 otherpossibleoutput=3])
11032
11033~somlus oh, yes ok got it.
11034
11035~rabsef If I just "output" it would be like "find.output"
11036
11037 because output is not in ... the subject
11038
11039~somlus "I need this" (and then hoon thinks, "ok so in order to get that
11040 then let's go tackle this that will get us the thing requested")
11041
11042 and each is an expression
11043
11044~ribnys hoon schooler hanging out here, at least intermittently
11045
11046~somlus ok that concept makes sense now. expression is sort of = bundle
11047 of work that needs to reach completion in order for the next
11048 bundle of work (or solution) can be achieved.
11049
11050~rabsef that's right =< points lines 4-6 to the core line 7 until close
11051 as "the other expression to evaluate the first, in light of"
11052
11053~somlus cool ribnys, welcome. please don't let our fast pace hold you
11054 back from asking any questions. rab and I are pretty comfortable
11055 with one another.
11056
11057~rabsef yes exactly - a hoon expression is something that ends at some
11058 point. The core ends at some point (the --) and the lines 4-6
11059 end at some point
11060
11061 now this brings us to point 3 from earlier - how do we know
11062 lines 4-6 end at some point?
11063
11064 Yah I'm happy to remediate on any part here.
11065
11066~somlus because a command has stated that they determine an input.
11067 I'm looking through runes now. it's either =< or :- I think.
11068 checking
11069
11070 =<
11071
11072~rabsef Just as with our discussion of recursion, where :- has 2
11073 children and terminates producing a cell, on line 6, we have the
11074 last child of :- so the output of 4-6 is a cell of (shift msg
11075 key) (unshift msg key)
11076
11077~somlus compose two nouns, inverted - that is what the generator need to
11078 do before it can go back to bed...
11079
11080~rabsef once those arms (shift... and unshift...) are resolved to
11081 values, the :- can output on screen
11082
11083~somlus oh maybe not.
11084
11085~rabsef that's right I guess - it is composing two nouns and evaluating
11086 the first in light of the second
11087
11088 no you're right it's just not the point I was trying to drive at
11089
11090~somlus let's actually make sure.
11091
11092~rabsef the way we can determine where one noun ends is when it
11093 naturally would make out a product
11094
11095~somlus :- is the most specific command - "construct a cell"
11096
11097~rabsef lines 4-6 make out a product when they (1) mutate the subject
11098 and then (2) construct a cell (a duple)
11099
11100~somlus Since I do not fully understand the importance of =< I jumped
11101 the gun there.
11102
11103 ok
11104
11105~rabsef You're circling the importance. In order to understand =< we
11106 have to be able to interpret what the two expressions are
11107
11108 with something like:
11109
11110 =<(output [possibleoutput=1 output=2 otherpossibleoutput=3])
11111
11112 it's easy - it's output and the cell (1 and 2 respectively)
11113
11114 but with a larger program it is more difficult - so you need to
11115 figure out where one expression is 'complete'
11116
11117 lines 4-6 are a complete thought - they do not 'keep going'
11118
11119 like the ~ at the end of the recursion
11120
11121 we know that we've completed the work
11122
11123 does that make sense?
11124
11125~somlus ok. can you tell me where this notation above came from that
11126 begins with =<(out.... and ends with 3]) ?
11127
11128 I cannot tell where you got that / where it came from
11129
11130~rabsef that's just an example of =< being used in a very simple context
11131
11132 with =<(output [possibleoutput=1 output=2
11133 otherpossibleoutput=3]) we are saying "evaluate output in light
11134 of our second expression of hoon, which is a cell that gives
11135 output a value"
11136
11137 and it returns that value, 2, in light of that cell, when output
11138 is evaluated
11139
11140~somlus To your point where this is like the ~ in the list, yes I
11141 totally understand that. You tell Hoon what you are going to do
11142 and then once you have clearly done that, Hoon knows to stop.
11143
11144~rabsef since output is just a face, we know we are done with output
11145 when we produce the value that face denotes
11146
11147~somlus one moment pls...
11148
11149~rabsef Let me give one more example:
11150
11151 =<(producttwo [productone=(add 1 1) producttwo=(add 2 2)])
11152
11153 but see:
11154
11155 producttwo
11156
11157~somlus ok
11158
11159 that I do understand
11160
11161~rabsef without =< in front of producttwo, the computer does not know
11162 what I'm referring to
11163
11164 with =< it knows to look at /the second expression of hoon/ to
11165 find how to evaluate the first
11166
11167~somlus ok
11168
11169~rabsef Here is a tricky part -> The values established at the gate are
11170 /also/ part of what can be evaluated in the first expression
11171 after =<
11172
11173~somlus clear now
11174
11175~rabsef That is to say "msg" and "key" are still available to the first
11176 expression for evaluation
11177
11178 so /basically/ =< adds the second expression to the context
11179 available to the first expression for evaluation
11180
11181~somlus when you say first expression here you mean the first one to
11182 occur, which is lower in the code correct?
11183
11184~rabsef sorry no. The first expression is linearly the one that comes
11185 first
11186
11187 =<(producttwo [productone=(add 1 1) producttwo=(add 2 2)])
11188
11189~somlus ok got it, realized that from your last line
11190
11191 yes
11192
11193~rabsef "producttwo" by itself is the first expression; the cell is the
11194 second expression
11195
11196~somlus copy that
11197
11198~rabsef here lines 4-6 are "the first expression" and lines 7-n are "the
11199 second expression"
11200
11201~somlus ok, I'm with you so far.
11202
11203~rabsef and what I want to establish most is that we have to be able to
11204 determine where an expression terminates to be able to see first
11205 from second
11206
11207 it's sort of a pedantic point but it's critical for reading hoon
11208 imo
11209
11210~somlus agreed.
11211
11212 and yes I now do see that.
11213
11214~rabsef ok so @ line 2, we have a sample of a tape and an @ud and that's
11215 all we really have to work with
11216
11217 So w/ JUST that information we could not complete lines 4-6
11218
11219 but line 3 comes along w/ =< and it adds to the context
11220 available for evaluating 4-6, 7-n below it.
11221
11222 now /both/ line 2 and 7-n are available to help evaluate 4-6
11223
11224~somlus so is =< basically a message saying "don't freak out, there is
11225 more down below, put a placeholder here and what follows is
11226 going to make this make sense"?
11227
11228~rabsef Last reiteration of this -> if we comment out line 3, we would
11229 error on line 5 with find.shift
11230
11231~somlus I know that's juvenile, but I always try plain english where I
11232 can
11233
11234~rabsef which just means the compiler doesn't know wtf shift is
11235
11236 yes - that's it
11237
11238~somlus great
11239
11240~rabsef ok - so, now we can move forward
11241
11242 lol - sorry
11243
11244~somlus cool
11245
11246~rabsef Ok so line 4 is important too, but you've already said what
11247 it does =. creates a 'mutated' sample where a change has been
11248 made to it and the rest of the program is evaluated off of that
11249 mutation
11250
11251~ronlyr just want to say, this is a great walkthrough... I'm just
11252 lurking and following along.
11253
11254~rabsef There's some significant nuance around what is actually
11255 happening w/ the subject there but I don't really think we need
11256 to get into it, and I'm not sure I understand anyway
11257
11258 Thanks ~ronlyr :)
11259
11260~somlus cool ronlyr! I was actually wondering whether it had lurker
11261 value
11262
11263~rabsef so for our purposes msg is converted using (cass) into a new
11264 form of msg
11265
11266~minder It does
11267
11268~rabsef cass makes a tape lower case
11269
11270~somlus ok. also rab, I want to get back to the "this is the tricky
11271 part" you mentioned above when we're done
11272
11273~rabsef Oh hit me
11274
11275~somlus I did not see anything as tricky, but I will
11276
11277 no let's wait until the end. it will have more context
11278
11279~rabsef yes ok
11280
11281~somlus that's to remind us
11282
11283 keep on keepin' on
11284
11285 ~minder's here! that man is busy if he says it has value, then
11286 it does
11287
11288~rabsef Ok so cass makes a tape lower, cuss makes it upper - so =. msg
11289 (cass msg) takes our incoming "TAPE" or "TaPe" and makes it,
11290 regardless of input format "tape"
11291
11292~somlus I learned that from your ingeniuous spongebob sarcastic text
11293 converter.
11294
11295~rabsef incidentally cass and cuss are part of the standard library and
11296 easy to find using / in the documentation - for those who wonder
11297 how you are to know that
11298
11299 lol thanks :)
11300
11301 why might it be important to have everything lower case?
11302
11303 Well we know the function of this program - it's going to take
11304 in a message and shift it by a given amt
11305
11306 and we can look at line 8 and see that the tape we're going to
11307 use to shift - all lower case values
11308
11309 and:
11310
11311~somlus yeah, and you don't want to reveal any of the encoded text by
11312 telling anyone which characters started out as caps
11313
11314~rabsef ?:(=("a" "A") %.y %.n)
11315
11316 that's not quite why - it's because the generator is too naive
11317 to handle different casing
11318
11319 later, we will make a map where something like a=b, b=c, c=d is
11320 going on in a big list of all letters - if our msg value had
11321 upper case, it would fail for finding the letter to look for
11322
11323~somlus true, you could make it that way. but also as a cypher its' dumb
11324 to preserve casing and tell them germans that you're going to
11325 bomb Xuxenberg
11326
11327 *m
11328
11329~rabsef "A" is not "a" for the compiler, and so if we only have a map
11330 of lower case letters, we have to lower case our input for the
11331 program to work
11332
11333~somlus yes all true
11334
11335~rabsef lol
11336
11337 that is also true
11338
11339 Xuxenberg is a lovely country
11340
11341~somlus As an extra task we might consider converting this to one that
11342 can handle case, some other day.
11343
11344~rabsef it is imminently doable
11345
11346 would make everything a little longer tho
11347
11348~somlus ok continuing...
11349
11350~rabsef ok - so lines 5 and 6 create a cell
11351
11352~somlus yes
11353
11354~rabsef the cell is of two calls to arms below using the values we have
11355 in our context
11356
11357 so here's where we start looking at the arms, and it's going to
11358 get hectic
11359
11360 let's focus just on shift
11361
11362~somlus col
11363
11364~rabsef Shift requires a tape and an @ud, by it's gate - so we pass a
11365 tape and an @ud - namely msg and key
11366
11367~somlus cool
11368
11369~rabsef that's the notation there (arm argument argument argument)
11370
11371 pass means to give the argument to the arm so that it may
11372 compute, to restate that
11373
11374~somlus question why above did we five it the face msg and now we are
11375 calling it message
11376
11377~rabsef that's sort of a tricky question - you could call it msg again,
11378 but then you have two values w/ a face of msg in the subject
11379
11380 the compiler finds the first one and uses that when it's
11381 thinking - you can use other notation to tell it to skip the
11382 first one it finds
11383
11384~somlus oh it's a different value, I should have been more patient.
11385
11386~rabsef it wouldn't really matter here, but consider that within arms it
11387 might be good to keep different names so you're being explicit
11388 w/ the value you want to call
11389
11390~somlus I assumed it was the same thing, the user input.
11391
11392~rabsef it's not different exactly. At line 10, when the msg is passed
11393 to Shift as message, message = msg = message
11394
11395~digmev Hey - so i have some context, what are you guys talking about?
11396
11397~somlus wait, is this like when your spongebob generator built a tape as
11398 it tore down another tape character by character?
11399
11400 hi divmev
11401
11402~rabsef the only difference is that the same value "our message" has
11403 a face of msg and a face of message. Suppose you transformed
11404 message in shift and then later wanted to call it - if you had
11405 named it msg, it would be a pain in the ass because you have msg
11406 qua original and msg qua modified
11407
11408~somlus digmev
11409
11410 https://urbit.org/docs/tutorials/hoon/caesar/
11411
11412 this. line 11 atm
11413
11414~digmev Hmmm, im only on 1.3.1 at the moment so im jumping ahead with
11415 you guys (https://urbit.org/docs/tutorials/hoon/conditionals/)
11416
11417~rabsef It's like this -> I have a string "here", I give it a face
11418 of start="here", I then have another part of my program that
11419 changes it =/ end (cuss start) into "HERE"
11420
11421~somlus ok sounds good rab
11422
11423~rabsef now, I could give "HERE" a face of start again, and there would
11424 be two faces in my subject w/ the same name
11425
11426 but that is confusing
11427
11428~somlus indeed it is.
11429
11430~rabsef and hard to call the one you explicitly mean
11431
11432 it is not against the rules to have two faces of the same name
11433 in the subject tho
11434
11435~somlus ~digmev we begin sundays at 9am PST, all are welcome to join or
11436 lurk
11437
11438 I'm surprised that it is not against the rules, but let's not
11439 over-complicate for now.
11440
11441~rabsef in any event, that's basically why the gate gives the input a
11442 different name - you'll note that key gets the same face again
11443
11444~somlus yes
11445
11446~rabsef ok cool - so what does shift do?
11447
11448 It takes in our arguments, a tape and an @ud and then
11449 immediately calls something else
11450
11451 (this is where this program gets interesting/tricky)
11452
11453 (operate message key (encoder key))
11454
11455~somlus it awakens the "operate" arm to act on message and key, which
11456 requires encoder key to get awakened/activated/completed first
11457
11458~rabsef We don't know what (encoder key) does and that means we only
11459 know that operate takes (operate tape @ud ??)
11460
11461~digmev Im currently on the Hoon 101 and working my way through it, I
11462 will put this on my calender so i know when you guys are on
11463
11464~rabsef let's try to figure out what the ?? is in terms of a type - how
11465 could we do that?
11466
11467~somlus ? ~digmev
11468
11469~rabsef To restate, operate requires 3 arguments, a tape, an @ud and a
11470 ??
11471
11472~somlus ok looking
11473
11474~rabsef what is the ?? in terms of it's type (like tape or cord or @ud
11475 or @tas or.. maybe something we haven't used before)
11476
11477 nice to have all the lurkers incidentally - feel free to shout
11478 out an answer :)
11479
11480~somlus (decoder key) seems to be a cell, but this will take a bit as I
11481 look at what decoder is
11482
11483~rabsef (encoder key) is not a cell, it is a call to an arm w/ an
11484 argument that will eventually resolve to a value of a type
11485
11486 we luckily have an arm called encoder - but we shouldn't start
11487 looking there
11488
11489 let's look @ operate
11490
11491 what does the gate take?
11492
11493~somlus yeah this goes multuiple layers deep, to rott which uses the
11494 alpha string and key
11495
11496~rabsef (operate tape @ud ??)
11497
11498 operate takes a /new/ type of structure that we haven't seen
11499 before. It's called a map
11500
11501 operate requires three arguments - a tape, an @ud and a "map"
11502
11503 see here: |= [message=tape key=@ud encoder=(map @t @t)]
11504
11505~somlus ok headed back up to operate. FYI I'm about 30% behind your
11506 pacing, studying the code
11507
11508 30-50%
11509
11510~rabsef sorry - I'll back it off a bit
11511
11512~somlus no worries. got a bit derailed - working on it.
11513
11514~rabsef Let me explain what we're trying to do - in ++ shift we see a
11515 call to a function that we don't know, we also see that it takes
11516 3 arguments, we know that the third of those is resolved by YET
11517 ANOTHER arm, and we want to know what kind of type that YET
11518 ANOTHER arm should produce. So, we look at operate to see what
11519 the gate takes, and it tells us that the third argument will be
11520 a map. Ergo, (encoder key) will produce a map
11521
11522 the reason that this is important is that it will help us
11523 understand what each arm produces, in turn, and how they work
11524 together
11525
11526~ronlyr in the docs, it says map is a Mold generator. What is mold?
11527
11528~somlus ok map is new to me.
11529
11530 good question
11531
11532~rabsef per the documentation: A mold is a function that coerces a noun
11533 to a type or crashes.
11534
11535 What does that mean?
11536
11537~ronlyr it uses `` to cast?
11538
11539~rabsef mold is a very good name for it. It says I have some data, I
11540 want it in this shape - stuff it in there and if it fits, leave
11541 it, and if it doesn't give up
11542
11543 it's very much like using `` to cast but I'm not sure they're
11544 synonymous
11545
11546 it shouldn't matter too much though, for now
11547
11548~somlus ok so a piece of information that is a 1 but in a TEXT aura can
11549 be molded to @ud and then it changes its underlying atom-truth
11550 to become 1?
11551
11552~rabsef Does that help at all?
11553
11554 That is true but a mold does more than type changing. It creates
11555 structures like map which we'll discuss in one second
11556
11557 but like you say:
11558
11559 `@ud`'1'
11560
11561 I guess I should try and better differentiate those in my own
11562 mind, too.
11563
11564 I don't have a great analogy rn
11565
11566~ronlyr so line 16 is coercing the result of encoder and key into @t
11567
11568~somlus exactly '1' has the underlying atom of 49 because it is text not
11569 a number
11570
11571~digmev ( I have a lot of terminology reading to do ^^)
11572
11573~somlus so can you mold '1' to @ud and make it 1?
11574
11575~rabsef ~ronlyr - that is basically correct only you might say it is
11576 /expecting/ a map or else it will crash
11577
11578~somlus yeah it can be daunting ~digmev
11579
11580~rabsef ~somlus - you can parse the '1' into @ud1 but not by casting
11581
11582~digmev is there a faster way to tag users?
11583
11584~rabsef ~digmev - tag them?
11585
11586~digmev Yes like that
11587
11588~somlus there is no autocomplete yet, they know of this requested
11589 feature.
11590
11591~digmev Ok - though there was a shortcut nevermind
11592
11593~rabsef ~digmev oh you mean write their name - not that I'm aware of
11594
11595 yah no I'm just typing it lol
11596
11597~somlus we commonly use the first 3 letters but then there is no sound
11598 on mention
11599
11600 sup rab?
11601
11602~rabsef ok - back to the task at hand - operate requires a map of @t @t
11603 as it's third argument
11604
11605~somlus ok getting back to it, we are in line 16, looking at the encoder
11606 arm mention
11607
11608~rabsef so encoder should produce for us a map, after it's activities
11609
11610 let's talk about what a map is
11611
11612~somlus perfect thx
11613
11614~rabsef a map is a series of "values" and "keys" - I think of this as a
11615 vertical list of two columns
11616
11617 on the left, perhaps, you have the value, on the right, you have
11618 the key
11619
11620 a map will let us, from that, say "what is the value to key x"
11621 or "what is the key to value y"
11622
11623~minder like a matrix?
11624
11625~rabsef yes - or a two column database
11626
11627~somlus ok
11628
11629~rabsef so - let's conceptualize this program and see what a map might
11630 do for us
11631
11632 We're trying to take abc...z and convert our msg to using
11633 bcd...a, for instance
11634
11635 so "abc" becomes "bcd" and so on
11636
11637 obviously our map is going to line up our incoming letters to
11638 their new 'shifted' letters
11639
11640~somlus yes
11641
11642~rabsef and then we'll parse our incoming msg letter by letter against
11643 this map to make a new outgoing msg
11644
11645~somlus cool, I'm definitely following
11646
11647~rabsef so - operate we know, is going to produce what (look @ cast)
11648
11649 kethep
11650
11651~ronlyr tape
11652
11653~somlus yes
11654
11655 cool
11656
11657~rabsef bingo
11658
11659 so we know now what operate does - operate is going to give us
11660 back our 'shifted' message abc -> bcd
11661
11662 Here's the fun part - the cell at the beginning both shifts and
11663 unshifts your input message so if I put in abc, I get back [bcd
11664 zab]
11665
11666 why zab? Well that's assuming maybe you put in an encrypted
11667 string.. Thus, if I put in bcd, I get back [cde abc]
11668
11669~somlus which cell at the beginning?
11670
11671~rabsef line 5-6
11672
11673 sorry
11674
11675~somlus yes
11676
11677~rabsef the point is, shift and unshift are going to have parallel but
11678 opposite behaviors all the way down
11679
11680 so once we follow one through, we'll be able to think through
11681 the other one way more easily
11682
11683~somlus yes
11684
11685~rabsef this cuts our learning of the core (7-n) down significantly
11686
11687~somlus yes
11688
11689~rabsef I'm trying to think what I want to do next.
11690
11691~somlus all good so far, looking forward to understanding how the map is
11692 built
11693
11694~rabsef one second
11695
11696~somlus we have to define this map super precisely because it will not
11697 exist anywhere visually, i would imagine
11698
11699~rabsef that's right - and for me I have to visualize it
11700
11701 the two columns does the best so far
11702
11703 but there may be other ways I haven't conceived of for maps to
11704 exist
11705
11706~somlus I think I'm good for another 15 mins, I can feel my neurons
11707 reaching maximum "new info" capacity
11708
11709~rabsef ok - so let's leave operate for now - we can just drill all the
11710 way to the bottom and start building back up
11711
11712 let's go to encoder
11713
11714 We have, from operate, passed key as the @ud that the encoder
11715 takes in it's gate
11716
11717~somlus or I can power through, ok either way, just diminishing returns
11718 after 15 mins
11719
11720 going to encoder
11721
11722~rabsef we'll only go those 15 then I think we've made a lot of progress
11723
11724~somlus true.
11725
11726~rabsef tisfas =/ "combines a named noun w/ the subject, possibly w/
11727 type annotation"
11728
11729 we've seen this before - here we're creating "keytape" which is
11730 a tape and has a value of (rott alpha key)
11731
11732 we've seen the (arm arg arg) notation so we know rott is going
11733 to be an arm - further down the rabbit hole
11734
11735 let's just go to rott and see what it's doing - we can start
11736 building back up thereafter
11737
11738 First - what does rott want at it's gate?
11739
11740~ronlyr tape and unsigned decimal
11741
11742~rabsef yep - ok - rewind a second to our tisfas we just looked at (I'll
11743 type it)
11744
11745 =/ keytape=tape (rott alpha key)
11746
11747~somlus yes, and i'd like to input that I find it interesting that you
11748 only have to say "tape" and it knows over and over again that
11749 tape means the tape that the user inputted. very interesting.
11750
11751~rabsef no no - aha this is where you're wrong
11752
11753 keytape is not msg
11754
11755~ronlyr i think tape is the type
11756
11757~somlus oh really? ok
11758
11759~rabsef tape is the type, correct
11760
11761 keytape is "of type tape" and it's value is (rott alpha key)
11762
11763 what does that first argument (arm arg arg) mean?
11764
11765 alpha - what is alpha
11766
11767~ronlyr keytape is added to the subject by the =/ rune?
11768
11769~rabsef correct
11770
11771~somlus alpha is the leg of data
11772
11773~rabsef with a value and a potential type annotation; compare to =|
11774 which adds a named noun to the subject but does not provide it a
11775 starting value
11776
11777~somlus the full alphabet in lower case
11778
11779~rabsef yes - so keytape must be something about the alphabet after rott
11780 does work on it
11781
11782 so it is not our msg, it is the full alphabet manipulated
11783 somehow
11784
11785 let's go back to rott and finish there with our remaining time.
11786 We want to figure out what rott is doing to the alphabet, so we
11787 can know what keytape will look like
11788
11789~somlus ok so taking a small step back |= [m=tape n=@ud] is defining an
11790 output, a cell which contains a tape and an unsigned integer?
11791
11792~ronlyr why is it called rott?
11793
11794~rabsef ~somlus - no - remember that |= calls a gate and requests input,
11795 it gives that input faces and states their type
11796
11797~somlus oh yeah, I need flashcards man. I'm just going to make those
11798 because I always "best guess" these runes which is not good
11799 enough.
11800
11801~rabsef so |= [m=tape n=@ud] says "I call a gate, or function, and I
11802 want 2 inputs, a tape and an @ud, and I shall call them m and n
11803 respectively"
11804
11805~somlus I'll make that study tool soon
11806
11807~rabsef ~ronlyr - I think the joke is "rotation" because that's what
11808 it's going to do
11809
11810 but I'm not entirely sure... - anyway you could call it "flarf"
11811 and it would work as well
11812
11813~ronlyr ok. lol.
11814
11815~rabsef Now I've given away the game - but lets look @ rott anyway
11816
11817 first line of rott calls the gate and requests the input
11818
11819 we know we will be feeding it alpha ("abc...z") and our key
11820 value that we initially put into the program (let's say it's 1
11821 for now)
11822
11823 what does line 2 of rott do
11824
11825 (lent) establishes the number of items in a list.
11826
11827 a tape is a list, incidentally, if that doesn't follow
11828
11829 {a list of cords - we can review this - it gets complex}
11830
11831~ronlyr adds a face called length to the subject, witht a value set to
11832 the length of alpha
11833
11834~somlus sorry otf briefly answering a paitent question...
11835
11836~rabsef bingo
11837
11838~somlus will follow
11839
11840~rabsef you're fine - ronlyr, ur up
11841
11842 line 3 of rott is totally new
11843
11844 let's look at what trim does first
11845
11846 Tape split Split first a characters off ++tape b.
11847
11848 Produces A cell of ++tapes, p and q.
11849
11850 Accepts a is an atom. b is a ++tape.
11851
11852~somlus oh cool!
11853
11854~rabsef direct from the documentation. trim is going to require of us an
11855 atom and a tape, and produce for us a cell [p=tape q=tape] where
11856 we have split the first characters off of our incoming tape by a
11857 position
11858
11859 let's determine what values we're sending to trim
11860
11861 (trim >(mod n length)< >m<)
11862
11863 assuming our input was [alpha 1], what values do the arguments
11864 of trim resolve to
11865
11866 input to rott*
11867
11868 (mod 1 26)
11869
11870 modular arithmetic is weird to me still so I often try it in
11871 dojo before trying to figure it out
11872
11873~somlus so lent m resolves to 26 which is the value then for length
11874
11875~rabsef yes
11876
11877 so trim now has (trim 1 >m<)
11878
11879 and what is m again?
11880
11881~somlus and with a key of 1 then you are chopping off the a or the z
11882 from the string. just a moment
11883
11884 m is going to be a tape, but is not yet determined, I think
11885
11886 it is part of the output of rott
11887
11888~rabsef it came from our gate
11889
11890 m is declared in the input for our gate
11891
11892~ronlyr m is alpha
11893
11894~rabsef and we sent in, in my example, [alpha 1]
11895
11896 correct so m is our alphabet "abc...z"
11897
11898 (trim 1 "abc...z")
11899
11900~somlus oh from rott alpha key ! from line 23
11901
11902~rabsef which will result in -> [p="a" q="bcd...z"]
11903
11904 that is what trim gives us - a cell where the tape is split by
11905 our atom, and the new tape-lettes have faces p and q
11906
11907~somlus that is where you are sending stuff to rott, and then rott says
11908 ok based on this, I am going to assign m to the alpha and n to
11909 the key which ia "abc...z" and 1
11910
11911~rabsef this is helpful so we can extract one or the other part
11912
11913 that is correct
11914
11915 ok so now we know that s=[p="a" q="bcd...z"]
11916
11917 and =+ "pins a value to the head of the subject" - even now this
11918 rune is hard for me to fully conceptualize
11919
11920~somlus and then you weld them together and your new tape is bcd....za
11921
11922~rabsef it is somehow different from =/ but it adds a face and a value
11923 to the subject
11924
11925 correct ~somlus
11926
11927 so weld stitches two tapes together - if anyone didn't know
11928
11929 and we have the cell face s=>[p="a" q="bcd...z"]
11930
11931 and we are welding q of s in front of p of s
11932
11933 or, more appropriately we're welding p.s to the back of q.s
11934
11935~somlus can you show me where p becomes defined as a? I don't see that
11936
11937~rabsef that is what trim does
11938
11939~somlus I see where s gets trimmed
11940
11941~rabsef (trim 1 "abcde")
11942
11943~somlus how nifty,
11944
11945~rabsef It creates a cell w/ it's own faces interior to the cell
11946
11947 yah it's dank
11948
11949~somlus you get a p automatically and the rest
11950
11951 fantastic, a great tool
11952
11953~rabsef a lot of the standard library does that kind of stuff and it's
11954 super helpful cuz then u can address parts of the cell w/o +2
11955 notation
11956
11957~somlus that's so great. i was trying to figure out where the "other"
11958 trim was to preserve the chopped off letter, but it was
11959 preserved automatically
11960
11961 ok holmes, I think that might be it for now, but I want to make
11962 sure we got to a suitable stopping point. your call
11963
11964 we have not yet created the map, but we have the regular alpha
11965 and now the shifted tape that is the new alpha-ish thing we will
11966 map to it
11967
11968~rabsef ok - so now we're to the very bottom of the thing - we have
11969 one more thing to deal with but we know that we're going to 1)
11970 shift, which is going to 2) operate on our message based on 3)
11971 encoder which 4) is going to create a 5) rott-ed alpha
11972
11973 sorry - yes - I was looking @ the program to try and write the
11974 above - I think that's a good stopping point for now
11975
11976 for sure
11977
11978 we know exactly what's going to happen from here - just as
11979 you've said - we're going to make maps of alpha and rott's
11980 product and then do work from there to shift and unshift our
11981 input msg
11982
11983 It took me several days to figure that bad boy out the first
11984 time
11985
11986 lol
11987
11988~somlus cool. One critical takeaway for the non-coder or early coder is
11989 that every time we see an arm, we need to mentally attack it
11990 like it was something typed into the dojo. For (rott alpha key)
11991 we need to say "Ok we're gonna run rott now, and it will run on
11992 alpha and key, so let's make sure we understand that before we
11993 go further"
11994
11995~rabsef yes - I think it's really important to at least get the type out
11996 of each arm's product so you can see what type the (arm arg arg
11997 arg) args are
11998
11999~somlus dude this has been the best one yet, partly because I jammed
12000 through 12 hours of gelling the stuff from before. I need to
12001 review this today later to make sure I understand the flow. Good
12002 stuff. we can pick up next week
12003
12004~rabsef it will help you build a mental picture of what each arm does
12005 and what it needs to do it
12006
12007 yah - next week we'll talk about zipper hehe
12008
12009 and coder
12010
12011 anyone else want to ask anything before I step away for a min?
12012
12013 I'm lying - I'm going to work on my own project next lol
12014
12015 also - thank you ~somlus. This one is really fun because there's
12016 so much going on
12017
12018~somlus thank you very much. I need to show the wife some attention
12019 today for being hyperfocused yesterday. will only be connected
12020 intermittently. Thank you again, good stuff.
12021
12022~rabsef and it only gets 'worse' from here - so this is like jumping in
12023 deeply
12024
12025 we must learn to swim, and we're starting to :)
12026
12027 have a good day, ~som
12028
12029~ribnys thanks for doing this "out loud"- really helps to fill in gaps
12030 in knowledge
12031
12032~somlus thanks y'all. see you next sunday, and certainly before that
12033 here and there on mars
12034
12035~ronlyr thanks ~somlus
12036
12037~rabsef hey I'm glad it helps ~ribnys - that's aweosme
12038
12039~somlus ? ~ronlyr
12040
12041~risruc missed most of the session today, but caught what I could by
12042 scroll back.
12043
12044 good stuff teach o7
12045
12046~rabsef thanks :)
12047
12048~ronlyr question about declaring variables with tislus... If I type =+
12049 b=2 (add b 2) into the dojo, is the face b being added to the
12050 subject only for the execution of the second hoon expression?
12051
12052 when I type . at the dojo prompt to view the dojo subject,
12053 I don't see the face b, so I'm assuming tislus just makes
12054 temporary variables that go out of scope after it's done
12055 running?
12056
12057~rabsef I think it's the way you're writing that expression
12058
12059 > =+ s=(trim 1 "abcde") s [p="a" q="bcde"]
12060
12061 =+ b=2 (add b 2) is not a valid use of =+ because =+ gives
12062 a face to the expression after itself for the evaluation of
12063 whatever follows
12064
12065 my messages are lagging here
12066
12067 There we go
12068
12069 =+ b=2
12070
12071 that's valid and pins b to the subject which you could call
12072 later (add b 2) and get 4
12073
12074 oh it didn't like what I wrote - =+ b=2 is valid
12075
12076~ronlyr yeah, laggy messages. getting them 4 minutes after the timestamp
12077 on them.
12078
12079~rabsef does that answer ur question tho?
12080
12081~ronlyr are you sure that is invalid? =+ b=2 (add b 2) works when I type
12082 it into dojo...
12083
12084~somlus that would be my ship, have tried to troubleshoot extensively,
12085 one day will breach. Perhaps when OS1 comes out will need to
12086 breach.
12087
12088~ronlyr my understanding of tislus is the result of the first expression
12089 is added to the subject so it can be used when the second
12090 expression is evaluated.
12091
12092~rabsef I'm actually wrong
12093
12094 yes it's pinned to the head of the subject for the evaluation of
12095 the next part and then ephemerally disappears
12096
12097 so you should be able to, on two lines in dojo, line 1: =+ b=2,
12098 line 2: (add b 2) and get 4 and then if you b again it will
12099 find.b error
12100
12101~bannum faces once they get used by the rune following a tislus
12102
12103~rabsef yes lol
12104
12105~ronlyr I finally just got that the tislus on line 45 of caesar cipher
12106 is actually the 3rd argument of the tisfas rune on line 44.
12107
12108~rabsef I don't think that's right - so =/ length=@ud (lent m) is a
12109 complete thought
12110
12111 it creates the length of m in @ud w/ a face of length
12112
12113 then =+ creates an ephemeral s of [p="" q=""] for the evaluation
12114 of weld
12115
12116 =+ uses =/'s value (length) but is not actually a child of =/
12117
12118 does that make sense? I'm open to hearing contradiction there -
12119 lmk if I'm wrong
12120
12121~ronlyr =/ length=@ud (lent m) isn't a complete thought. tisfas takes 3
12122 parameters.
12123
12124 the 3rd parameter is a hoon expression
12125
12126~rabsef it has 3
12127
12128 =/ "length"="@ud" "(lent m"
12129
12130~ronlyr length=@ud is one argument
12131
12132 it's declaring a variable with the name length, with the type
12133 @ud
12134
12135~rabsef https://urbit.org/docs/reference/hoon-expressions/rune/tis/#tisf
12136 as
12137
12138 look in the example here - is the second tisfas the child of the
12139 first?
12140
12141 surely not
12142
12143~ronlyr it actually is. try it in dojo
12144
12145~rabsef =foo =/ a 2 ; a is a valid construction
12146
12147 I suppose you can say that everything after tisfas is a child of
12148 it as it's what is evaluated against the tisfas
12149
12150 Is that what you're saying?
12151
12152 ; denoting a return
12153
12154 just put this in dojo>=/ a 2 ; then a and you will get 2. a is
12155 not a child of =/ because your > doesn't go to < indicating it
12156 needs more children
12157
12158~ronlyr yeah, kind of. lines 45 and 46 are the hoon expression that is
12159 the 3rd argument of the tisfas
12160
12161~rabsef but I don't think that's quite right because =/ a 2 is _valid_
12162 and closed
12163
12164 in dojo
12165
12166 https://hastebin.com/uwutogawug.shell
12167
12168 you can =/ b 3 and then do any number of other computations and
12169 b will still be in the subject
12170
12171 as long as you don't "=b" as part of those subsequent
12172 computations (which would clear b)
12173
12174 contrast w/ =+ where as soon as evaluated, it disappears
12175
12176~ronlyr if I do =/ a 2 in dojo, it wants another input
12177
12178 if i type a, i get 2 back
12179
12180 type a again, and get ford ride failed
12181
12182~rabsef I'm having trouble following you to "it wants another input"
12183
12184~ronlyr so, =/ a 2 is NOT valid closed in dojo
12185
12186~rabsef you know what - you're totally right
12187
12188 Sorry
12189
12190~ronlyr dojo prompt changes from dojo> to dojo<
12191
12192~rabsef yep - I was thinking of =b and I'm wrong
12193
12194~ronlyr I just spent the past couple hours diving into understanding the
12195 difference between tislus and tisfas
12196
12197~rabsef Well clearly I should do that
12198
12199 Thanks for correcting me
12200
12201~ronlyr thanks for inspiring me to dive into it!
12202
12203~rabsef :) sorry for bad information, truly. I should be more careful
12204
12205~sibhul Is there an optimal place to look in the hoon tutorials to look
12206 for an example or explanation of using a naked generator to
12207 apply an aura to an atom?
12208
12209~rabsef https://urbit.org/docs/tutorials/hoon/nouns/
12210
12211 I would look @ the casting part there
12212
12213 and this example of a naked generator is overly robust for your
12214 purposes - you don't need recursion - but you could get the
12215 style/format her:
12216
12217 here*:
12218
12219 https://urbit.org/docs/tutorials/hoon/list-of-numbers/
12220
12221 What part are you feeling you're having trouble w/?
12222
12223~sibhul I'm having trouble with the aura return in a *.hoon. I'm fairly
12224 certain that I have the input worked out, but the syntax of aura
12225 return seems to be elusive.
12226
12227~rabsef wanna pastebin your code and I'll see if I can give a hint w/o
12228 giving it away?
12229
12230~sibhul Sure. I've already got my embarrassment prepared.
12231 https://pastebin.com/fiKRhgTj
12232
12233~rabsef I'd review how casting happens in the nouns link above
12234
12235 You're pretty close. Also you might consider how the list of
12236 numbers syntax varies from your long form into tall form, which
12237 I think is easier to read in this case
12238
12239 last hint, I just got your code to work by changing some things
12240 and mine only has one set of parentheses
12241
12242 (it's still in long form)
12243
12244~sibhul Yeah, I can feel I'm close, something isn't quite clicking yet.
12245 Going to take a quick break and come back to it.
12246
12247 Okay, I think this must be darn close. It now 'runs' with no
12248 syntax errors, but I get 'ford: %slim failed:' as well as other
12249 errors. https://pastebin.com/V2j3NpZn
12250
12251~rabsef you're very close but you've sort of half changed to tall form
12252
12253 tall form should be like |= required input <return> things to do
12254
12255 another way of saying the above is you removed different
12256 parentheses than I did
12257
12258 https://pastebin.com/HxYdd1bw
12259
12260 ^I didn't fix it or help you - just showed the different forms
12261
12262~sibhul Got it! Thanks so much. Not sure why that didn't register after
12263 reading the reading the style guide. Much appreciated.
12264
12265~rabsef I think tall/long/irregular forms are tough, myself
12266
12267 glad you got it
12268
12269 I'm gonna go do nothin for a while - see yah later hoontards
12270
12271~ronlyr on line 41 of the Caesar Cipher, chart (~(put by chart) i.a
12272 i.b), I understand that it is assigning the head of a as the key
12273 and the head of b as the value to the map called chart, but what
12274 exactly is the ~() syntax doing? The only reference I can find
12275 to ~ is that it means a null value.
12276
12277~bannum ~(put by chart) is shorthand for climbing down the structure, so
12278 it'll become chart.by.put or something
12279
12280 I forget which direction it is its been a while sorry
12281
12282~hastuc ~(put by chart) is syntax for accessing the arm in a door
12283 (https://urbit.org/docs/glossary/door/)
12284
12285 ~(put by chart) gets the door named by, sets the sample of the
12286 door to chart, then gets the arm 'put' from the door
12287
12288~rabsef check out 2i for got by in use
12289
12290 its irregular censig I’m pretty sure but I can’t exactly explain
12291 it. that’s one I need to understand better
12292
12293 welp I was way behind there lol
12294
12295 hastuc correct me if I’m wrong but the gate created by the arm
12296 put of the door by then needs an argu so you get (the created
12297 gate arg I.a I.b)
12298
12299~hastuc yeah that's right
12300
12301~rabsef I wanted to follow up on this cuz I was looking @ the by arm of
12302 the standard library which is a wet core and I was like "wait
12303 but that's not a door" - long and the short of it is a wet core
12304 is a door
12305
12306 so just don't be confused by by not having |_ in it
12307
12308 in ~(got by map) the map replaces the a value of the by arm's
12309 sample. There's more to that but that's what I wanted to
12310 establish for myself - IDK if that' ssuper helpful, but maybe so
12311 :)
12312
12313~walden does anyone have an estimate of the number of people who know
12314 hoon? just curious
12315
12316~hastuc well 31 people have committed more than 1k LoC to
12317 urbit, so like at least 31 intermediate-advanced
12318 hoon developers with sufficient time to contribute
12319 (https://github.com/urbit/urbit/graphs/contributors?from=2013-09
12320 -22&to=2020-02-11&type=a)
12321
12322~walden (sorry for the u-h crosspost, ignore)
12323
12324~norsyr ha! I made the cut! (barely...) I'll add intermediate-advanced
12325 hoon developer to my linkedin profile :D
12326
12327~somlus very cool to know that actually ~hastuc
12328
12329~risruc +1